system_init.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (c) 2019 Actions Semiconductor Co., Ltd
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * @file system init file
  8. */
  9. #include <os_common_api.h>
  10. #include <stdint.h>
  11. #include <stdbool.h>
  12. #include <string.h>
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15. #include <ctype.h>
  16. #include <srv_manager.h>
  17. /*share stack for app thread */
  18. //char __stack_noinit __aligned(ARCH_STACK_PTR_ALIGN) share_stack_area[CONFIG_APP_STACKSIZE];
  19. #ifdef CONFIG_MEDIA_SERVICE
  20. /*stack for media service */
  21. #ifdef CONFIG_SOC_NO_PSRAM
  22. __in_section_unique(media.noinit.stack)
  23. #endif
  24. char __aligned(ARCH_STACK_PTR_ALIGN) meidasrv_stack_area[CONFIG_MEDIASRV_STACKSIZE];
  25. extern void media_service_main_loop(void * parama1, void * parama2, void * parama3);
  26. SERVICE_DEFINE(media, \
  27. meidasrv_stack_area, CONFIG_MEDIASRV_STACKSIZE, \
  28. CONFIG_MEDIASRV_PRIORITY, BACKGROUND_APP, \
  29. NULL, NULL, NULL, \
  30. media_service_main_loop);
  31. #endif
  32. #ifdef CONFIG_BT_SERVICE
  33. /*stack for bt service */
  34. #ifdef CONFIG_SOC_NO_PSRAM
  35. __in_section_unique(bthost.noinit.stack)
  36. #endif
  37. char __aligned(ARCH_STACK_PTR_ALIGN) btsrv_stack_area[CONFIG_BTSRV_STACKSIZE];
  38. extern void bt_service_main_loop(void * parama1, void * parama2, void * parama3);
  39. SERVICE_DEFINE(bluetooth, \
  40. btsrv_stack_area, CONFIG_BTSRV_STACKSIZE, \
  41. CONFIG_BTSRV_PRIORITY, BACKGROUND_APP, \
  42. NULL, NULL, NULL, \
  43. bt_service_main_loop);
  44. #endif
  45. #ifdef CONFIG_BT_HCI
  46. extern uint32_t libbtstack_version_dump(void);
  47. extern uint32_t libbtservice_version_dump(void);
  48. #ifdef CONFIG_BT_A2DP_TRS
  49. extern uint32_t libbttrans_version_dump(void);
  50. #endif
  51. #endif
  52. #ifdef CONFIG_MEDIA_SERVICE
  53. extern uint32_t libmedia_version_dump(void);
  54. #endif
  55. #ifdef CONFIG_OTA_UPGRADE
  56. extern uint32_t libota_version_dump(void);
  57. #endif
  58. #ifdef CONFIG_UI_MANAGER
  59. extern uint32_t libdisplay_version_dump(void);
  60. #endif
  61. void system_library_version_dump(void)
  62. {
  63. #ifdef CONFIG_BT_HCI
  64. #ifdef CONFIG_BT_A2DP_TRS
  65. libbttrans_version_dump();
  66. #endif
  67. #endif
  68. #ifdef CONFIG_MEDIA_SERVICE
  69. libmedia_version_dump();
  70. #endif
  71. #ifdef CONFIG_OTA_UPGRADE
  72. libota_version_dump();
  73. #endif
  74. #ifdef CONFIG_UI_MANAGER
  75. libdisplay_version_dump();
  76. #endif
  77. os_printk("\n");
  78. }