Просмотр исходного кода

[FL-2627] Flipper applications: SDK, build and debug system (#1387)

* Added support for running applications from SD card (FAPs - Flipper Application Packages)
* Added plugin_dist target for fbt to build FAPs
* All apps of type FlipperAppType.EXTERNAL and FlipperAppType.PLUGIN are built as FAPs by default
* Updated VSCode configuration for new fbt features - re-deploy stock configuration to use them
* Added debugging support for FAPs with fbt debug & VSCode
* Added public firmware API with automated versioning

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: SG <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
SG 3 лет назад
Родитель
Сommit
b9a766d909
100 измененных файлов с 440 добавлено и 444 удалено
  1. 128 23
      .clang-format
  2. 3 0
      .gitmodules
  3. 10 3
      .vscode/example/launch.json
  4. 3 0
      .vscode/example/settings.json
  5. 30 0
      .vscode/example/tasks.json
  6. 4 0
      ReadMe.md
  7. 26 2
      SConstruct
  8. 71 19
      applications/ReadMe.md
  9. 0 66
      applications/bt/application.fam
  10. 0 0
      applications/debug/accessor/accessor.cpp
  11. 0 0
      applications/debug/accessor/accessor_app.cpp
  12. 0 0
      applications/debug/accessor/accessor_app.h
  13. 0 0
      applications/debug/accessor/accessor_event.h
  14. 0 0
      applications/debug/accessor/accessor_view_manager.cpp
  15. 0 0
      applications/debug/accessor/accessor_view_manager.h
  16. 1 0
      applications/debug/accessor/application.fam
  17. 0 0
      applications/debug/accessor/helpers/wiegand.cpp
  18. 0 0
      applications/debug/accessor/helpers/wiegand.h
  19. 0 0
      applications/debug/accessor/scene/accessor_scene_generic.h
  20. 0 0
      applications/debug/accessor/scene/accessor_scene_start.cpp
  21. 0 0
      applications/debug/accessor/scene/accessor_scene_start.h
  22. 16 0
      applications/debug/application.fam
  23. 14 0
      applications/debug/battery_test_app/application.fam
  24. 5 5
      applications/debug/battery_test_app/battery_test_app.c
  25. 3 2
      applications/debug/battery_test_app/battery_test_app.h
  26. 11 0
      applications/debug/blink_test/application.fam
  27. 0 0
      applications/debug/blink_test/blink_test.c
  28. 18 0
      applications/debug/bt_debug_app/application.fam
  29. 0 0
      applications/debug/bt_debug_app/bt_debug_app.c
  30. 1 1
      applications/debug/bt_debug_app/bt_debug_app.h
  31. 0 0
      applications/debug/bt_debug_app/views/bt_carrier_test.c
  32. 0 0
      applications/debug/bt_debug_app/views/bt_carrier_test.h
  33. 0 0
      applications/debug/bt_debug_app/views/bt_packet_test.c
  34. 0 0
      applications/debug/bt_debug_app/views/bt_packet_test.h
  35. 0 0
      applications/debug/bt_debug_app/views/bt_test.c
  36. 0 0
      applications/debug/bt_debug_app/views/bt_test.h
  37. 0 0
      applications/debug/bt_debug_app/views/bt_test_types.h
  38. 11 0
      applications/debug/display_test/application.fam
  39. 0 0
      applications/debug/display_test/display_test.c
  40. 0 0
      applications/debug/display_test/display_test.h
  41. 0 0
      applications/debug/display_test/view_display_test.c
  42. 0 0
      applications/debug/display_test/view_display_test.h
  43. 11 0
      applications/debug/file_browser_test/application.fam
  44. 0 0
      applications/debug/file_browser_test/file_browser_app.c
  45. 0 0
      applications/debug/file_browser_test/file_browser_app_i.h
  46. 0 0
      applications/debug/file_browser_test/scenes/file_browser_scene.c
  47. 0 0
      applications/debug/file_browser_test/scenes/file_browser_scene.h
  48. 0 0
      applications/debug/file_browser_test/scenes/file_browser_scene_browser.c
  49. 0 0
      applications/debug/file_browser_test/scenes/file_browser_scene_config.h
  50. 0 0
      applications/debug/file_browser_test/scenes/file_browser_scene_result.c
  51. 0 0
      applications/debug/file_browser_test/scenes/file_browser_scene_start.c
  52. 11 0
      applications/debug/keypad_test/application.fam
  53. 0 0
      applications/debug/keypad_test/keypad_test.c
  54. 4 1
      applications/debug/lfrfid_debug/application.fam
  55. 0 0
      applications/debug/lfrfid_debug/lfrfid_debug.c
  56. 2 3
      applications/debug/lfrfid_debug/lfrfid_debug_i.h
  57. 0 0
      applications/debug/lfrfid_debug/scenes/lfrfid_debug_app_scene_start.c
  58. 0 0
      applications/debug/lfrfid_debug/scenes/lfrfid_debug_app_scene_tune.c
  59. 0 0
      applications/debug/lfrfid_debug/scenes/lfrfid_debug_scene.c
  60. 0 0
      applications/debug/lfrfid_debug/scenes/lfrfid_debug_scene.h
  61. 0 0
      applications/debug/lfrfid_debug/scenes/lfrfid_debug_scene_config.h
  62. 0 0
      applications/debug/lfrfid_debug/views/lfrfid_debug_view_tune.c
  63. 0 0
      applications/debug/lfrfid_debug/views/lfrfid_debug_view_tune.h
  64. 11 0
      applications/debug/text_box_test/application.fam
  65. 0 0
      applications/debug/text_box_test/text_box_test.c
  66. 11 0
      applications/debug/uart_echo/application.fam
  67. 0 0
      applications/debug/uart_echo/uart_echo.c
  68. 1 1
      applications/debug/unit_tests/application.fam
  69. 0 0
      applications/debug/unit_tests/flipper_format/flipper_format_string_test.c
  70. 0 0
      applications/debug/unit_tests/flipper_format/flipper_format_test.c
  71. 0 0
      applications/debug/unit_tests/furi/furi_memmgr_test.c
  72. 0 0
      applications/debug/unit_tests/furi/furi_pubsub_test.c
  73. 0 0
      applications/debug/unit_tests/furi/furi_record_test.c
  74. 0 0
      applications/debug/unit_tests/furi/furi_test.c
  75. 0 0
      applications/debug/unit_tests/furi/furi_valuemutex_test.c
  76. 0 0
      applications/debug/unit_tests/infrared/infrared_test.c
  77. 0 0
      applications/debug/unit_tests/lfrfid/bit_lib_test.c
  78. 0 0
      applications/debug/unit_tests/lfrfid/lfrfid_protocols.c
  79. 0 0
      applications/debug/unit_tests/minunit.h
  80. 0 0
      applications/debug/unit_tests/minunit_vars.h
  81. 0 0
      applications/debug/unit_tests/minunit_vars_ex.h
  82. 1 1
      applications/debug/unit_tests/nfc/nfc_test.c
  83. 0 0
      applications/debug/unit_tests/protocol_dict/protocol_dict_test.c
  84. 0 0
      applications/debug/unit_tests/rpc/rpc_test.c
  85. 0 0
      applications/debug/unit_tests/storage/dirwalk_test.c
  86. 0 0
      applications/debug/unit_tests/storage/storage_test.c
  87. 0 0
      applications/debug/unit_tests/stream/stream_test.c
  88. 0 0
      applications/debug/unit_tests/subghz/subghz_test.c
  89. 0 0
      applications/debug/unit_tests/test_index.c
  90. 0 0
      applications/debug/unit_tests/varint/varint_test.c
  91. 11 0
      applications/debug/usb_mouse/application.fam
  92. 0 0
      applications/debug/usb_mouse/usb_mouse.c
  93. 11 0
      applications/debug/usb_test/application.fam
  94. 0 0
      applications/debug/usb_test/usb_test.c
  95. 11 0
      applications/debug/vibro_test/application.fam
  96. 0 0
      applications/debug/vibro_test/vibro_test.c
  97. 0 115
      applications/debug_tools/application.fam
  98. 0 58
      applications/extapps.scons
  99. 0 13
      applications/gui/application.fam
  100. 0 131
      applications/gui/modules/dialog.c

+ 128 - 23
.clang-format

@@ -1,86 +1,191 @@
+---
+Language:        Cpp
 AccessModifierOffset: -4
 AccessModifierOffset: -4
 AlignAfterOpenBracket: AlwaysBreak
 AlignAfterOpenBracket: AlwaysBreak
-AlignConsecutiveAssignments: false
-AlignConsecutiveDeclarations: false
+AlignArrayOfStructures: None
+AlignConsecutiveMacros: None
+AlignConsecutiveAssignments: None
+AlignConsecutiveBitFields: None
+AlignConsecutiveDeclarations: None
 AlignEscapedNewlines: Left
 AlignEscapedNewlines: Left
-AlignOperands: true
+AlignOperands:   Align
 AlignTrailingComments: false
 AlignTrailingComments: false
+AllowAllArgumentsOnNextLine: true
 AllowAllParametersOfDeclarationOnNextLine: false
 AllowAllParametersOfDeclarationOnNextLine: false
+AllowShortEnumsOnASingleLine: true
 AllowShortBlocksOnASingleLine: Never
 AllowShortBlocksOnASingleLine: Never
 AllowShortCaseLabelsOnASingleLine: false
 AllowShortCaseLabelsOnASingleLine: false
 AllowShortFunctionsOnASingleLine: None
 AllowShortFunctionsOnASingleLine: None
-AllowShortIfStatementsOnASingleLine: true
+AllowShortLambdasOnASingleLine: All
+AllowShortIfStatementsOnASingleLine: WithoutElse
 AllowShortLoopsOnASingleLine: true
 AllowShortLoopsOnASingleLine: true
 AlwaysBreakAfterDefinitionReturnType: None
 AlwaysBreakAfterDefinitionReturnType: None
 AlwaysBreakAfterReturnType: None
 AlwaysBreakAfterReturnType: None
 AlwaysBreakBeforeMultilineStrings: false
 AlwaysBreakBeforeMultilineStrings: false
-AlwaysBreakTemplateDeclarations: false
+AlwaysBreakTemplateDeclarations: Yes
+AttributeMacros:
+  - __capability
 BinPackArguments: false
 BinPackArguments: false
 BinPackParameters: false
 BinPackParameters: false
+BraceWrapping:
+  AfterCaseLabel:  false
+  AfterClass:      false
+  AfterControlStatement: Never
+  AfterEnum:       false
+  AfterFunction:   false
+  AfterNamespace:  false
+  AfterObjCDeclaration: false
+  AfterStruct:     false
+  AfterUnion:      false
+  AfterExternBlock: false
+  BeforeCatch:     false
+  BeforeElse:      false
+  BeforeLambdaBody: false
+  BeforeWhile:     false
+  IndentBraces:    false
+  SplitEmptyFunction: true
+  SplitEmptyRecord: true
+  SplitEmptyNamespace: true
 BreakBeforeBinaryOperators: None
 BreakBeforeBinaryOperators: None
+BreakBeforeConceptDeclarations: true
 BreakBeforeBraces: Attach
 BreakBeforeBraces: Attach
+BreakBeforeInheritanceComma: false
+BreakInheritanceList: BeforeColon
 BreakBeforeTernaryOperators: false
 BreakBeforeTernaryOperators: false
+BreakConstructorInitializersBeforeComma: false
 BreakConstructorInitializers: BeforeComma
 BreakConstructorInitializers: BeforeComma
+BreakAfterJavaFieldAnnotations: false
 BreakStringLiterals: false
 BreakStringLiterals: false
-ColumnLimit: 99
+ColumnLimit:     99
+CommentPragmas:  '^ IWYU pragma:'
+QualifierAlignment: Leave
 CompactNamespaces: false
 CompactNamespaces: false
-ConstructorInitializerAllOnOneLineOrOnePerLine: false
 ConstructorInitializerIndentWidth: 4
 ConstructorInitializerIndentWidth: 4
 ContinuationIndentWidth: 4
 ContinuationIndentWidth: 4
 Cpp11BracedListStyle: true
 Cpp11BracedListStyle: true
+DeriveLineEnding: true
 DerivePointerAlignment: false
 DerivePointerAlignment: false
-DisableFormat: false
+DisableFormat:   false
+EmptyLineAfterAccessModifier: Never
+EmptyLineBeforeAccessModifier: LogicalBlock
 ExperimentalAutoDetectBinPacking: false
 ExperimentalAutoDetectBinPacking: false
+PackConstructorInitializers: BinPack
+BasedOnStyle:    ''
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+AllowAllConstructorInitializersOnNextLine: true
 FixNamespaceComments: false
 FixNamespaceComments: false
-
-IncludeBlocks: Preserve
+ForEachMacros:
+  - foreach
+  - Q_FOREACH
+  - BOOST_FOREACH
+IfMacros:
+  - KJ_IF_MAYBE
+IncludeBlocks:   Preserve
 IncludeCategories:
 IncludeCategories:
-  - Regex: '.*'
-    Priority: 1
+  - Regex:           '.*'
+    Priority:        1
+    SortPriority:    0
+    CaseSensitive:   false
+  - Regex:           '^(<|"(gtest|gmock|isl|json)/)'
+    Priority:        3
+    SortPriority:    0
+    CaseSensitive:   false
+  - Regex:           '.*'
+    Priority:        1
+    SortPriority:    0
+    CaseSensitive:   false
 IncludeIsMainRegex: '(Test)?$'
 IncludeIsMainRegex: '(Test)?$'
+IncludeIsMainSourceRegex: ''
+IndentAccessModifiers: false
 IndentCaseLabels: false
 IndentCaseLabels: false
+IndentCaseBlocks: false
+IndentGotoLabels: true
 IndentPPDirectives: None
 IndentPPDirectives: None
-IndentWidth: 4
+IndentExternBlock: AfterExternBlock
+IndentRequires:  false
+IndentWidth:     4
 IndentWrappedFunctionNames: true
 IndentWrappedFunctionNames: true
+InsertTrailingCommas: None
 JavaScriptQuotes: Leave
 JavaScriptQuotes: Leave
 JavaScriptWrapImports: true
 JavaScriptWrapImports: true
 KeepEmptyLinesAtTheStartOfBlocks: false
 KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: Signature
 MacroBlockBegin: ''
 MacroBlockBegin: ''
-MacroBlockEnd: ''
+MacroBlockEnd:   ''
 MaxEmptyLinesToKeep: 1
 MaxEmptyLinesToKeep: 1
 NamespaceIndentation: None
 NamespaceIndentation: None
 ObjCBinPackProtocolList: Auto
 ObjCBinPackProtocolList: Auto
 ObjCBlockIndentWidth: 4
 ObjCBlockIndentWidth: 4
+ObjCBreakBeforeNestedBlockParam: true
 ObjCSpaceAfterProperty: true
 ObjCSpaceAfterProperty: true
 ObjCSpaceBeforeProtocolList: true
 ObjCSpaceBeforeProtocolList: true
-
-# Taken from git's rules
 PenaltyBreakAssignment: 10
 PenaltyBreakAssignment: 10
 PenaltyBreakBeforeFirstCallParameter: 30
 PenaltyBreakBeforeFirstCallParameter: 30
 PenaltyBreakComment: 10
 PenaltyBreakComment: 10
 PenaltyBreakFirstLessLess: 0
 PenaltyBreakFirstLessLess: 0
+PenaltyBreakOpenParenthesis: 0
 PenaltyBreakString: 10
 PenaltyBreakString: 10
+PenaltyBreakTemplateDeclaration: 10
 PenaltyExcessCharacter: 100
 PenaltyExcessCharacter: 100
 PenaltyReturnTypeOnItsOwnLine: 60
 PenaltyReturnTypeOnItsOwnLine: 60
-
+PenaltyIndentedWhitespace: 0
 PointerAlignment: Left
 PointerAlignment: Left
-ReflowComments: false
-SortIncludes: false
+PPIndentWidth:   -1
+ReferenceAlignment: Pointer
+ReflowComments:  false
+RemoveBracesLLVM: false
+SeparateDefinitionBlocks: Leave
+ShortNamespaceLines: 1
+SortIncludes:    Never
+SortJavaStaticImport: Before
 SortUsingDeclarations: false
 SortUsingDeclarations: false
 SpaceAfterCStyleCast: false
 SpaceAfterCStyleCast: false
+SpaceAfterLogicalNot: false
 SpaceAfterTemplateKeyword: true
 SpaceAfterTemplateKeyword: true
 SpaceBeforeAssignmentOperators: true
 SpaceBeforeAssignmentOperators: true
+SpaceBeforeCaseColon: false
+SpaceBeforeCpp11BracedList: false
 SpaceBeforeCtorInitializerColon: true
 SpaceBeforeCtorInitializerColon: true
 SpaceBeforeInheritanceColon: true
 SpaceBeforeInheritanceColon: true
 SpaceBeforeParens: Never
 SpaceBeforeParens: Never
+SpaceBeforeParensOptions:
+  AfterControlStatements: false
+  AfterForeachMacros: false
+  AfterFunctionDefinitionName: false
+  AfterFunctionDeclarationName: false
+  AfterIfMacros:   false
+  AfterOverloadedOperator: false
+  BeforeNonEmptyParentheses: false
+SpaceAroundPointerQualifiers: Default
 SpaceBeforeRangeBasedForLoopColon: true
 SpaceBeforeRangeBasedForLoopColon: true
+SpaceInEmptyBlock: false
 SpaceInEmptyParentheses: false
 SpaceInEmptyParentheses: false
 SpacesBeforeTrailingComments: 1
 SpacesBeforeTrailingComments: 1
-SpacesInAngles: false
+SpacesInAngles:  Never
+SpacesInConditionalStatement: false
 SpacesInContainerLiterals: false
 SpacesInContainerLiterals: false
 SpacesInCStyleCastParentheses: false
 SpacesInCStyleCastParentheses: false
+SpacesInLineCommentPrefix:
+  Minimum:         1
+  Maximum:         -1
 SpacesInParentheses: false
 SpacesInParentheses: false
 SpacesInSquareBrackets: false
 SpacesInSquareBrackets: false
-Standard: Cpp03
-TabWidth: 4
-UseTab: Never
+SpaceBeforeSquareBrackets: false
+BitFieldColonSpacing: Both
+Standard:        c++03
+StatementAttributeLikeMacros:
+  - Q_EMIT
+StatementMacros:
+  - Q_UNUSED
+  - QT_REQUIRE_VERSION
+TabWidth:        4
+UseCRLF:         false
+UseTab:          Never
+WhitespaceSensitiveMacros:
+  - STRINGIZE
+  - PP_STRINGIZE
+  - BOOST_PP_STRINGIZE
+  - NS_SWIFT_NAME
+  - CF_SWIFT_NAME
+...
+

+ 3 - 0
.gitmodules

@@ -28,3 +28,6 @@
 [submodule "lib/mbedtls"]
 [submodule "lib/mbedtls"]
 	path = lib/mbedtls
 	path = lib/mbedtls
 	url = https://github.com/Mbed-TLS/mbedtls.git
 	url = https://github.com/Mbed-TLS/mbedtls.git
+[submodule "lib/cxxheaderparser"]
+	path = lib/cxxheaderparser
+	url = https://github.com/robotpy/cxxheaderparser.git

+ 10 - 3
.vscode/example/launch.json

@@ -31,7 +31,10 @@
             ],
             ],
             "postAttachCommands": [
             "postAttachCommands": [
                 // "attach 1",
                 // "attach 1",
-                "compare-sections",
+                // "compare-sections",
+                "source debug/flipperapps.py",
+                // "source debug/FreeRTOS/FreeRTOS.py",
+                // "svd_load debug/STM32WB55_CM4.svd"
             ]
             ]
             // "showDevDebugOutput": "raw",
             // "showDevDebugOutput": "raw",
         },
         },
