applications.c 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. #include "applications.h"
  2. #ifdef APP_TEST
  3. int32_t flipper_test_app(void* p);
  4. #endif
  5. int32_t application_blink(void* p);
  6. int32_t application_uart_write(void* p);
  7. int32_t application_input_dump(void* p);
  8. int32_t u8g2_example(void* p);
  9. int32_t input_task(void* p);
  10. int32_t menu_task(void* p);
  11. int32_t coreglitch_demo_0(void* p);
  12. int32_t u8g2_qrcode(void* p);
  13. int32_t gui_task(void* p);
  14. int32_t backlight_control(void* p);
  15. int32_t irda(void* p);
  16. int32_t app_loader(void* p);
  17. int32_t cc1101_workaround(void* p);
  18. int32_t lf_rfid_workaround(void* p);
  19. int32_t nfc_task(void* p);
  20. int32_t dolphin_task(void* p);
  21. int32_t power_task(void* p);
  22. int32_t bt_task(void* p);
  23. int32_t sd_card_test(void* p);
  24. int32_t application_vibro(void* p);
  25. int32_t app_gpio_test(void* p);
  26. int32_t app_ibutton(void* p);
  27. int32_t cli_task(void* p);
  28. int32_t music_player(void* p);
  29. int32_t sdnfc(void* p);
  30. int32_t floopper_bloopper(void* p);
  31. int32_t sd_filesystem(void* p);
  32. int32_t app_subghz(void* p);
  33. int32_t gui_test(void* p);
  34. const FlipperApplication FLIPPER_SERVICES[] = {
  35. #ifdef APP_CLI
  36. {.app = cli_task, .name = "cli_task", .stack_size = 1024, .icon = A_Plugins_14},
  37. #endif
  38. #ifdef APP_EXAMPLE_BLINK
  39. {.app = application_blink, .name = "blink", .stack_size = 1024, .icon = A_Plugins_14},
  40. #endif
  41. #ifdef APP_INPUT
  42. {.app = input_task, .name = "input_task", .stack_size = 1024, .icon = A_Plugins_14},
  43. #endif
  44. #ifdef APP_EXAMPLE_INPUT_DUMP
  45. {.app = application_input_dump, .name = "input dump", .stack_size = 1024, .icon = A_Plugins_14},
  46. #endif
  47. #ifdef APP_GUI
  48. {.app = backlight_control,
  49. .name = "backlight_control",
  50. .stack_size = 1024,
  51. .icon = A_Plugins_14},
  52. {.app = gui_task, .name = "gui_task", .stack_size = 1024, .icon = A_Plugins_14},
  53. #endif
  54. #ifdef APP_MENU
  55. {.app = menu_task, .name = "menu_task", .stack_size = 1024, .icon = A_Plugins_14},
  56. {.app = app_loader, .name = "app_loader", .stack_size = 1024, .icon = A_Plugins_14},
  57. #endif
  58. #ifdef APP_SD_FILESYSTEM
  59. {.app = sd_filesystem, .name = "sd_filesystem", .stack_size = 1024, .icon = A_Plugins_14},
  60. #endif
  61. #ifdef APP_DOLPHIN
  62. {.app = dolphin_task, .name = "dolphin_task", .stack_size = 1024, .icon = A_Plugins_14},
  63. #endif
  64. #ifdef APP_POWER
  65. {.app = power_task, .name = "power_task", .stack_size = 1024, .icon = A_Plugins_14},
  66. #endif
  67. #ifdef APP_BT
  68. {.app = bt_task, .name = "bt_task", .stack_size = 1024, .icon = A_Plugins_14},
  69. #endif
  70. #ifdef APP_CC1101
  71. {.app = cc1101_workaround,
  72. .name = "cc1101 workaround",
  73. .stack_size = 1024,
  74. .icon = A_Plugins_14},
  75. #endif
  76. #ifdef APP_LF_RFID
  77. {.app = lf_rfid_workaround,
  78. .name = "lf rfid workaround",
  79. .stack_size = 1024,
  80. .icon = A_Plugins_14},
  81. #endif
  82. #ifdef APP_IRDA
  83. {.app = irda, .name = "irda", .stack_size = 1024, .icon = A_Plugins_14},
  84. #endif
  85. #ifdef APP_NFC
  86. {.app = nfc_task, .name = "nfc_task", .stack_size = 1024, .icon = A_Plugins_14},
  87. #endif
  88. #ifdef APP_TEST
  89. {.app = flipper_test_app, .name = "test app", .stack_size = 1024, .icon = A_Plugins_14},
  90. #endif
  91. #ifdef APP_EXAMPLE_QRCODE
  92. {.app = u8g2_qrcode, .name = "u8g2_qrcode", .stack_size = 1024, .icon = A_Plugins_14},
  93. #endif
  94. #ifdef APP_EXAMPLE_DISPLAY
  95. {.app = u8g2_example, .name = "u8g2_example", .stack_size = 1024, .icon = A_Plugins_14},
  96. #endif
  97. #ifdef APP_SPEAKER_DEMO
  98. {.app = coreglitch_demo_0,
  99. .name = "coreglitch_demo_0",
  100. .stack_size = 1024,
  101. .icon = A_Plugins_14},
  102. #endif
  103. #ifdef APP_SD_TEST
  104. {.app = sd_card_test, .name = "sd_card_test", .stack_size = 4096, .icon = A_Plugins_14},
  105. #endif
  106. #ifdef APP_MUSIC_PLAYER
  107. {.app = music_player, .name = "music player", .stack_size = 1024, .icon = A_Plugins_14},
  108. #endif
  109. #ifdef APP_IBUTTON
  110. {.app = app_ibutton, .name = "ibutton", .stack_size = 1024, .icon = A_Plugins_14},
  111. #endif
  112. #ifdef APP_GPIO_DEMO
  113. {.app = app_gpio_test, .name = "gpio test", .stack_size = 1024, .icon = A_Plugins_14},
  114. #endif
  115. #ifdef APP_FLOOPPER_BLOOPPER
  116. {.app = floopper_bloopper, .name = "Floopper Bloopper", .stack_size = 1024, .icon = A_Games_14},
  117. #endif
  118. #ifdef APP_SDNFC
  119. {.app = sdnfc, .name = "sdnfc", .stack_size = 1024, .icon = A_Plugins_14},
  120. #endif
  121. #ifdef APP_GUI_TEST
  122. {.app = gui_test, .name = "gui_test", .stack_size = 1024, .icon = A_Plugins_14},
  123. #endif
  124. #ifdef APP_SUBGHZ
  125. {.app = app_subghz, .name = "app_subghz", .stack_size = 1024, .icon = A_Plugins_14},
  126. #endif
  127. };
  128. const size_t FLIPPER_SERVICES_COUNT = sizeof(FLIPPER_SERVICES) / sizeof(FlipperApplication);
  129. // Main menu APP
  130. const FlipperApplication FLIPPER_APPS[] = {
  131. #ifdef BUILD_CC1101
  132. {.app = cc1101_workaround, .name = "Sub-1 GHz", .stack_size = 1024, .icon = A_Sub1ghz_14},
  133. #endif
  134. #ifdef BUILD_LF_RFID
  135. {.app = lf_rfid_workaround, .name = "125 kHz RFID", .stack_size = 1024, .icon = A_125khz_14},
  136. #endif
  137. #ifdef BUILD_IRDA
  138. {.app = irda, .name = "Infrared", .stack_size = 1024, .icon = A_Infrared_14},
  139. #endif
  140. #ifdef BUILD_IBUTTON
  141. {.app = app_ibutton, .name = "iButton", .stack_size = 1024, .icon = A_iButton_14},
  142. #endif
  143. #ifdef BUILD_GPIO_DEMO
  144. {.app = app_gpio_test, .name = "GPIO", .stack_size = 1024, .icon = A_GPIO_14},
  145. #endif
  146. };
  147. const size_t FLIPPER_APPS_COUNT = sizeof(FLIPPER_APPS) / sizeof(FlipperApplication);
  148. // Plugin menu
  149. const FlipperApplication FLIPPER_PLUGINS[] = {
  150. #ifdef BUILD_EXAMPLE_BLINK
  151. {.app = application_blink, .name = "blink", .stack_size = 1024, .icon = A_Plugins_14},
  152. #endif
  153. #ifdef BUILD_EXAMPLE_INPUT_DUMP
  154. {.app = application_input_dump, .name = "input dump", .stack_size = 1024, .icon = A_Plugins_14},
  155. #endif
  156. #ifdef BUILD_SPEAKER_DEMO
  157. {.app = coreglitch_demo_0,
  158. .name = "coreglitch_demo_0",
  159. .stack_size = 1024,
  160. .icon = A_Plugins_14},
  161. #endif
  162. #ifdef BUILD_SD_TEST
  163. {.app = sd_card_test, .name = "sd_card_test", .stack_size = 4096, .icon = A_Plugins_14},
  164. #endif
  165. #ifdef BUILD_VIBRO_DEMO
  166. {.app = application_vibro,
  167. .name = "application_vibro",
  168. .stack_size = 1024,
  169. .icon = A_Plugins_14},
  170. #endif
  171. #ifdef BUILD_MUSIC_PLAYER
  172. {.app = music_player, .name = "music player", .stack_size = 1024, .icon = A_Plugins_14},
  173. #endif
  174. #ifdef BUILD_FLOOPPER_BLOOPPER
  175. {.app = floopper_bloopper, .name = "Floopper Bloopper", .stack_size = 1024, .icon = A_Games_14},
  176. #endif
  177. #ifdef BUILD_SDNFC
  178. {.app = sdnfc, .name = "sdnfc", .stack_size = 1024, .icon = A_Plugins_14},
  179. #endif
  180. #ifdef BUILD_GUI_TEST
  181. {.app = gui_test, .name = "gui_test", .stack_size = 1024, .icon = A_Plugins_14},
  182. #endif
  183. #ifdef BUILD_SUBGHZ
  184. {.app = app_subghz, .name = "app_subghz", .stack_size = 1024, .icon = A_Plugins_14},
  185. #endif
  186. };
  187. const size_t FLIPPER_PLUGINS_COUNT = sizeof(FLIPPER_PLUGINS) / sizeof(FlipperApplication);