applications.c 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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 gui_test(void* p);
  33. const FlipperApplication FLIPPER_SERVICES[] = {
  34. #ifdef APP_CLI
  35. {.app = cli_task, .name = "cli_task", .stack_size = 1024, .icon = A_Plugins_14},
  36. #endif
  37. #ifdef APP_EXAMPLE_BLINK
  38. {.app = application_blink, .name = "blink", .stack_size = 1024, .icon = A_Plugins_14},
  39. #endif
  40. #ifdef APP_INPUT
  41. {.app = input_task, .name = "input_task", .stack_size = 1024, .icon = A_Plugins_14},
  42. #endif
  43. #ifdef APP_EXAMPLE_INPUT_DUMP
  44. {.app = application_input_dump, .name = "input dump", .stack_size = 1024, .icon = A_Plugins_14},
  45. #endif
  46. #ifdef APP_GUI
  47. {.app = backlight_control,
  48. .name = "backlight_control",
  49. .stack_size = 1024,
  50. .icon = A_Plugins_14},
  51. {.app = gui_task, .name = "gui_task", .stack_size = 1024, .icon = A_Plugins_14},
  52. #endif
  53. #ifdef APP_MENU
  54. {.app = menu_task, .name = "menu_task", .stack_size = 1024, .icon = A_Plugins_14},
  55. {.app = app_loader, .name = "app_loader", .stack_size = 1024, .icon = A_Plugins_14},
  56. #endif
  57. #ifdef APP_SD_FILESYSTEM
  58. {.app = sd_filesystem, .name = "sd_filesystem", .stack_size = 1024, .icon = A_Plugins_14},
  59. #endif
  60. #ifdef APP_DOLPHIN
  61. {.app = dolphin_task, .name = "dolphin_task", .stack_size = 1024, .icon = A_Plugins_14},
  62. #endif
  63. #ifdef APP_POWER
  64. {.app = power_task, .name = "power_task", .stack_size = 1024, .icon = A_Plugins_14},
  65. #endif
  66. #ifdef APP_BT
  67. {.app = bt_task, .name = "bt_task", .stack_size = 1024, .icon = A_Plugins_14},
  68. #endif
  69. #ifdef APP_CC1101
  70. {.app = cc1101_workaround,
  71. .name = "cc1101 workaround",
  72. .stack_size = 1024,
  73. .icon = A_Plugins_14},
  74. #endif
  75. #ifdef APP_LF_RFID
  76. {.app = lf_rfid_workaround,
  77. .name = "lf rfid workaround",
  78. .stack_size = 1024,
  79. .icon = A_Plugins_14},
  80. #endif
  81. #ifdef APP_IRDA
  82. {.app = irda, .name = "irda", .stack_size = 1024, .icon = A_Plugins_14},
  83. #endif
  84. #ifdef APP_NFC
  85. {.app = nfc_task, .name = "nfc_task", .stack_size = 1024, .icon = A_Plugins_14},
  86. #endif
  87. #ifdef APP_TEST
  88. {.app = flipper_test_app, .name = "test app", .stack_size = 1024, .icon = A_Plugins_14},
  89. #endif
  90. #ifdef APP_EXAMPLE_QRCODE
  91. {.app = u8g2_qrcode, .name = "u8g2_qrcode", .stack_size = 1024, .icon = A_Plugins_14},
  92. #endif
  93. #ifdef APP_EXAMPLE_DISPLAY
  94. {.app = u8g2_example, .name = "u8g2_example", .stack_size = 1024, .icon = A_Plugins_14},
  95. #endif
  96. #ifdef APP_SPEAKER_DEMO
  97. {.app = coreglitch_demo_0,
  98. .name = "coreglitch_demo_0",
  99. .stack_size = 1024,
  100. .icon = A_Plugins_14},
  101. #endif
  102. #ifdef APP_SD_TEST
  103. {.app = sd_card_test, .name = "sd_card_test", .stack_size = 4096, .icon = A_Plugins_14},
  104. #endif
  105. #ifdef APP_MUSIC_PLAYER
  106. {.app = music_player, .name = "music player", .stack_size = 1024, .icon = A_Plugins_14},
  107. #endif
  108. #ifdef APP_IBUTTON
  109. {.app = app_ibutton, .name = "ibutton", .stack_size = 1024, .icon = A_Plugins_14},
  110. #endif
  111. #ifdef APP_GPIO_DEMO
  112. {.app = app_gpio_test, .name = "gpio test", .stack_size = 1024, .icon = A_Plugins_14},
  113. #endif
  114. #ifdef APP_FLOOPPER_BLOOPPER
  115. {.app = floopper_bloopper, .name = "Floopper Bloopper", .stack_size = 1024, .icon = A_Games_14},
  116. #endif
  117. #ifdef APP_SDNFC
  118. {.app = sdnfc, .name = "sdnfc", .stack_size = 1024, .icon = A_Plugins_14},
  119. #endif
  120. #ifdef APP_GUI_TEST
  121. {.app = gui_test, .name = "gui_test", .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 BUILD_CC1101
  128. {.app = cc1101_workaround, .name = "Sub-1 GHz", .stack_size = 1024, .icon = A_Sub1ghz_14},
  129. #endif
  130. #ifdef BUILD_LF_RFID
  131. {.app = lf_rfid_workaround, .name = "125 kHz RFID", .stack_size = 1024, .icon = A_125khz_14},
  132. #endif
  133. #ifdef BUILD_IRDA
  134. {.app = irda, .name = "Infrared", .stack_size = 1024, .icon = A_Infrared_14},
  135. #endif
  136. #ifdef BUILD_IBUTTON
  137. {.app = app_ibutton, .name = "iButton", .stack_size = 1024, .icon = A_iButton_14},
  138. #endif
  139. #ifdef BUILD_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 BUILD_EXAMPLE_BLINK
  147. {.app = application_blink, .name = "blink", .stack_size = 1024, .icon = A_Plugins_14},
  148. #endif
  149. #ifdef BUILD_EXAMPLE_INPUT_DUMP
  150. {.app = application_input_dump, .name = "input dump", .stack_size = 1024, .icon = A_Plugins_14},
  151. #endif
  152. #ifdef BUILD_SPEAKER_DEMO
  153. {.app = coreglitch_demo_0,
  154. .name = "coreglitch_demo_0",
  155. .stack_size = 1024,
  156. .icon = A_Plugins_14},
  157. #endif
  158. #ifdef BUILD_SD_TEST
  159. {.app = sd_card_test, .name = "sd_card_test", .stack_size = 4096, .icon = A_Plugins_14},
  160. #endif
  161. #ifdef BUILD_VIBRO_DEMO
  162. {.app = application_vibro,
  163. .name = "application_vibro",
  164. .stack_size = 1024,
  165. .icon = A_Plugins_14},
  166. #endif
  167. #ifdef BUILD_MUSIC_PLAYER
  168. {.app = music_player, .name = "music player", .stack_size = 1024, .icon = A_Plugins_14},
  169. #endif
  170. #ifdef BUILD_FLOOPPER_BLOOPPER
  171. {.app = floopper_bloopper, .name = "Floopper Bloopper", .stack_size = 1024, .icon = A_Games_14},
  172. #endif
  173. #ifdef BUILD_SDNFC
  174. {.app = sdnfc, .name = "sdnfc", .stack_size = 1024, .icon = A_Plugins_14},
  175. #endif
  176. #ifdef BUILD_GUI_TEST
  177. {.app = gui_test, .name = "gui_test", .icon = A_Plugins_14},
  178. #endif
  179. };
  180. const size_t FLIPPER_PLUGINS_COUNT = sizeof(FLIPPER_PLUGINS) / sizeof(FlipperApplication);