@@ -50,7 +53,8 @@
                 "attach 1",
                 "attach 1",
                 "set confirm off",
                 "set confirm off",
                 "set mem inaccessible-by-default off",
                 "set mem inaccessible-by-default off",
-                "compare-sections",
+                "source debug/flipperapps.py",
+                // "compare-sections",
             ]
             ]
             // "showDevDebugOutput": "raw",
             // "showDevDebugOutput": "raw",
         },
         },
@@ -65,6 +69,9 @@
             "device": "STM32WB55RG",
             "device": "STM32WB55RG",
             "svdFile": "./debug/STM32WB55_CM4.svd",
             "svdFile": "./debug/STM32WB55_CM4.svd",
             "rtos": "FreeRTOS",
             "rtos": "FreeRTOS",
+            "postAttachCommands": [
+                "source debug/flipperapps.py",
+            ]
             // "showDevDebugOutput": "raw",
             // "showDevDebugOutput": "raw",
         },
         },
         {
         {
@@ -73,7 +80,7 @@
             "request": "launch",
             "request": "launch",
             "program": "./lib/scons/scripts/scons.py",
             "program": "./lib/scons/scripts/scons.py",
             "args": [
             "args": [
-                "sdk"
+                "plugin_dist"
             ]
             ]
         },
         },
         {
         {

+ 3 - 0
.vscode/example/settings.json

@@ -12,6 +12,9 @@
     "cortex-debug.openocdPath.windows": "${workspaceFolder}/toolchain/i686-windows/openocd/bin/openocd.exe",
     "cortex-debug.openocdPath.windows": "${workspaceFolder}/toolchain/i686-windows/openocd/bin/openocd.exe",
     "cortex-debug.openocdPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/openocd/bin/openocd",
     "cortex-debug.openocdPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/openocd/bin/openocd",
     "cortex-debug.openocdPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/openocd/bin/openocd",
     "cortex-debug.openocdPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/openocd/bin/openocd",
+    "cortex-debug.gdbPath.windows": "${workspaceFolder}/toolchain/i686-windows/bin/arm-none-eabi-gdb-py.bat",
+    "cortex-debug.gdbPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/bin/arm-none-eabi-gdb-py",
+    "cortex-debug.gdbPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/bin/arm-none-eabi-gdb",
     "editor.formatOnSave": true,
     "editor.formatOnSave": true,
     "files.associations": {
     "files.associations": {
         "*.scons": "python",
         "*.scons": "python",

+ 30 - 0
.vscode/example/tasks.json

@@ -93,11 +93,41 @@
             "type": "shell",
             "type": "shell",
             "command": "./fbt FIRMWARE_APP_SET=unit_tests FORCE=1 flash_usb"
             "command": "./fbt FIRMWARE_APP_SET=unit_tests FORCE=1 flash_usb"
         },
         },
+        {
+            "label": "[Debug] Flash (USB, with resources)",
+            "group": "build",
+            "type": "shell",
+            "command": "./fbt FORCE=1 flash_usb_full"
+        },
         {
         {
             "label": "[Release] Flash (USB, with resources)",
             "label": "[Release] Flash (USB, with resources)",
             "group": "build",
             "group": "build",
             "type": "shell",
             "type": "shell",
             "command": "./fbt COMPACT=1 DEBUG=0 FORCE=1 flash_usb_full"
             "command": "./fbt COMPACT=1 DEBUG=0 FORCE=1 flash_usb_full"
         },
         },
+        {
+            "label": "[Debug] Build FAPs",
+            "group": "build",
+            "type": "shell",
+            "command": "./fbt plugin_dist"
+        },
+        {
+            "label": "[Release] Build FAPs",
+            "group": "build",
+            "type": "shell",
+            "command": "./fbt COMPACT=1 DEBUG=0 plugin_dist"
+        },
+        {
+            "label": "[Debug] Launch App on Flipper",
+            "group": "build",
+            "type": "shell",
+            "command": "./fbt launch_app APPSRC=${relativeFileDirname}"
+        },
+        {
+            "label": "[Release] Launch App on Flipper",
+            "group": "build",
+            "type": "shell",
+            "command": "./fbt COMPACT=1 DEBUG=0 launch_app APPSRC=${relativeFileDirname}"
+        }
     ]
     ]
 }
 }

