applications.c 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. #include "applications.h"
  2. int32_t flipper_test_app(void* p);
  3. int32_t application_blink(void* p);
  4. int32_t application_uart_write(void* p);
  5. int32_t application_input_dump(void* p);
  6. int32_t u8g2_example(void* p);
  7. int32_t input_task(void* p);
  8. int32_t menu_task(void* p);
  9. int32_t coreglitch_demo_0(void* p);
  10. int32_t u8g2_qrcode(void* p);
  11. int32_t gui_task(void* p);
  12. int32_t backlight_control(void* p);
  13. int32_t irda(void* p);
  14. int32_t app_loader(void* p);
  15. int32_t lf_rfid_workaround(void* p);
  16. int32_t nfc_task(void* p);
  17. int32_t dolphin_task(void* p);
  18. int32_t power_task(void* p);
  19. int32_t bt_task(void* p);
  20. int32_t sd_card_test(void* p);
  21. int32_t application_vibro(void* p);
  22. int32_t app_gpio_test(void* p);
  23. int32_t app_ibutton(void* p);
  24. int32_t cli_task(void* p);
  25. int32_t music_player(void* p);
  26. int32_t sdnfc(void* p);
  27. int32_t floopper_bloopper(void* p);
  28. int32_t sd_filesystem(void* p);
  29. int32_t subghz_app(void* p);
  30. int32_t gui_test(void* p);
  31. int32_t keypad_test(void* p);
  32. int32_t scene_app(void* p);
  33. int32_t passport(void* p);
  34. int32_t app_accessor(void* p);
  35. const FlipperApplication FLIPPER_SERVICES[] = {
  36. #ifdef SRV_CLI
  37. {.app = cli_task, .name = "cli_task", .stack_size = 2048, .icon = A_Plugins_14},
  38. #endif
  39. #ifdef SRV_EXAMPLE_BLINK
  40. {.app = application_blink, .name = "blink", .stack_size = 1024, .icon = A_Plugins_14},
  41. #endif
  42. #ifdef SRV_INPUT
  43. {.app = input_task, .name = "input_task", .stack_size = 1024, .icon = A_Plugins_14},
  44. #endif
  45. #ifdef SRV_EXAMPLE_INPUT_DUMP
  46. {.app = application_input_dump, .name = "input dump", .stack_size = 1024, .icon = A_Plugins_14},
  47. #endif
  48. #ifdef SRV_GUI
  49. {.app = backlight_control,
  50. .name = "backlight_control",
  51. .stack_size = 1024,
  52. .icon = A_Plugins_14},
  53. // TODO: fix stack size when sd api will be in separate thread
  54. {.app = gui_task, .name = "gui_task", .stack_size = 8192, .icon = A_Plugins_14},
  55. #endif
  56. #ifdef SRV_MENU
  57. {.app = menu_task, .name = "menu_task", .stack_size = 1024, .icon = A_Plugins_14},
  58. {.app = app_loader, .name = "app_loader", .stack_size = 1024, .icon = A_Plugins_14},
  59. #endif
  60. #ifdef SRV_SD_FILESYSTEM
  61. {.app = sd_filesystem, .name = "sd_filesystem", .stack_size = 4096, .icon = A_Plugins_14},
  62. #endif
  63. #ifdef SRV_DOLPHIN
  64. {.app = dolphin_task, .name = "dolphin_task", .stack_size = 1024, .icon = A_Plugins_14},
  65. #endif
  66. #ifdef SRV_POWER
  67. {.app = power_task, .name = "power_task", .stack_size = 1024, .icon = A_Plugins_14},
  68. #endif
  69. #ifdef SRV_BT
  70. {.app = bt_task, .name = "bt_task", .stack_size = 1024, .icon = A_Plugins_14},
  71. #endif
  72. #ifdef SRV_LF_RFID
  73. {.app = lf_rfid_workaround,
  74. .name = "lf rfid workaround",
  75. .stack_size = 1024,
  76. .icon = A_Plugins_14},
  77. #endif
  78. #ifdef SRV_IRDA
  79. {.app = irda, .name = "irda", .stack_size = 1024, .icon = A_Plugins_14},
  80. #endif
  81. #ifdef SRV_NFC
  82. {.app = nfc_task, .name = "nfc_task", .stack_size = 1024, .icon = A_Plugins_14},
  83. #endif
  84. #ifdef SRV_EXAMPLE_QRCODE
  85. {.app = u8g2_qrcode, .name = "u8g2_qrcode", .stack_size = 1024, .icon = A_Plugins_14},
  86. #endif
  87. #ifdef SRV_EXAMPLE_DISPLAY
  88. {.app = u8g2_example, .name = "u8g2_example", .stack_size = 1024, .icon = A_Plugins_14},
  89. #endif
  90. #ifdef SRV_SPEAKER_DEMO
  91. {.app = coreglitch_demo_0,
  92. .name = "coreglitch_demo_0",
  93. .stack_size = 1024,
  94. .icon = A_Plugins_14},
  95. #endif
  96. #ifdef SRV_SD_TEST
  97. {.app = sd_card_test, .name = "sd_card_test", .stack_size = 4096, .icon = A_Plugins_14},
  98. #endif
  99. #ifdef SRV_MUSIC_PLAYER
  100. {.app = music_player, .name = "music player", .stack_size = 1024, .icon = A_Plugins_14},
  101. #endif
  102. #ifdef SRV_IBUTTON
  103. {.app = app_ibutton, .name = "ibutton", .stack_size = 4096, .icon = A_Plugins_14},
  104. #endif
  105. #ifdef SRV_GPIO_DEMO
  106. {.app = app_gpio_test, .name = "gpio test", .stack_size = 1024, .icon = A_Plugins_14},
  107. #endif
  108. #ifdef SRV_FLOOPPER_BLOOPPER
  109. {.app = floopper_bloopper, .name = "Floopper Bloopper", .stack_size = 1024, .icon = A_Games_14},
  110. #endif
  111. #ifdef SRV_SDNFC
  112. {.app = sdnfc, .name = "sdnfc", .stack_size = 1024, .icon = A_Plugins_14},
  113. #endif
  114. #ifdef SRV_GUI_TEST
  115. {.app = gui_test, .name = "gui_test", .stack_size = 1024, .icon = A_Plugins_14},
  116. #endif
  117. #ifdef SRV_KEYPAD_TEST
  118. {.app = keypad_test, .name = "keypad_test", .icon = A_Plugins_14},
  119. #endif
  120. #ifdef SRV_ACCESSOR
  121. {.app = app_accessor, .name = "accessor", .stack_size = 4096, .icon = A_Plugins_14},
  122. #endif
  123. };
  124. const size_t FLIPPER_SERVICES_COUNT = sizeof(FLIPPER_SERVICES) / sizeof(FlipperApplication);
  125. // Main menu APP
  126. const FlipperApplication FLIPPER_APPS[] = {
  127. #ifdef APP_SUBGHZ
  128. {.app = subghz_app, .name = "Sub-1 GHz", .stack_size = 1024, .icon = A_Sub1ghz_14},
  129. #endif
  130. #ifdef APP_LF_RFID
  131. {.app = lf_rfid_workaround, .name = "125 kHz RFID", .stack_size = 1024, .icon = A_125khz_14},
  132. #endif
  133. #ifdef APP_IRDA
  134. {.app = irda, .name = "Infrared", .stack_size = 1024, .icon = A_Infrared_14},
  135. #endif
  136. #ifdef APP_IBUTTON
  137. {.app = app_ibutton, .name = "iButton", .stack_size = 4096, .icon = A_iButton_14},
  138. #endif
  139. #ifdef APP_GPIO_DEMO
  140. {.app = app_gpio_test, .name = "GPIO", .stack_size = 1024, .icon = A_GPIO_14},
  141. #endif
  142. };
  143. const size_t FLIPPER_APPS_COUNT = sizeof(FLIPPER_APPS) / sizeof(FlipperApplication);
  144. // Plugin menu
  145. const FlipperApplication FLIPPER_PLUGINS[] = {
  146. #ifdef APP_MUSIC_PLAYER
  147. {.app = music_player, .name = "music player", .stack_size = 1024, .icon = A_Plugins_14},
  148. #endif
  149. #ifdef APP_FLOOPPER_BLOOPPER
  150. {.app = floopper_bloopper, .name = "Floopper Bloopper", .stack_size = 1024, .icon = A_Games_14},
  151. #endif
  152. #ifdef APP_SPEAKER_DEMO
  153. {.app = coreglitch_demo_0,
  154. .name = "coreglitch_demo_0",
  155. .stack_size = 1024,
  156. .icon = A_Plugins_14},
  157. #endif
  158. };
  159. const size_t FLIPPER_PLUGINS_COUNT = sizeof(FLIPPER_PLUGINS) / sizeof(FlipperApplication);
  160. // Plugin menu
  161. const FlipperApplication FLIPPER_DEBUG_APPS[] = {
  162. #ifdef APP_EXAMPLE_BLINK
  163. {.app = application_blink, .name = "blink", .stack_size = 1024, .icon = A_Plugins_14},
  164. #endif
  165. #ifdef APP_EXAMPLE_INPUT_DUMP
  166. {.app = application_input_dump, .name = "input dump", .stack_size = 1024, .icon = A_Plugins_14},
  167. #endif
  168. #ifdef APP_SD_TEST
  169. {.app = sd_card_test, .name = "sd_card_test", .stack_size = 4096, .icon = A_Plugins_14},
  170. #endif
  171. #ifdef APP_VIBRO_DEMO
  172. {.app = application_vibro, .name = "vibro", .stack_size = 1024, .icon = A_Plugins_14},
  173. #endif
  174. #ifdef APP_SDNFC
  175. {.app = sdnfc, .name = "sdnfc", .stack_size = 1024, .icon = A_Plugins_14},
  176. #endif
  177. #ifdef APP_GUI_TEST
  178. {.app = gui_test, .name = "gui_test", .stack_size = 1024, .icon = A_Plugins_14},
  179. #endif
  180. #ifdef APP_KEYPAD_TEST
  181. {.app = keypad_test, .name = "keypad_test", .icon = A_Plugins_14},
  182. #endif
  183. #ifdef APP_ACCESSOR
  184. {.app = app_accessor, .name = "accessor", .stack_size = 4096, .icon = A_Plugins_14},
  185. #endif
  186. #ifdef APP_UNIT_TESTS
  187. {.app = flipper_test_app, .name = "Unit Tests", .stack_size = 1024, .icon = A_Plugins_14},
  188. #endif
  189. };
  190. const size_t FLIPPER_DEBUG_APPS_COUNT = sizeof(FLIPPER_DEBUG_APPS) / sizeof(FlipperApplication);
  191. #ifdef SRV_DOLPHIN
  192. const FlipperApplication FLIPPER_SCENE =
  193. {.app = scene_app, .name = "Scenes", .stack_size = 1024, .icon = A_Games_14};
  194. const FlipperApplication FLIPPER_SCENE_APPS[] = {
  195. {.app = passport, .name = "Passport", .stack_size = 1024, .icon = A_Games_14},
  196. {.app = music_player, .name = "Music player", .stack_size = 1024, .icon = A_Plugins_14},
  197. {.app = floopper_bloopper, .name = "Floopper Bloopper", .stack_size = 1024, .icon = A_Games_14},
  198. };
  199. const size_t FLIPPER_SCENE_APPS_COUNT = sizeof(FLIPPER_SCENE_APPS) / sizeof(FlipperApplication);
  200. #endif