+ 4 - 0
ReadMe.md

@@ -14,6 +14,10 @@ You should clone with
 $ git clone --recursive https://github.com/flipperdevices/flipperzero-firmware.git
 $ git clone --recursive https://github.com/flipperdevices/flipperzero-firmware.git
 ```
 ```
 
 
+# Read the Docs
+
+Check out details on [how to build firmware](documentation/fbt.md), [write applications](documentation/AppsOnSDCard.md), [un-brick your device](documentation/KeyCombo.md) and more in `documentation` folder. 
+
 # Update firmware
 # Update firmware
 
 
 [Get Latest Firmware from Update Server](https://update.flipperzero.one/)
 [Get Latest Firmware from Update Server](https://update.flipperzero.one/)

+ 26 - 2
SConstruct

@@ -9,9 +9,10 @@
 import os
 import os
 import subprocess
 import subprocess
 
 
+DefaultEnvironment(tools=[])
+
 EnsurePythonVersion(3, 8)
 EnsurePythonVersion(3, 8)
 
 
-DefaultEnvironment(tools=[])
 # Progress(["OwO\r", "owo\r", "uwu\r", "owo\r"], interval=15)
 # Progress(["OwO\r", "owo\r", "uwu\r", "owo\r"], interval=15)
 
 
 
 
@@ -58,6 +59,8 @@ distenv = coreenv.Clone(
         "-ex",
         "-ex",
         "source debug/FreeRTOS/FreeRTOS.py",
         "source debug/FreeRTOS/FreeRTOS.py",
         "-ex",
         "-ex",
+        "source debug/flipperapps.py",
+        "-ex",
         "source debug/PyCortexMDebug/PyCortexMDebug.py",
         "source debug/PyCortexMDebug/PyCortexMDebug.py",
         "-ex",
         "-ex",
         "svd_load ${SVD_FILE}",
         "svd_load ${SVD_FILE}",
@@ -160,6 +163,28 @@ if GetOption("fullenv") or any(
 basic_dist = distenv.DistCommand("fw_dist", distenv["DIST_DEPENDS"])
 basic_dist = distenv.DistCommand("fw_dist", distenv["DIST_DEPENDS"])
 distenv.Default(basic_dist)
 distenv.Default(basic_dist)
 
 
+dist_dir = distenv.GetProjetDirName()
+plugin_dist = [
+    distenv.Install(
+        f"#/dist/{dist_dir}/apps/debug_elf",
+        firmware_env["FW_EXTAPPS"]["debug"].values(),
+    ),
+    *(
+        distenv.Install(f"#/dist/{dist_dir}/apps/{dist_entry[0]}", dist_entry[1])
+        for dist_entry in firmware_env["FW_EXTAPPS"]["dist"].values()
+    ),
+]
+Depends(plugin_dist, firmware_env["FW_EXTAPPS"]["validators"].values())
+Alias("plugin_dist", plugin_dist)
+# distenv.Default(plugin_dist)
+
+plugin_resources_dist = list(
+    distenv.Install(f"#/assets/resources/apps/{dist_entry[0]}", dist_entry[1])
+    for dist_entry in firmware_env["FW_EXTAPPS"]["dist"].values()
+)
+distenv.Depends(firmware_env["FW_RESOURCES"], plugin_resources_dist)
+
+
 # Target for bundling core2 package for qFlipper
 # Target for bundling core2 package for qFlipper
 copro_dist = distenv.CoproBuilder(
 copro_dist = distenv.CoproBuilder(
     distenv.Dir("assets/core2_firmware"),
     distenv.Dir("assets/core2_firmware"),
@@ -240,7 +265,6 @@ firmware_env.Append(
         "site_scons",
         "site_scons",
         "scripts",
         "scripts",
         # Extra files
         # Extra files
-        "applications/extapps.scons",
         "SConstruct",
         "SConstruct",
         "firmware.scons",
         "firmware.scons",
         "fbt_options.py",
         "fbt_options.py",

+ 71 - 19
applications/ReadMe.md

@@ -1,38 +1,90 @@
 # Structure
 # Structure
 
 
-- `about`               - Small About application that shows flipper info
-- `accessor`            - Wiegand server
+- `application.h`       - Firmware application list header
+
+
+## debug 
+
+Applications for factory testing the Flipper.
+
+- `accessor`            - Wiegand server 
+- `battery_test_app`    - Battery debug app
+- `blink_test`          - LED blinker   
+- `bt_debug_app`        - BT test app. Requires full BT stack installed
+- `display_test`        - Various display tests & tweaks
+- `file_browser_test`   - Test UI for file picker
+- `keypad_test`         - Keypad test
+- `lfrfid_debug`        - LF RFID debug tool
+- `text_box_test`       - UI tests
+- `uart_echo`           - UART mode test 
+- `unit_tests`          - Unit tests
+- `usb_mouse`           - USB HID test
+- `usb_test`            - Other USB tests
+- `vibro_test`          - Vibro test
+
+
+## main
+
+Applications for main Flipper menu.
+
 - `archive`             - Archive and file manager 
 - `archive`             - Archive and file manager 
 - `bad_usb`             - Bad USB application
 - `bad_usb`             - Bad USB application
+- `fap_loader`          - External applications loader
+- `gpio`                - GPIO application: includes USART bridge and GPIO control
+- `ibutton`             - iButton application, onewire keys and more
+- `infrared`            - Infrared application, controls your IR devices
+- `lfrfid`              - LF RFID application
+- `nfc`                 - NFC application, HF rfid, EMV and etc
+- `subghz`              - SubGhz application, 433 fobs and etc
+- `u2f`                 - U2F Application
+
+
+## plugins
+
+Extra apps for Plugins & App Loader menus.
+
+- `bt_hid_app`          - BT Remote controller
+- `music_player`        - Music player app (demo)
+- `picopass`            - Picopass tool
+- `snake_game`          - Snake game application
+
+
+## services
+
+Background services providing system APIs to applications.
+
 - `bt`                  - BLE service and application
 - `bt`                  - BLE service and application
 - `cli`                 - Console service and API
 - `cli`                 - Console service and API
 - `crypto`              - Crypto cli tools
 - `crypto`              - Crypto cli tools
-- `debug_tools`         - Different tools that we use for debug
 - `desktop`             - Desktop service
 - `desktop`             - Desktop service
 - `dialogs`             - Dialogs service: GUI Dialogs for your app
 - `dialogs`             - Dialogs service: GUI Dialogs for your app
 - `dolphin`             - Dolphin service and supplementary apps
 - `dolphin`             - Dolphin service and supplementary apps
-- `gpio`                - GPIO application: includes USART bridge and GPIO control
 - `gui`                 - GUI service and API
 - `gui`                 - GUI service and API
-- `ibutton`             - iButton application, onewire keys and more
 - `input`               - Input service
 - `input`               - Input service
-- `infrared`            - Infrared application, controls your IR devices
-- `lfrfid`              - LF RFID application
-- `lfrfid_debug`        - LF RFID debug tool
 - `loader`              - Application loader service
 - `loader`              - Application loader service
-- `music_player`        - Music player app (demo)
-- `nfc`                 - NFC application, HF rfid, EMV and etc
 - `notification`        - Notification service 
 - `notification`        - Notification service 
 - `power`               - Power service
 - `power`               - Power service
-- `power_observer`      - Power debug tool
 - `rpc`                 - RPC service and API
 - `rpc`                 - RPC service and API
-- `scened_app_example`  - C++ application example
-- `snake_game`          - Snake game application
 - `storage`             - Storage service, internal + sdcard
 - `storage`             - Storage service, internal + sdcard
+
+
+## settings
+
+Small applications providing configuration for basic firmware and its services.
+
+- `about`               - Small About application that shows flipper info
+- `bt_settings_app`     - Bluetooth options
+- `desktop_settings`    - Desktop configuration
+- `dolphin_passport`    - Dolphin passport app
+- `notification_settings` - LCD brightness, sound volume, etc configuration
+- `power_settings_app`  - Basic power options
 - `storage_settings`    - Storage settings app
 - `storage_settings`    - Storage settings app
-- `subghz`              - SubGhz application, 433 fobs and etc
-- `system`              - System settings, tools and API
-- `tests`               - Unit tests and etc
-- `u2f`                 - U2F Application
-- `updater`             - Update service & application
+- `system`              - System settings
 
 
-- `application.h`       - Firmware application list header
+
+## system
+
+Utility apps not visible in other menus.
+
+- `storage_move_to_sd`  - Data migration tool for internal storage
+- `updater`             - Update service & application

+ 0 - 66
applications/bt/application.fam

@@ -1,66 +0,0 @@
-App(
-    appid="bt",
-    name="BtSrv",
-    apptype=FlipperAppType.SERVICE,
-    entry_point="bt_srv",
-    cdefines=["SRV_BT"],
-    requires=[
-        "cli",
-        "dialogs",
-    ],
-    provides=[
-        "bt_start",
-        "bt_settings",
-        "bt_debug",
-    ],
-    stack_size=1 * 1024,
-    order=20,
-)
-
-App(
-    appid="bt_start",
-    apptype=FlipperAppType.STARTUP,
-    entry_point="bt_on_system_start",
-    order=70,
-)
-
-App(
-    appid="bt_settings",
-    name="Bluetooth",
-    apptype=FlipperAppType.SETTINGS,
-    entry_point="bt_settings_app",
-    stack_size=1 * 1024,
-    requires=[
-        "bt",
-        "gui",
-    ],
-    order=10,
-)
-
-App(
-    appid="bt_debug",
-    name="Bluetooth Debug",
-    apptype=FlipperAppType.DEBUG,
-    entry_point="bt_debug_app",
-    stack_size=1 * 1024,
-    requires=[
-        "bt",
-        "gui",
-        "dialogs",
-    ],
-    order=110,
-)
-
-App(
-    appid="bt_hid",
-    name="Bluetooth Remote",
-    apptype=FlipperAppType.PLUGIN,
-    entry_point="bt_hid_app",
-    stack_size=1 * 1024,
-    cdefines=["APP_BLE_HID"],
-    requires=[
-        "bt",
-        "gui",
-    ],
-    order=10,
-)

+ 0 - 0
applications/accessor/accessor.cpp → applications/debug/accessor/accessor.cpp


+ 0 - 0
applications/accessor/accessor_app.cpp → applications/debug/accessor/accessor_app.cpp


+ 0 - 0
applications/accessor/accessor_app.h → applications/debug/accessor/accessor_app.h


+ 0 - 0
applications/accessor/accessor_event.h → applications/debug/accessor/accessor_event.h


+ 0 - 0
applications/accessor/accessor_view_manager.cpp → applications/debug/accessor/accessor_view_manager.cpp


+ 0 - 0
applications/accessor/accessor_view_manager.h → applications/debug/accessor/accessor_view_manager.h


+ 1 - 0
applications/accessor/application.fam → applications/debug/accessor/application.fam

@@ -7,4 +7,5 @@ App(
     requires=["gui"],
     requires=["gui"],
     stack_size=4 * 1024,
     stack_size=4 * 1024,
     order=40,
     order=40,
+    fap_category="Debug",
 )
 )

+ 0 - 0
applications/accessor/helpers/wiegand.cpp → applications/debug/accessor/helpers/wiegand.cpp


+ 0 - 0
applications/accessor/helpers/wiegand.h → applications/debug/accessor/helpers/wiegand.h


+ 0 - 0
applications/accessor/scene/accessor_scene_generic.h → applications/debug/accessor/scene/accessor_scene_generic.h


+ 0 - 0
applications/accessor/scene/accessor_scene_start.cpp → applications/debug/accessor/scene/accessor_scene_start.cpp


+ 0 - 0
applications/accessor/scene/accessor_scene_start.h → applications/debug/accessor/scene/accessor_scene_start.h


+ 16 - 0
applications/debug/application.fam

@@ -0,0 +1,16 @@
+App(
+    appid="debug_apps",
+    name="Basic debug apps bundle",
+    apptype=FlipperAppType.METAPACKAGE,
+    provides=[
+        "blink_test",
+        "vibro_test",
+        "keypad_test",
+        "usb_test",
+        "usb_mouse",
+        "uart_echo",
+        "display_test",
+        "text_box_test",
+        "file_browser_test",
+    ],
+)

+ 14 - 0
applications/debug/battery_test_app/application.fam

@@ -0,0 +1,14 @@
+App(
+    appid="battery_test",
+    name="Battery Test",
+    apptype=FlipperAppType.DEBUG,
+    entry_point="battery_test_app",
+    cdefines=["APP_BATTERY_TEST"],
+    requires=[
+        "gui",
+        "power",
+    ],
+    stack_size=1 * 1024,
+    order=130,
+    fap_category="Debug",
+)

+ 5 - 5
applications/power/battery_test_app/battery_test_app.c → applications/debug/battery_test_app/battery_test_app.c

@@ -27,7 +27,7 @@ static void battery_test_battery_info_update_model(void* context) {
         .charge = app->info.charge,
         .charge = app->info.charge,
         .health = app->info.health,
         .health = app->info.health,
     };
     };
-    battery_info_set_data(app->batery_info, &battery_info_data);
+    battery_info_set_data(app->battery_info, &battery_info_data);
     notification_message(app->notifications, &sequence_display_backlight_on);
     notification_message(app->notifications, &sequence_display_backlight_on);
 }
 }
 
 
@@ -48,13 +48,13 @@ BatteryTestApp* battery_test_alloc() {
     view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
     view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
 
 
     // Views
     // Views
-    app->batery_info = battery_info_alloc();
+    app->battery_info = battery_info_alloc();
     view_set_previous_callback(
     view_set_previous_callback(
-        battery_info_get_view(app->batery_info), battery_test_exit_confirm_view);
+        battery_info_get_view(app->battery_info), battery_test_exit_confirm_view);
     view_dispatcher_add_view(
     view_dispatcher_add_view(
         app->view_dispatcher,
         app->view_dispatcher,
         BatteryTestAppViewBatteryInfo,
         BatteryTestAppViewBatteryInfo,
-        battery_info_get_view(app->batery_info));
+        battery_info_get_view(app->battery_info));
 
 
     app->dialog = dialog_ex_alloc();
     app->dialog = dialog_ex_alloc();
     dialog_ex_set_header(app->dialog, "Close Battery Test?", 64, 12, AlignCenter, AlignTop);
     dialog_ex_set_header(app->dialog, "Close Battery Test?", 64, 12, AlignCenter, AlignTop);
@@ -76,7 +76,7 @@ void battery_test_free(BatteryTestApp* app) {
 
 
     // Views
     // Views
     view_dispatcher_remove_view(app->view_dispatcher, BatteryTestAppViewBatteryInfo);
     view_dispatcher_remove_view(app->view_dispatcher, BatteryTestAppViewBatteryInfo);
-    battery_info_free(app->batery_info);
+    battery_info_free(app->battery_info);
     view_dispatcher_remove_view(app->view_dispatcher, BatteryTestAppViewExitDialog);
     view_dispatcher_remove_view(app->view_dispatcher, BatteryTestAppViewExitDialog);
     dialog_ex_free(app->dialog);
     dialog_ex_free(app->dialog);
     // View dispatcher
     // View dispatcher

+ 3 - 2
applications/power/battery_test_app/battery_test_app.h → applications/debug/battery_test_app/battery_test_app.h

@@ -6,14 +6,15 @@
 #include <notification/notification.h>
 #include <notification/notification.h>
 
 
 #include <gui/modules/dialog_ex.h>
 #include <gui/modules/dialog_ex.h>
-#include <power/power_settings_app/views/battery_info.h>
+// FIXME
+#include "../settings/power_settings_app/views/battery_info.h"
 
 
 typedef struct {
 typedef struct {
     Power* power;
     Power* power;
     Gui* gui;
     Gui* gui;
     NotificationApp* notifications;
     NotificationApp* notifications;
     ViewDispatcher* view_dispatcher;
     ViewDispatcher* view_dispatcher;
-    BatteryInfo* batery_info;
+    BatteryInfo* battery_info;
     DialogEx* dialog;
     DialogEx* dialog;
     PowerInfo info;
     PowerInfo info;
 } BatteryTestApp;
 } BatteryTestApp;

+ 11 - 0
applications/debug/blink_test/application.fam

@@ -0,0 +1,11 @@
+App(
+    appid="blink_test",
+    name="Blink Test",
+    apptype=FlipperAppType.DEBUG,
+    entry_point="blink_test_app",
+    cdefines=["APP_BLINK"],
+    requires=["gui"],
+    stack_size=1 * 1024,
+    order=10,
+    fap_category="Debug",
+)

+ 0 - 0
applications/debug_tools/blink_test.c → applications/debug/blink_test/blink_test.c


+ 18 - 0
applications/debug/bt_debug_app/application.fam

@@ -0,0 +1,18 @@
+App(
+    appid="bt_debug",
+    name="Bluetooth Debug",
+    apptype=FlipperAppType.DEBUG,
+    entry_point="bt_debug_app",
+    cdefines=["SRV_BT"],
+    requires=[
+        "bt",
+        "gui",
+        "dialogs",
+    ],
+    provides=[
+        "bt_debug",
+    ],
+    stack_size=1 * 1024,
+    order=110,
+    fap_category="Debug",
+)

+ 0 - 0
applications/bt/bt_debug_app/bt_debug_app.c → applications/debug/bt_debug_app/bt_debug_app.c


+ 1 - 1
applications/bt/bt_debug_app/bt_debug_app.h → applications/debug/bt_debug_app/bt_debug_app.h

@@ -9,7 +9,7 @@
 #include <gui/modules/submenu.h>
 #include <gui/modules/submenu.h>
 #include "views/bt_carrier_test.h"
 #include "views/bt_carrier_test.h"
 #include "views/bt_packet_test.h"
 #include "views/bt_packet_test.h"
-#include "../bt_settings.h"
+#include <bt/bt_settings.h>
 
 
 typedef struct {
 typedef struct {
     BtSettings settings;
     BtSettings settings;

+ 0 - 0
applications/bt/bt_debug_app/views/bt_carrier_test.c → applications/debug/bt_debug_app/views/bt_carrier_test.c


+ 0 - 0
applications/bt/bt_debug_app/views/bt_carrier_test.h → applications/debug/bt_debug_app/views/bt_carrier_test.h


+ 0 - 0
applications/bt/bt_debug_app/views/bt_packet_test.c → applications/debug/bt_debug_app/views/bt_packet_test.c


+ 0 - 0
applications/bt/bt_debug_app/views/bt_packet_test.h → applications/debug/bt_debug_app/views/bt_packet_test.h


+ 0 - 0
applications/bt/bt_debug_app/views/bt_test.c → applications/debug/bt_debug_app/views/bt_test.c


+ 0 - 0
applications/bt/bt_debug_app/views/bt_test.h → applications/debug/bt_debug_app/views/bt_test.h


+ 0 - 0
applications/bt/bt_debug_app/views/bt_test_types.h → applications/debug/bt_debug_app/views/bt_test_types.h


+ 11 - 0
applications/debug/display_test/application.fam

@@ -0,0 +1,11 @@
+App(
+    appid="display_test",
+    name="Display Test",
+    apptype=FlipperAppType.DEBUG,
+    entry_point="display_test_app",
+    cdefines=["APP_DISPLAY_TEST"],
+    requires=["gui"],
+    stack_size=1 * 1024,
+    order=120,
+    fap_category="Debug",
+)

+ 0 - 0
applications/debug_tools/display_test/display_test.c → applications/debug/display_test/display_test.c


+ 0 - 0
applications/debug_tools/display_test/display_test.h → applications/debug/display_test/display_test.h


+ 0 - 0
applications/debug_tools/display_test/view_display_test.c → applications/debug/display_test/view_display_test.c


+ 0 - 0
applications/debug_tools/display_test/view_display_test.h → applications/debug/display_test/view_display_test.h


+ 11 - 0
applications/debug/file_browser_test/application.fam

@@ -0,0 +1,11 @@
+App(
+    appid="file_browser_test",
+    name="File Browser Test",
+    apptype=FlipperAppType.DEBUG,
+    entry_point="file_browser_app",
+    cdefines=["APP_FILE_BROWSER_TEST"],
+    requires=["gui"],
+    stack_size=2 * 1024,
+    order=150,
+    fap_category="Debug",
+)

+ 0 - 0
applications/debug_tools/file_browser_test/file_browser_app.c → applications/debug/file_browser_test/file_browser_app.c


+ 0 - 0
applications/debug_tools/file_browser_test/file_browser_app_i.h → applications/debug/file_browser_test/file_browser_app_i.h


+ 0 - 0
applications/debug_tools/file_browser_test/scenes/file_browser_scene.c → applications/debug/file_browser_test/scenes/file_browser_scene.c


+ 0 - 0
applications/debug_tools/file_browser_test/scenes/file_browser_scene.h → applications/debug/file_browser_test/scenes/file_browser_scene.h


+ 0 - 0
applications/debug_tools/file_browser_test/scenes/file_browser_scene_browser.c → applications/debug/file_browser_test/scenes/file_browser_scene_browser.c


+ 0 - 0
applications/debug_tools/file_browser_test/scenes/file_browser_scene_config.h → applications/debug/file_browser_test/scenes/file_browser_scene_config.h


+ 0 - 0
applications/debug_tools/file_browser_test/scenes/file_browser_scene_result.c → applications/debug/file_browser_test/scenes/file_browser_scene_result.c


+ 0 - 0
applications/debug_tools/file_browser_test/scenes/file_browser_scene_start.c → applications/debug/file_browser_test/scenes/file_browser_scene_start.c


+ 11 - 0
applications/debug/keypad_test/application.fam

@@ -0,0 +1,11 @@
+App(
+    appid="keypad_test",
+    name="Keypad Test",
+    apptype=FlipperAppType.DEBUG,
+    entry_point="keypad_test_app",
+    cdefines=["APP_KEYPAD_TEST"],
+    requires=["gui"],
+    stack_size=1 * 1024,
+    order=30,
+    fap_category="Debug",
+)

+ 0 - 0
applications/debug_tools/keypad_test.c → applications/debug/keypad_test/keypad_test.c


+ 4 - 1
applications/lfrfid_debug/application.fam → applications/debug/lfrfid_debug/application.fam

@@ -5,8 +5,11 @@ App(
     entry_point="lfrfid_debug_app",
     entry_point="lfrfid_debug_app",
     requires=[
     requires=[
         "gui",
         "gui",
-        "lfrfid",
+    ],
+    provides=[
+        "lfrfid_debug",
     ],
     ],
     stack_size=1 * 1024,
     stack_size=1 * 1024,
     order=100,
     order=100,
+    fap_category="Debug",
 )
 )

+ 0 - 0
applications/lfrfid_debug/lfrfid_debug.c → applications/debug/lfrfid_debug/lfrfid_debug.c


+ 2 - 3
applications/lfrfid_debug/lfrfid_debug_i.h → applications/debug/lfrfid_debug/lfrfid_debug_i.h

@@ -9,9 +9,8 @@
 
 
 #include <gui/modules/submenu.h>
 #include <gui/modules/submenu.h>
 
 
-#include <lfrfid_debug/views/lfrfid_debug_view_tune.h>
-
-#include <lfrfid_debug/scenes/lfrfid_debug_scene.h>
+#include "views/lfrfid_debug_view_tune.h"
+#include "scenes/lfrfid_debug_scene.h"
 
 
 typedef struct LfRfidDebug LfRfidDebug;
 typedef struct LfRfidDebug LfRfidDebug;
 
 

+ 0 - 0
applications/lfrfid_debug/scenes/lfrfid_debug_app_scene_start.c → applications/debug/lfrfid_debug/scenes/lfrfid_debug_app_scene_start.c


+ 0 - 0
applications/lfrfid_debug/scenes/lfrfid_debug_app_scene_tune.c → applications/debug/lfrfid_debug/scenes/lfrfid_debug_app_scene_tune.c


+ 0 - 0
applications/lfrfid_debug/scenes/lfrfid_debug_scene.c → applications/debug/lfrfid_debug/scenes/lfrfid_debug_scene.c


+ 0 - 0
applications/lfrfid_debug/scenes/lfrfid_debug_scene.h → applications/debug/lfrfid_debug/scenes/lfrfid_debug_scene.h


+ 0 - 0
applications/lfrfid_debug/scenes/lfrfid_debug_scene_config.h → applications/debug/lfrfid_debug/scenes/lfrfid_debug_scene_config.h


+ 0 - 0
applications/lfrfid_debug/views/lfrfid_debug_view_tune.c → applications/debug/lfrfid_debug/views/lfrfid_debug_view_tune.c


+ 0 - 0
applications/lfrfid_debug/views/lfrfid_debug_view_tune.h → applications/debug/lfrfid_debug/views/lfrfid_debug_view_tune.h


+ 11 - 0
applications/debug/text_box_test/application.fam

@@ -0,0 +1,11 @@
+App(
+    appid="text_box_test",
+    name="Text Box Test",
+    apptype=FlipperAppType.DEBUG,
+    entry_point="text_box_test_app",
+    cdefines=["APP_TEXT_BOX_TEST"],
+    requires=["gui"],
+    stack_size=1 * 1024,
+    order=140,
+    fap_category="Debug",
+)

+ 0 - 0
applications/debug_tools/text_box_test.c → applications/debug/text_box_test/text_box_test.c


+ 11 - 0
applications/debug/uart_echo/application.fam

@@ -0,0 +1,11 @@
+App(
+    appid="uart_echo",
+    name="UART Echo",
+    apptype=FlipperAppType.DEBUG,
+    entry_point="uart_echo_app",
+    cdefines=["APP_UART_ECHO"],
+    requires=["gui"],
+    stack_size=2 * 1024,
+    order=70,
+    fap_category="Debug",
+)

+ 0 - 0
applications/debug_tools/uart_echo.c → applications/debug/uart_echo/uart_echo.c


+ 1 - 1
applications/unit_tests/application.fam → applications/debug/unit_tests/application.fam

@@ -10,7 +10,7 @@ App(
 App(
 App(
     appid="delay_test",
     appid="delay_test",
     name="Delay Test",
     name="Delay Test",
-    apptype=FlipperAppType.DEBUG,
+    apptype=FlipperAppType.SYSTEM,
     entry_point="delay_test_app",
     entry_point="delay_test_app",
     stack_size=1 * 1024,
     stack_size=1 * 1024,
     requires=["unit_tests"],
     requires=["unit_tests"],

+ 0 - 0
applications/unit_tests/flipper_format/flipper_format_string_test.c → applications/debug/unit_tests/flipper_format/flipper_format_string_test.c


+ 0 - 0
applications/unit_tests/flipper_format/flipper_format_test.c → applications/debug/unit_tests/flipper_format/flipper_format_test.c


+ 0 - 0
applications/unit_tests/furi/furi_memmgr_test.c → applications/debug/unit_tests/furi/furi_memmgr_test.c


+ 0 - 0
applications/unit_tests/furi/furi_pubsub_test.c → applications/debug/unit_tests/furi/furi_pubsub_test.c


+ 0 - 0
applications/unit_tests/furi/furi_record_test.c → applications/debug/unit_tests/furi/furi_record_test.c


+ 0 - 0
applications/unit_tests/furi/furi_test.c → applications/debug/unit_tests/furi/furi_test.c


+ 0 - 0
applications/unit_tests/furi/furi_valuemutex_test.c → applications/debug/unit_tests/furi/furi_valuemutex_test.c


+ 0 - 0
applications/unit_tests/infrared/infrared_test.c → applications/debug/unit_tests/infrared/infrared_test.c


+ 0 - 0
applications/unit_tests/lfrfid/bit_lib_test.c → applications/debug/unit_tests/lfrfid/bit_lib_test.c


+ 0 - 0
applications/unit_tests/lfrfid/lfrfid_protocols.c → applications/debug/unit_tests/lfrfid/lfrfid_protocols.c


+ 0 - 0
applications/unit_tests/minunit.h → applications/debug/unit_tests/minunit.h


+ 0 - 0
applications/unit_tests/minunit_vars.h → applications/debug/unit_tests/minunit_vars.h


+ 0 - 0
applications/unit_tests/minunit_vars_ex.h → applications/debug/unit_tests/minunit_vars_ex.h


+ 1 - 1
applications/unit_tests/nfc/nfc_test.c → applications/debug/unit_tests/nfc/nfc_test.c

@@ -1,6 +1,6 @@
 #include <furi.h>
 #include <furi.h>
 #include <furi_hal.h>
 #include <furi_hal.h>
-#include <applications/storage/storage.h>
+#include <storage/storage.h>
 #include <lib/flipper_format/flipper_format.h>
 #include <lib/flipper_format/flipper_format.h>
 #include <lib/nfc/protocols/nfca.h>
 #include <lib/nfc/protocols/nfca.h>
 #include <lib/digital_signal/digital_signal.h>
 #include <lib/digital_signal/digital_signal.h>

+ 0 - 0
applications/unit_tests/protocol_dict/protocol_dict_test.c → applications/debug/unit_tests/protocol_dict/protocol_dict_test.c


+ 0 - 0
applications/unit_tests/rpc/rpc_test.c → applications/debug/unit_tests/rpc/rpc_test.c


+ 0 - 0
applications/unit_tests/storage/dirwalk_test.c → applications/debug/unit_tests/storage/dirwalk_test.c


+ 0 - 0
applications/unit_tests/storage/storage_test.c → applications/debug/unit_tests/storage/storage_test.c


+ 0 - 0
applications/unit_tests/stream/stream_test.c → applications/debug/unit_tests/stream/stream_test.c


+ 0 - 0
applications/unit_tests/subghz/subghz_test.c → applications/debug/unit_tests/subghz/subghz_test.c


+ 0 - 0
applications/unit_tests/test_index.c → applications/debug/unit_tests/test_index.c


+ 0 - 0
applications/unit_tests/varint/varint_test.c → applications/debug/unit_tests/varint/varint_test.c


+ 11 - 0
applications/debug/usb_mouse/application.fam

@@ -0,0 +1,11 @@
+App(
+    appid="usb_mouse",
+    name="USB Mouse Demo",
+    apptype=FlipperAppType.DEBUG,
+    entry_point="usb_mouse_app",
+    cdefines=["APP_USB_MOUSE"],
+    requires=["gui"],
+    stack_size=1 * 1024,
+    order=60,
+    fap_category="Debug",
+)

+ 0 - 0
applications/debug_tools/usb_mouse.c → applications/debug/usb_mouse/usb_mouse.c


+ 11 - 0
applications/debug/usb_test/application.fam

@@ -0,0 +1,11 @@
+App(
+    appid="usb_test",
+    name="USB Test",
+    apptype=FlipperAppType.DEBUG,
+    entry_point="usb_test_app",
+    cdefines=["APP_USB_TEST"],
+    requires=["gui"],
+    stack_size=1 * 1024,
+    order=50,
+    fap_category="Debug",
+)

+ 0 - 0
applications/debug_tools/usb_test.c → applications/debug/usb_test/usb_test.c


+ 11 - 0
applications/debug/vibro_test/application.fam

@@ -0,0 +1,11 @@
+App(
+    appid="vibro_test",
+    name="Vibro Test",
+    apptype=FlipperAppType.DEBUG,
+    entry_point="vibro_test_app",
+    cdefines=["APP_VIBRO_TEST"],
+    requires=["gui"],
+    stack_size=1 * 1024,
+    order=20,
+    fap_category="Debug",
+)

+ 0 - 0
applications/debug_tools/vibro_test.c → applications/debug/vibro_test/vibro_test.c


+ 0 - 115
applications/debug_tools/application.fam

@@ -1,115 +0,0 @@
-App(
-    appid="debug_apps",
-    name="Basic debug apps bundle",
-    apptype=FlipperAppType.METAPACKAGE,
-    provides=[
-        "blink_test",
-        "vibro_test",
-        "keypad_test",
-        "usb_test",
-        "usb_mouse",
-        "uart_echo",
-        "display_test",
-        "text_box_test",
-        "file_browser_test",
-    ],
-)
-
-App(
-    appid="blink_test",
-    name="Blink Test",
-    apptype=FlipperAppType.DEBUG,
-    entry_point="blink_test_app",
-    cdefines=["APP_BLINK"],
-    requires=["gui"],
-    stack_size=1 * 1024,
-    order=10,
-)
-
-App(
-    appid="vibro_test",
-    name="Vibro Test",
-    apptype=FlipperAppType.DEBUG,
-    entry_point="vibro_test_app",
-    cdefines=["APP_VIBRO_TEST"],
-    requires=["gui"],
-    stack_size=1 * 1024,
-    order=20,
-)
-
-App(
-    appid="keypad_test",
-    name="Keypad Test",
-    apptype=FlipperAppType.DEBUG,
-    entry_point="keypad_test_app",
-    cdefines=["APP_KEYPAD_TEST"],
-    requires=["gui"],
-    stack_size=1 * 1024,
-    order=30,
-)
-
-App(
-    appid="usb_test",
-    name="USB Test",
-    apptype=FlipperAppType.DEBUG,
-    entry_point="usb_test_app",
-    cdefines=["APP_USB_TEST"],
-    requires=["gui"],
-    stack_size=1 * 1024,
-    order=50,
-)
-
-App(
-    appid="usb_mouse",
-    name="USB Mouse Demo",
-    apptype=FlipperAppType.DEBUG,
-    entry_point="usb_mouse_app",
-    cdefines=["APP_USB_MOUSE"],
-    requires=["gui"],
-    stack_size=1 * 1024,
-    order=60,
-)
-
-App(
-    appid="uart_echo",
-    name="UART Echo",
-    apptype=FlipperAppType.DEBUG,
-    entry_point="uart_echo_app",
-    cdefines=["APP_UART_ECHO"],
-    requires=["gui"],
-    stack_size=2 * 1024,
-    order=70,
-)
-
-App(
-    appid="display_test",
-    name="Display Test",
-    apptype=FlipperAppType.DEBUG,
-    entry_point="display_test_app",
-    cdefines=["APP_DISPLAY_TEST"],
-    requires=["gui"],
-    stack_size=1 * 1024,
-    order=120,
-)
-
-App(
-    appid="text_box_test",
-    name="Text Box Test",
-    apptype=FlipperAppType.DEBUG,
-    entry_point="text_box_test_app",
-    cdefines=["APP_TEXT_BOX_TEST"],
-    requires=["gui"],
-    stack_size=1 * 1024,
-    order=140,
-)
-
-App(
-    appid="file_browser_test",
-    name="File Browser Test",
-    apptype=FlipperAppType.DEBUG,
-    entry_point="file_browser_app",
-    cdefines=["APP_FILE_BROWSER_TEST"],
-    requires=["gui"],
-    stack_size=2 * 1024,
-    order=150,
-)

+ 0 - 58
applications/extapps.scons

@@ -1,58 +0,0 @@
-Import("ENV")
-
-
-from fbt.appmanifest import FlipperAppType
-
-appenv = ENV.Clone(tools=["fbt_extapps"])
-
-appenv.Replace(
-    LINKER_SCRIPT="application-ext",
-    STRIPFLAGS=[
-        "--strip-debug",
-        "--strip-unneeded",
-        "-d",
-        "-g",
-        "-S",
-    ],
-)
-
-appenv.AppendUnique(
-    CCFLAGS=[
-        "-Os",
-        "-ggdb3",
-        "-mword-relocations",
-        "-mlong-calls",
-        "-fno-common",
-        "-nostdlib",
-        "-fvisibility=hidden",
-    ],
-    LINKFLAGS=[
-        "-r",
-        "-s",
-        # "-Bsymbolic",
-        "-nostartfiles",
-        "-mlong-calls",
-        "-fno-common",
-        "-nostdlib",
-        "-Wl,--gc-sections",
-        "-Wl,--no-export-dynamic",
-        "-fvisibility=hidden",
-        "-Wl,-e${APP_ENTRY}",
-        "-Xlinker",
-        "-Map=${TARGET}.map",
-    ],
-)
-
-
-extapps = []
-for apptype in (FlipperAppType.PLUGIN, FlipperAppType.EXTERNAL):
-    for app in appenv["APPBUILD"].get_apps_of_type(apptype):
-        extapps.append(appenv.BuildAppElf(app))
-
-# Ugly access to global option
-if extra_app_list := GetOption("extra_ext_apps"):
-    for extra_app in extra_app_list.split(","):
-        extapps.append(appenv.BuildAppElf(appenv["APPMGR"].get(extra_app)))
-
-Alias(appenv["FIRMWARE_BUILD_CFG"] + "_extapps", extapps)
-Return("extapps")

+ 0 - 13
applications/gui/application.fam

@@ -1,13 +0,0 @@
-App(
-    appid="gui",
-    name="GuiSrv",
-    apptype=FlipperAppType.SERVICE,
-    entry_point="gui_srv",
-    cdefines=["SRV_GUI"],
-    requires=[
-        "input",
-        "notification",
-    ],
-    stack_size=2 * 1024,
-    order=70,
-)

+ 0 - 131
applications/gui/modules/dialog.c

@@ -1,131 +0,0 @@
-#include "dialog.h"
-#include <gui/elements.h>
-#include <furi.h>
-
-struct Dialog {
-    View* view;
-    void* context;
-    DialogResultCallback callback;
-};
-
-typedef struct {
-    const char* header_text;
-    const char* text;
-    const char* left_text;
-    const char* right_text;
-} DialogModel;
-
-static void dialog_view_draw_callback(Canvas* canvas, void* _model) {
-    DialogModel* model = _model;
-    uint8_t canvas_center = canvas_width(canvas) / 2;
-
-    // Prepare canvas
-    canvas_clear(canvas);
-    canvas_set_color(canvas, ColorBlack);
-
-    // Draw header
-    canvas_set_font(canvas, FontPrimary);
-    canvas_draw_str_aligned(
-        canvas, canvas_center, 17, AlignCenter, AlignBottom, model->header_text);
-
-    // Draw text
-    canvas_set_font(canvas, FontSecondary);
-    elements_multiline_text_aligned(
-        canvas, canvas_center, 32, AlignCenter, AlignCenter, model->text);
-
-    // Draw buttons
-    elements_button_left(canvas, model->left_text);
-    elements_button_right(canvas, model->right_text);
-}
-
-static bool dialog_view_input_callback(InputEvent* event, void* context) {
-    Dialog* dialog = context;
-    bool consumed = false;
-
-    // Process key presses only
-    if(event->type == InputTypeShort && dialog->callback) {
-        if(event->key == InputKeyLeft) {
-            dialog->callback(DialogResultLeft, dialog->context);
-            consumed = true;
-        } else if(event->key == InputKeyRight) {
-            dialog->callback(DialogResultRight, dialog->context);
-            consumed = true;
-        } else if(event->key == InputKeyBack) {
-            dialog->callback(DialogResultBack, dialog->context);
-            consumed = true;
-        }
-    }
-
-    return consumed;
-}
-
-Dialog* dialog_alloc() {
-    Dialog* dialog = malloc(sizeof(Dialog));
-    dialog->view = view_alloc();
-    view_set_context(dialog->view, dialog);
-    view_allocate_model(dialog->view, ViewModelTypeLockFree, sizeof(DialogModel));
-    view_set_draw_callback(dialog->view, dialog_view_draw_callback);
-    view_set_input_callback(dialog->view, dialog_view_input_callback);
-    return dialog;
-}
-
-void dialog_free(Dialog* dialog) {
-    furi_assert(dialog);
-    view_free(dialog->view);
-    free(dialog);
-}
-
-View* dialog_get_view(Dialog* dialog) {
-    furi_assert(dialog);
-    return dialog->view;
-}
-
-void dialog_set_result_callback(Dialog* dialog, DialogResultCallback callback) {
-    furi_assert(dialog);
-    dialog->callback = callback;
-}
-
-void dialog_set_context(Dialog* dialog, void* context) {
-    furi_assert(dialog);
-    dialog->context = context;
-}
-
-void dialog_set_header_text(Dialog* dialog, const char* text) {
-    furi_assert(dialog);
-    furi_assert(text);
-    with_view_model(
-        dialog->view, (DialogModel * model) {
-            model->header_text = text;
-            return true;
-        });
-}
-
-void dialog_set_text(Dialog* dialog, const char* text) {
-    furi_assert(dialog);
-    furi_assert(text);
-    with_view_model(
-        dialog->view, (DialogModel * model) {
-            model->text = text;
-            return true;
-        });
-}
-
-void dialog_set_left_button_text(Dialog* dialog, const char* text) {
-    furi_assert(dialog);
-    furi_assert(text);
-    with_view_model(
-        dialog->view, (DialogModel * model) {
-            model->left_text = text;
-            return true;
-        });
-}
-
-void dialog_set_right_button_text(Dialog* dialog, const char* text) {
-    furi_assert(dialog);
-    furi_assert(text);
-    with_view_model(
-        dialog->view, (DialogModel * model) {
-            model->right_text = text;
-            return true;
-        });
-}

Некоторые файлы не были показаны из-за большого количества измененных файлов