فهرست منبع

Refactor for ufbt

0xchocolate 2 سال پیش
والد
کامیت
c5e72fce4a
100فایلهای تغییر یافته به همراه23 افزوده شده و 6316 حذف شده
  1. 0 191
      .clang-format
  2. 0 13
      .editorconfig
  3. 0 4
      .gitattributes
  4. 0 72
      .github/CODEOWNERS
  5. 0 46
      .github/ISSUE_TEMPLATE/01_bug_report.yml
  6. 0 21
      .github/ISSUE_TEMPLATE/02_enhancements.yml
  7. 0 24
      .github/ISSUE_TEMPLATE/03_feature_request.yml
  8. 0 5
      .github/ISSUE_TEMPLATE/config.yml
  9. BIN
      .github/assets/Born2bSportyV2.ttf
  10. BIN
      .github/assets/dark_theme_banner.png
  11. BIN
      .github/assets/latest-firmware-template.png
  12. BIN
      .github/assets/light_theme_banner.png
  13. 0 13
      .github/pull_request_template.md
  14. 23 217
      .github/workflows/build.yml
  15. 0 89
      .github/workflows/lint_and_submodule_check.yml
  16. 0 42
      .github/workflows/merge_report.yml
  17. 0 89
      .github/workflows/pvs_studio.yml
  18. 0 14
      .github/workflows/reindex.yml
  19. 0 64
      .github/workflows/unit_tests.yml
  20. 0 72
      .github/workflows/updater_test.yml
  21. 0 66
      .gitignore
  22. 0 42
      .gitmodules
  23. 0 49
      .pvsconfig
  24. 0 1
      .pvsoptions
  25. 0 4
      .vscode/.gitignore
  26. 0 17
      .vscode/ReadMe.md
  27. 0 32
      .vscode/example/c_cpp_properties.json
  28. 0 120
      .vscode/example/launch.json
  29. 0 25
      .vscode/example/settings.json
  30. 0 183
      .vscode/example/tasks.json
  31. 0 19
      .vscode/extensions.json
  32. 0 128
      CODE_OF_CONDUCT.md
  33. 0 101
      CODING_STYLE.md
  34. 0 72
      CONTRIBUTING.md
  35. 0 355
      SConstruct
  36. 0 0
      application.fam
  37. 0 94
      applications/ReadMe.md
  38. 0 11
      applications/debug/accessor/accessor.cpp
  39. 0 141
      applications/debug/accessor/accessor_app.cpp
  40. 0 54
      applications/debug/accessor/accessor_app.h
  41. 0 19
      applications/debug/accessor/accessor_event.h
  42. 0 80
      applications/debug/accessor/accessor_view_manager.cpp
  43. 0 39
      applications/debug/accessor/accessor_view_manager.h
  44. 0 12
      applications/debug/accessor/application.fam
  45. 0 221
      applications/debug/accessor/helpers/wiegand.cpp
  46. 0 30
      applications/debug/accessor/helpers/wiegand.h
  47. 0 13
      applications/debug/accessor/scene/accessor_scene_generic.h
  48. 0 88
      applications/debug/accessor/scene/accessor_scene_start.cpp
  49. 0 9
      applications/debug/accessor/scene/accessor_scene_start.h
  50. 0 16
      applications/debug/application.fam
  51. 0 15
      applications/debug/battery_test_app/application.fam
  52. 0 101
      applications/debug/battery_test_app/battery_test_app.c
  53. 0 25
      applications/debug/battery_test_app/battery_test_app.h
  54. 0 148
      applications/debug/battery_test_app/views/battery_info.c
  55. 0 23
      applications/debug/battery_test_app/views/battery_info.h
  56. 0 11
      applications/debug/blink_test/application.fam
  57. 0 126
      applications/debug/blink_test/blink_test.c
  58. 0 18
      applications/debug/bt_debug_app/application.fam
  59. 0 118
      applications/debug/bt_debug_app/bt_debug_app.c
  60. 0 26
      applications/debug/bt_debug_app/bt_debug_app.h
  61. 0 188
      applications/debug/bt_debug_app/views/bt_carrier_test.c
  62. 0 10
      applications/debug/bt_debug_app/views/bt_carrier_test.h
  63. 0 155
      applications/debug/bt_debug_app/views/bt_packet_test.c
  64. 0 10
      applications/debug/bt_debug_app/views/bt_packet_test.h
  65. 0 434
      applications/debug/bt_debug_app/views/bt_test.c
  66. 0 46
      applications/debug/bt_debug_app/views/bt_test.h
  67. 0 30
      applications/debug/bt_debug_app/views/bt_test_types.h
  68. 0 10
      applications/debug/direct_draw/application.fam
  69. 0 112
      applications/debug/direct_draw/direct_draw.c
  70. 0 12
      applications/debug/display_test/application.fam
  71. 0 231
      applications/debug/display_test/display_test.c
  72. 0 1
      applications/debug/display_test/display_test.h
  73. 0 185
      applications/debug/display_test/view_display_test.c
  74. 0 12
      applications/debug/display_test/view_display_test.h
  75. 0 9
      applications/debug/example_custom_font/application.fam
  76. 0 98
      applications/debug/example_custom_font/example_custom_font.c
  77. 0 12
      applications/debug/file_browser_test/application.fam
  78. 0 99
      applications/debug/file_browser_test/file_browser_app.c
  79. 0 32
      applications/debug/file_browser_test/file_browser_app_i.h
  80. BIN
      applications/debug/file_browser_test/icons/badusb_10px.png
  81. 0 30
      applications/debug/file_browser_test/scenes/file_browser_scene.c
  82. 0 29
      applications/debug/file_browser_test/scenes/file_browser_scene.h
  83. 0 40
      applications/debug/file_browser_test/scenes/file_browser_scene_browser.c
  84. 0 3
      applications/debug/file_browser_test/scenes/file_browser_scene_config.h
  85. 0 41
      applications/debug/file_browser_test/scenes/file_browser_scene_result.c
  86. 0 46
      applications/debug/file_browser_test/scenes/file_browser_scene_start.c
  87. 0 11
      applications/debug/keypad_test/application.fam
  88. 0 157
      applications/debug/keypad_test/keypad_test.c
  89. 0 16
      applications/debug/lfrfid_debug/application.fam
  90. 0 81
      applications/debug/lfrfid_debug/lfrfid_debug.c
  91. 0 30
      applications/debug/lfrfid_debug/lfrfid_debug_i.h
  92. 0 44
      applications/debug/lfrfid_debug/scenes/lfrfid_debug_app_scene_start.c
  93. 0 48
      applications/debug/lfrfid_debug/scenes/lfrfid_debug_app_scene_tune.c
  94. 0 30
      applications/debug/lfrfid_debug/scenes/lfrfid_debug_scene.c
  95. 0 29
      applications/debug/lfrfid_debug/scenes/lfrfid_debug_scene.h
  96. 0 2
      applications/debug/lfrfid_debug/scenes/lfrfid_debug_scene_config.h
  97. 0 234
      applications/debug/lfrfid_debug/views/lfrfid_debug_view_tune.c
  98. 0 18
      applications/debug/lfrfid_debug/views/lfrfid_debug_view_tune.h
  99. 0 11
      applications/debug/locale_test/application.fam
  100. 0 102
      applications/debug/locale_test/locale_test.c

+ 0 - 191
.clang-format

@@ -1,191 +0,0 @@
----
-Language:        Cpp
-AccessModifierOffset: -4
-AlignAfterOpenBracket: AlwaysBreak
-AlignArrayOfStructures: None
-AlignConsecutiveMacros: None
-AlignConsecutiveAssignments: None
-AlignConsecutiveBitFields: None
-AlignConsecutiveDeclarations: None
-AlignEscapedNewlines: Left
-AlignOperands:   Align
-AlignTrailingComments: false
-AllowAllArgumentsOnNextLine: true
-AllowAllParametersOfDeclarationOnNextLine: false
-AllowShortEnumsOnASingleLine: true
-AllowShortBlocksOnASingleLine: Never
-AllowShortCaseLabelsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: None
-AllowShortLambdasOnASingleLine: All
-AllowShortIfStatementsOnASingleLine: WithoutElse
-AllowShortLoopsOnASingleLine: true
-AlwaysBreakAfterDefinitionReturnType: None
-AlwaysBreakAfterReturnType: None
-AlwaysBreakBeforeMultilineStrings: false
-AlwaysBreakTemplateDeclarations: Yes
-AttributeMacros:
-  - __capability
-BinPackArguments: 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
-BreakBeforeConceptDeclarations: true
-BreakBeforeBraces: Attach
-BreakBeforeInheritanceComma: false
-BreakInheritanceList: BeforeColon
-BreakBeforeTernaryOperators: false
-BreakConstructorInitializersBeforeComma: false
-BreakConstructorInitializers: BeforeComma
-BreakAfterJavaFieldAnnotations: false
-BreakStringLiterals: false
-ColumnLimit:     99
-CommentPragmas:  '^ IWYU pragma:'
-QualifierAlignment: Leave
-CompactNamespaces: false
-ConstructorInitializerIndentWidth: 4
-ContinuationIndentWidth: 4
-Cpp11BracedListStyle: true
-DeriveLineEnding: true
-DerivePointerAlignment: false
-DisableFormat:   false
-EmptyLineAfterAccessModifier: Never
-EmptyLineBeforeAccessModifier: LogicalBlock
-ExperimentalAutoDetectBinPacking: false
-PackConstructorInitializers: BinPack
-BasedOnStyle:    ''
-ConstructorInitializerAllOnOneLineOrOnePerLine: false
-AllowAllConstructorInitializersOnNextLine: true
-FixNamespaceComments: false
-ForEachMacros:
-  - foreach
-  - Q_FOREACH
-  - BOOST_FOREACH
-IfMacros:
-  - KJ_IF_MAYBE
-IncludeBlocks:   Preserve
-IncludeCategories:
-  - 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)?$'
-IncludeIsMainSourceRegex: ''
-IndentAccessModifiers: false
-IndentCaseLabels: false
-IndentCaseBlocks: false
-IndentGotoLabels: true
-IndentPPDirectives: None
-IndentExternBlock: AfterExternBlock
-IndentRequires:  false
-IndentWidth:     4
-IndentWrappedFunctionNames: true
-InsertTrailingCommas: None
-JavaScriptQuotes: Leave
-JavaScriptWrapImports: true
-KeepEmptyLinesAtTheStartOfBlocks: false
-LambdaBodyIndentation: Signature
-MacroBlockBegin: ''
-MacroBlockEnd:   ''
-MaxEmptyLinesToKeep: 1
-NamespaceIndentation: None
-ObjCBinPackProtocolList: Auto
-ObjCBlockIndentWidth: 4
-ObjCBreakBeforeNestedBlockParam: true
-ObjCSpaceAfterProperty: true
-ObjCSpaceBeforeProtocolList: true
-PenaltyBreakAssignment: 10
-PenaltyBreakBeforeFirstCallParameter: 30
-PenaltyBreakComment: 10
-PenaltyBreakFirstLessLess: 0
-PenaltyBreakOpenParenthesis: 0
-PenaltyBreakString: 10
-PenaltyBreakTemplateDeclaration: 10
-PenaltyExcessCharacter: 100
-PenaltyReturnTypeOnItsOwnLine: 60
-PenaltyIndentedWhitespace: 0
-PointerAlignment: Left
-PPIndentWidth:   -1
-ReferenceAlignment: Pointer
-ReflowComments:  false
-RemoveBracesLLVM: false
-SeparateDefinitionBlocks: Leave
-ShortNamespaceLines: 1
-SortIncludes:    Never
-SortJavaStaticImport: Before
-SortUsingDeclarations: false
-SpaceAfterCStyleCast: false
-SpaceAfterLogicalNot: false
-SpaceAfterTemplateKeyword: true
-SpaceBeforeAssignmentOperators: true
-SpaceBeforeCaseColon: false
-SpaceBeforeCpp11BracedList: false
-SpaceBeforeCtorInitializerColon: true
-SpaceBeforeInheritanceColon: true
-SpaceBeforeParens: Never
-SpaceBeforeParensOptions:
-  AfterControlStatements: false
-  AfterForeachMacros: false
-  AfterFunctionDefinitionName: false
-  AfterFunctionDeclarationName: false
-  AfterIfMacros:   false
-  AfterOverloadedOperator: false
-  BeforeNonEmptyParentheses: false
-SpaceAroundPointerQualifiers: Default
-SpaceBeforeRangeBasedForLoopColon: true
-SpaceInEmptyBlock: false
-SpaceInEmptyParentheses: false
-SpacesBeforeTrailingComments: 1
-SpacesInAngles:  Never
-SpacesInConditionalStatement: false
-SpacesInContainerLiterals: false
-SpacesInCStyleCastParentheses: false
-SpacesInLineCommentPrefix:
-  Minimum:         1
-  Maximum:         -1
-SpacesInParentheses: false
-SpacesInSquareBrackets: false
-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
-...
-

+ 0 - 13
.editorconfig

@@ -1,13 +0,0 @@
-root = true
-
-[*]
-end_of_line = lf
-insert_final_newline = true
-charset = utf-8
-
-[*.{cpp,h,c,py,sh}]
-indent_style = space
-indent_size = 4
-
-[{Makefile,*.mk}]
-indent_size = tab

+ 0 - 4
.gitattributes

@@ -1,4 +0,0 @@
-* text=auto eol=lf
-*.bat eol=crlf
-*.ps1 eol=crlf
-*.cmd eol=crlf

+ 0 - 72
.github/CODEOWNERS

@@ -1,72 +0,0 @@
-# Who owns all the fish by default
-* @skotopes @DrZlo13 @hedger
-
-# Apps
-/applications/debug/bt_debug_app/ @skotopes @DrZlo13 @hedger @gornekich
-/applications/debug/accessor/ @skotopes @DrZlo13 @hedger @nminaylov
-/applications/debug/battery_test_app/ @skotopes @DrZlo13 @hedger @gornekich
-/applications/debug/bt_debug_app/ @skotopes @DrZlo13 @hedger @gornekich
-/applications/debug/file_browser_test/ @skotopes @DrZlo13 @hedger @nminaylov
-/applications/debug/lfrfid_debug/ @skotopes @DrZlo13 @hedger @nminaylov
-/applications/debug/text_box_test/ @skotopes @DrZlo13 @hedger @nminaylov
-/applications/debug/uart_echo/ @skotopes @DrZlo13 @hedger @nminaylov
-/applications/debug/usb_mouse/ @skotopes @DrZlo13 @hedger @nminaylov
-/applications/debug/usb_test/ @skotopes @DrZlo13 @hedger @nminaylov
-
-/applications/main/archive/ @skotopes @DrZlo13 @hedger @nminaylov
-/applications/main/bad_usb/ @skotopes @DrZlo13 @hedger @nminaylov
-/applications/main/gpio/ @skotopes @DrZlo13 @hedger @nminaylov
-/applications/main/ibutton/ @skotopes @DrZlo13 @hedger @gsurkov
-/applications/main/infrared/ @skotopes @DrZlo13 @hedger @gsurkov
-/applications/main/nfc/ @skotopes @DrZlo13 @hedger @gornekich @Astrrra
-/applications/main/subghz/ @skotopes @DrZlo13 @hedger @Skorpionm
-/applications/main/u2f/ @skotopes @DrZlo13 @hedger @nminaylov
-
-/applications/external/bt_hid_app/ @skotopes @DrZlo13 @hedger @gornekich
-/applications/external/picopass/ @skotopes @DrZlo13 @hedger @gornekich
-
-/applications/services/bt/ @skotopes @DrZlo13 @hedger @gornekich
-/applications/services/cli/ @skotopes @DrZlo13 @hedger @nminaylov
-/applications/services/crypto/ @skotopes @DrZlo13 @hedger @nminaylov
-/applications/services/desktop/ @skotopes @DrZlo13 @hedger @nminaylov
-/applications/services/dolphin/ @skotopes @DrZlo13 @hedger @nminaylov
-/applications/services/power/ @skotopes @DrZlo13 @hedger @gornekich
-/applications/services/rpc/ @skotopes @DrZlo13 @hedger @nminaylov
-
-/applications/services/bt_settings_app/ @skotopes @DrZlo13 @hedger @gornekich
-/applications/services/desktop_settings/ @skotopes @DrZlo13 @hedger @nminaylov
-/applications/services/dolphin_passport/ @skotopes @DrZlo13 @hedger @nminaylov
-/applications/services/power_settings_app/ @skotopes @DrZlo13 @hedger @gornekich
-
-/applications/system/storage_move_to_sd/ @skotopes @DrZlo13 @hedger @nminaylov
-
-/applications/debug/unit_tests/ @skotopes @DrZlo13 @hedger @nminaylov @gornekich @Astrrra @gsurkov @Skorpionm
-
-/applications/examples/example_thermo/ @skotopes @DrZlo13 @hedger @gsurkov
-
-# Firmware targets
-/firmware/ @skotopes @DrZlo13 @hedger @nminaylov
-
-# Assets
-/assets/resources/infrared/ @skotopes @DrZlo13 @hedger @gsurkov
-
-# Documentation
-/documentation/ @skotopes @DrZlo13 @hedger @drunkbatya
-/scripts/toolchain/ @skotopes @DrZlo13 @hedger @drunkbatya
-
-# Lib
-/lib/ST25RFAL002/ @skotopes @DrZlo13 @hedger @gornekich
-/lib/stm32wb_copro/ @skotopes @DrZlo13 @hedger @gornekich
-/lib/digital_signal/ @skotopes @DrZlo13 @hedger @gornekich
-/lib/infrared/ @skotopes @DrZlo13 @hedger @gsurkov
-/lib/lfrfid/ @skotopes @DrZlo13 @hedger @nminaylov
-/lib/libusb_stm32/ @skotopes @DrZlo13 @hedger @nminaylov
-/lib/mbedtls/ @skotopes @DrZlo13 @hedger @nminaylov
-/lib/micro-ecc/ @skotopes @DrZlo13 @hedger @nminaylov
-/lib/nanopb/ @skotopes @DrZlo13 @hedger @nminaylov
-/lib/nfc/ @skotopes @DrZlo13 @hedger @gornekich @Astrrra
-/lib/one_wire/ @skotopes @DrZlo13 @hedger @gsurkov
-/lib/subghz/ @skotopes @DrZlo13 @hedger @Skorpionm
-
-# CI/CD
-/.github/workflows/ @skotopes @DrZlo13 @hedger @drunkbatya

+ 0 - 46
.github/ISSUE_TEMPLATE/01_bug_report.yml

@@ -1,46 +0,0 @@
-name: Bug report
-description: File a bug reports regarding the firmware.
-labels: ['bug']
-body:
-- type: markdown
-  attributes:
-    value: |
-      Thank you for taking the time to fill out an issue, this template is meant for any issues related to the Flipper Zero firmware.
-      If you require help with the Flipper zero and its firmware, we ask that you join [our forum](https://forum.flipperzero.one)
-- type: textarea
-  id: description
-  attributes:
-    label: Describe the bug.
-    description: "A clear and concise description of what the bug is."
-  validations:
-    required: true
-- type: textarea
-  id: repro
-  attributes: 
-    label: Reproduction
-    description: "How can this bug be reproduced?"
-    placeholder: |
-      1. Switch on...
-      2. Press button '....'
-      3. Wait for the moon phase
-      4. It burns
-  validations:
-    required: true
-- type: input
-  id: target
-  attributes:
-    label: Target
-    description: Specify the target
-    # Target seems to be largely ignored by outside sources.
-- type: textarea
-  id: logs
-  attributes:
-    label: Logs
-    description: Attach your debug logs here
-    render: Text
-    # Avoid rendering as Markdown here.
-- type: textarea
-  id: anything-else
-  attributes:
-    label: Anything else?
-    description: Let us know if you have anything else to share.

+ 0 - 21
.github/ISSUE_TEMPLATE/02_enhancements.yml

@@ -1,21 +0,0 @@
-name: Enhancements
-description: Suggest improvements for any existing functionality within the firmware.
-body:
-- type: markdown
-  attributes:
-    value: |
-      Thank you for taking the time to fill out an issue. This template is meant for feature requests and improvements to already existing functionality.
-      If you require help with the Flipper zero and its firmware, we ask that you join [our forum](https://forum.flipperzero.one)
-- type: textarea
-  id: proposal
-  attributes:
-    label: "Describe the enhancement you're suggesting."
-    description: |
-      Feel free to describe in as much detail as you wish.
-  validations:
-    required: true
-- type: textarea
-  id: anything-else
-  attributes:
-    label: Anything else?
-    description: Let us know if you have anything else to share.

+ 0 - 24
.github/ISSUE_TEMPLATE/03_feature_request.yml

@@ -1,24 +0,0 @@
-name: Feature Request
-description: For feature requests regarding the firmware.
-labels: ['feature request']
-body:
-- type: markdown
-  attributes:
-    value: |
-      Thank you for taking the time to fill out an issue, this template is meant for any feature suggestions.
-      If you require help with the Flipper zero and its firmware, we ask that you join [our forum](https://forum.flipperzero.one)
-- type: textarea
-  id: proposal
-  attributes:
-    label: "Description of the feature you're suggesting."
-    description: |
-      Please describe your feature request in as many details as possible.
-        - Describe what it should do.
-        - Note whether it is to extend existing functionality or introduce new functionality.
-  validations:
-    required: true
-- type: textarea
-  id: anything-else
-  attributes:
-    label: Anything else?
-    description: Let us know if you have anything else to share.

+ 0 - 5
.github/ISSUE_TEMPLATE/config.yml

@@ -1,5 +0,0 @@
-blank_issues_enabled: true
-contact_links:
-  - name: Need help?
-    url: https://forum.flipperzero.one
-    about: For any question regarding on how to use the Flipper Zero and its firmware.

BIN
.github/assets/Born2bSportyV2.ttf


BIN
.github/assets/dark_theme_banner.png


BIN
.github/assets/latest-firmware-template.png


BIN
.github/assets/light_theme_banner.png


+ 0 - 13
.github/pull_request_template.md

@@ -1,13 +0,0 @@
-# What's new
-
-- [ Describe changes here ]
-
-# Verification 
-
-- [ Describe how to verify changes ]
-
-# Checklist (For Reviewer)
-
-- [ ] PR has description of feature/bug or link to Confluence/Jira task
-- [ ] Description contains actions to verify feature/bugfix
-- [ ] I've built this code, uploaded it to the device and verified feature/bugfix

+ 23 - 217
.github/workflows/build.yml

@@ -1,228 +1,34 @@
-name: 'Build'
-
+name: "FAP Build"
 on:
   push:
     branches:
-      - dev
-    tags:
-      - '*'
+      - main 
   pull_request:
-
-env:
-  TARGETS: f7
-  DEFAULT_TARGET: f7
-  FBT_TOOLCHAIN_PATH: /runner/_work
-
+  schedule:
+    - cron: "1 1 * * *"
 jobs:
-  main:
-    runs-on: [self-hosted,FlipperZeroShell]
-    steps:
-      - name: 'Wipe workspace'
-        run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
-
-      - name: 'Checkout code'
-        uses: actions/checkout@v3
-        with:
-          fetch-depth: 1
-          ref: ${{ github.event.pull_request.head.sha }}
-
-      - name: 'Get commit details'
-        id: names
-        run: |
-          if [[ ${{ github.event_name }} == 'pull_request' ]]; then
-            TYPE="pull"
-          elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
-            TYPE="tag"
-          else
-            TYPE="other"
-          fi
-          python3 scripts/get_env.py "--event_file=${{ github.event_path }}" "--type=$TYPE" || cat "${{ github.event_path }}"
-          echo random_hash=$(openssl rand -base64 40 | shasum -a 256 | awk '{print $1}') >> $GITHUB_OUTPUT
-          echo "event_type=$TYPE" >> $GITHUB_OUTPUT
-
-      - name: 'Check API versions'
-        run: |
-          set -e
-          N_API_HEADER_SIGNATURES=`ls -1 firmware/targets/f*/api_symbols.csv | xargs -I {} sh -c "head -n2 {} | md5sum" | sort -u | wc -l`
-          if [ $N_API_HEADER_SIGNATURES != 1 ] ; then
-            echo API versions aren\'t matching for available targets. Please update!
-            head -n2 firmware/targets/f*/api_symbols.csv
-            exit 1
-          fi
-
-      - name: 'Make artifacts directory'
-        run: |
-          rm -rf artifacts
-          rm -rf map_analyser_files
-          mkdir artifacts
-          mkdir map_analyser_files
-
-      - name: 'Bundle scripts'
-        if: ${{ !github.event.pull_request.head.repo.fork }}
-        run: |
-          tar czpf artifacts/flipper-z-any-scripts-${SUFFIX}.tgz scripts
-
-      - name: 'Build the firmware'
-        run: |
-          set -e
-          for TARGET in ${TARGETS}; do
-            TARGET="$(echo "${TARGET}" | sed 's/f//')"; \
-            ./fbt TARGET_HW=$TARGET copro_dist updater_package \
-            ${{ startsWith(github.ref, 'refs/tags') && 'DEBUG=0 COMPACT=1' || '' }}
-          done
-
-      - name: 'Move upload files'
-        if: ${{ !github.event.pull_request.head.repo.fork }}
-        run: |
-          set -e
-          for TARGET in ${TARGETS}; do
-            mv dist/${TARGET}-*/* artifacts/
-          done
-
-      - name: "Check for uncommitted changes"
-        run: |
-          git diff --exit-code
-
-      - name: 'Bundle resources'
-        if: ${{ !github.event.pull_request.head.repo.fork }}
-        run: |
-          tar czpf "artifacts/flipper-z-any-resources-${SUFFIX}.tgz" -C assets resources
-
-      - name: 'Bundle core2 firmware'
-        if: ${{ !github.event.pull_request.head.repo.fork }}
-        run: |
-          cp build/core2_firmware.tgz "artifacts/flipper-z-any-core2_firmware-${SUFFIX}.tgz"
-
-      - name: 'Copy map analyser files'
-        if: ${{ !github.event.pull_request.head.repo.fork }}
-        run: |
-          cp build/f7-firmware-*/firmware.elf.map map_analyser_files/firmware.elf.map
-          cp build/f7-firmware-*/firmware.elf map_analyser_files/firmware.elf
-          cp ${{ github.event_path }} map_analyser_files/event.json
-
-      - name: 'Upload map analyser files to storage'
-        if: ${{ !github.event.pull_request.head.repo.fork }}
-        uses: prewk/s3-cp-action@v2
-        with:
-          aws_s3_endpoint: "${{ secrets.MAP_REPORT_AWS_ENDPOINT }}"
-          aws_access_key_id: "${{ secrets.MAP_REPORT_AWS_ACCESS_KEY }}"
-          aws_secret_access_key: "${{ secrets.MAP_REPORT_AWS_SECRET_KEY }}"
-          source: "./map_analyser_files/"
-          dest: "s3://${{ secrets.MAP_REPORT_AWS_BUCKET }}/${{steps.names.outputs.random_hash}}"
-          flags: "--recursive --acl public-read"
-
-      - name: 'Trigger map file reporter'
-        if: ${{ !github.event.pull_request.head.repo.fork }}
-        uses: peter-evans/repository-dispatch@v2
-        with:
-          repository: flipperdevices/flipper-map-reporter
-          token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}
-          event-type: map-file-analyse
-          client-payload: '{"random_hash": "${{steps.names.outputs.random_hash}}", "event_type": "${{steps.names.outputs.event_type}}"}'
-
-      - name: 'Upload artifacts to update server'
-        if: ${{ !github.event.pull_request.head.repo.fork }}
-        run: |
-          mkdir -p ~/.ssh
-          ssh-keyscan -p ${{ secrets.RSYNC_DEPLOY_PORT }} -H ${{ secrets.RSYNC_DEPLOY_HOST }} > ~/.ssh/known_hosts
-          echo "${{ secrets.RSYNC_DEPLOY_KEY }}" > deploy_key;
-          chmod 600 ./deploy_key;
-          rsync -avzP --delete --mkpath \
-              -e 'ssh -p ${{ secrets.RSYNC_DEPLOY_PORT }} -i ./deploy_key' \
-              artifacts/ ${{ secrets.RSYNC_DEPLOY_USER }}@${{ secrets.RSYNC_DEPLOY_HOST }}:"${{ secrets.RSYNC_DEPLOY_BASE_PATH }}${BRANCH_NAME}/";
-          rm ./deploy_key;
-
-      - name: 'Trigger update server reindex'
-        if: ${{ !github.event.pull_request.head.repo.fork }}
-        run: curl -X POST -F 'key=${{ secrets.REINDEX_KEY }}' ${{ secrets.REINDEX_URL }}
-
-      - name: 'Find Previous Comment'
-        if: ${{ !github.event.pull_request.head.repo.fork && github.event.pull_request }}
-        uses: peter-evans/find-comment@v2
-        id: fc
-        with:
-          issue-number: ${{ github.event.pull_request.number }}
-          comment-author: 'github-actions[bot]'
-          body-includes: 'Compiled firmware for commit'
-
-      - name: 'Create or update comment'
-        if: ${{ !github.event.pull_request.head.repo.fork && github.event.pull_request}}
-        uses: peter-evans/create-or-update-comment@v3
-        with:
-          comment-id: ${{ steps.fc.outputs.comment-id }}
-          issue-number: ${{ github.event.pull_request.number }}
-          body: |
-            **Compiled firmware for commit `${{steps.names.outputs.commit_sha}}`:**
-            - [📦 Update package](https://update.flipperzero.one/builds/firmware/${{steps.names.outputs.branch_name}}/flipper-z-${{steps.names.outputs.default_target}}-update-${{steps.names.outputs.suffix}}.tgz)
-            - [📥 DFU file](https://update.flipperzero.one/builds/firmware/${{steps.names.outputs.branch_name}}/flipper-z-${{steps.names.outputs.default_target}}-full-${{steps.names.outputs.suffix}}.dfu)
-            - [☁️ Web/App updater](https://lab.flipper.net/?url=https://update.flipperzero.one/builds/firmware/${{steps.names.outputs.branch_name}}/flipper-z-${{steps.names.outputs.default_target}}-update-${{steps.names.outputs.suffix}}.tgz&channel=${{steps.names.outputs.branch_name}}&version=${{steps.names.outputs.commit_sha}})
-          edit-mode: replace
-
-  compact:
-    if: ${{ !startsWith(github.ref, 'refs/tags') }}
-    runs-on: [self-hosted,FlipperZeroShell]
+  ufbt-build-action:
+    runs-on: ubuntu-latest
     strategy:
       matrix:
-        target: [f7, f18]
+        include:
+          - name: dev channel
+            sdk-channel: dev
+          - name: release channel
+            sdk-channel: release
+    name: 'ufbt: Build for ${{ matrix.name }}'
     steps:
-      - name: 'Wipe workspace'
-        run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
-
-      - name: 'Checkout code'
+      - name: Checkout
         uses: actions/checkout@v3
         with:
-          fetch-depth: 1
-          submodules: false
-          ref: ${{ github.event.pull_request.head.sha }}
-
-      - name: 'Get commit details'
-        run: |
-          if [[ ${{ github.event_name }} == 'pull_request' ]]; then
-            TYPE="pull"
-          elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
-            TYPE="tag"
-          else
-            TYPE="other"
-          fi
-          python3 scripts/get_env.py "--event_file=${{ github.event_path }}" "--type=$TYPE" || cat "${{ github.event_path }}"
-
-      - name: 'Build the firmware'
-        id: build-fw
-        run: |
-          set -e
-          TARGET="$(echo '${{ matrix.target }}' | sed 's/f//')"; \
-          ./fbt TARGET_HW=$TARGET DEBUG=0 COMPACT=1 fap_dist updater_package
-          echo "sdk-file=$(ls dist/${{ matrix.target }}-*/flipper-z-${{ matrix.target }}-sdk-*.zip)" >> $GITHUB_OUTPUT
-          echo "hw-target-code=$TARGET" >> $GITHUB_OUTPUT
-
-      - name: Deploy uFBT with SDK
-        uses: flipperdevices/flipperzero-ufbt-action@v0.1.0
+          submodules: recursive
+      - name: Build with ufbt
+        uses: flipperdevices/flipperzero-ufbt-action@v0.1.2
+        id: build-app
+        with:
+          sdk-channel: ${{ matrix.sdk-channel }}
+      - name: Upload app artifacts
+        uses: actions/upload-artifact@v3
         with:
-          task: setup
-          sdk-file: ${{ steps.build-fw.outputs.sdk-file }}
-          sdk-hw-target: ${{ steps.build-fw.outputs.hw-target-code }}
-
-      - name: Build test app with SDK
-        run: |
-          mkdir testapp
-          cd testapp
-          ufbt create APPID=testapp
-          ufbt
-
-      - name: Build example & external apps with uFBT
-        run: |
-          for appdir in 'applications/external' 'applications/examples'; do
-            for app in $(find "$appdir" -maxdepth 1 -mindepth 1 -type d); do
-              pushd $app
-              TARGETS_FAM=$(grep "targets" application.fam || echo "${{ matrix.target }}")
-              if ! grep -q "${{ matrix.target }}" <<< $TARGETS_FAM ; then
-                  echo Skipping unsupported app: $app
-                  popd
-                  continue
-              fi
-              echo Building $app
-              ufbt
-              popd
-            done
-          done
-
+          name: ${{ github.event.repository.name }}-${{ steps.build-app.outputs.suffix }}
+          path: ${{ steps.build-app.outputs.fap-artifacts }}

+ 0 - 89
.github/workflows/lint_and_submodule_check.yml

@@ -1,89 +0,0 @@
-name: 'Lint sources & check submodule integrity'
-
-on:
-  push:
-    branches:
-      - dev
-    tags:
-      - '*'
-  pull_request:
-
-env:
-  TARGETS: f7
-  FBT_TOOLCHAIN_PATH: /runner/_work
-  SET_GH_OUTPUT: 1
-
-jobs:
-  lint_sources_check_submodules:
-    runs-on: [self-hosted,FlipperZeroShell]
-    steps:
-      - name: 'Wipe workspace'
-        run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
-
-      - name: 'Checkout code'
-        uses: actions/checkout@v3
-        with:
-          fetch-depth: 1
-          ref: ${{ github.event.pull_request.head.sha }}
-
-
-      - name: 'Check protobuf branch'
-        run: |
-          git submodule update --init
-          SUB_PATH="assets/protobuf";
-          SUB_BRANCH="dev";
-          SUB_COMMITS_MIN=40;
-          cd "$SUB_PATH";
-          SUBMODULE_HASH="$(git rev-parse HEAD)";
-          BRANCHES=$(git branch -r --contains "$SUBMODULE_HASH");
-          COMMITS_IN_BRANCH="$(git rev-list --count dev)";
-          if [ $COMMITS_IN_BRANCH -lt $SUB_COMMITS_MIN ]; then
-            echo "name=fails::error" >> $GITHUB_OUTPUT;
-            echo "::error::Error: Too few commits in $SUB_BRANCH of submodule $SUB_PATH: $COMMITS_IN_BRANCH(expected $SUB_COMMITS_MIN+)";
-            exit 1;
-          fi
-          if ! grep -q "/$SUB_BRANCH" <<< "$BRANCHES"; then
-            echo "name=fails::error" >> $GITHUB_OUTPUT;
-            echo "::error::Error: Submodule $SUB_PATH is not on branch $SUB_BRANCH";
-            exit 1;
-          fi
-
-      - name: 'Check Python code formatting'
-        id: syntax_check_py
-        run: |
-          set +e;
-          ./fbt -s lint_py 2>&1 | tee lint-py.log;
-          if [ "${PIPESTATUS[0]}" -ne 0 ]; then
-            # Save multiline output
-            echo "errors=1" >> $GITHUB_OUTPUT;
-            printf "Python Lint errors:\n\`\`\`\n" >> $GITHUB_STEP_SUMMARY;
-            echo "$(cat lint-py.log)" >> $GITHUB_STEP_SUMMARY;
-            printf "\n\`\`\`\n" >> $GITHUB_STEP_SUMMARY;
-            exit 1;
-          else
-            echo "Python Lint: all good ✨" >> $GITHUB_STEP_SUMMARY;
-          fi
-
-      - name: 'Check C++ code formatting'
-        id: syntax_check_cpp
-        if: always()
-        run: |
-          set +e;
-          ./fbt -s lint 2>&1 | tee lint-cpp.log;
-          if [ "${PIPESTATUS[0]}" -ne 0 ]; then
-            # Save multiline output
-            echo "errors=1" >> $GITHUB_OUTPUT;
-            printf "C Lint errors:\n\`\`\`\n" >> $GITHUB_STEP_SUMMARY;
-            echo "$(cat lint-cpp.log)" >> $GITHUB_STEP_SUMMARY;
-            printf "\n\`\`\`\n" >> $GITHUB_STEP_SUMMARY;
-            exit 1;
-          else
-            echo "C Lint: all good ✨" >> $GITHUB_STEP_SUMMARY;
-          fi
-
-      - name: Report code formatting errors
-        if: ( steps.syntax_check_py.outputs.errors || steps.syntax_check_cpp.outputs.errors ) && github.event.pull_request
-        run: |
-          echo "Code formatting errors found";
-          echo "Please run './fbt format' or './fbt format_py' to fix them";
-          exit 1;

+ 0 - 42
.github/workflows/merge_report.yml

@@ -1,42 +0,0 @@
-name: 'Check FL ticket in PR name'
-
-on:
-  push:
-    branches:
-      - dev
-
-env:
-  FBT_TOOLCHAIN_PATH: /runner/_work
-
-jobs:
-  merge_report:
-    runs-on: [self-hosted,FlipperZeroShell]
-    steps:
-      - name: 'Wipe workspace'
-        run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
-
-      - name: 'Checkout code'
-        uses: actions/checkout@v3
-        with:
-          fetch-depth: 1
-          ref: ${{ github.event.pull_request.head.sha }}
-
-      - name: 'Get commit details'
-        run: |
-          if [[ ${{ github.event_name }} == 'pull_request' ]]; then
-            TYPE="pull"
-          elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
-            TYPE="tag"
-          else
-            TYPE="other"
-          fi
-          python3 scripts/get_env.py "--event_file=${{ github.event_path }}" "--type=$TYPE" || cat "${{ github.event_path }}"
-
-      - name: 'Check ticket and report'
-        run: |
-          source scripts/toolchain/fbtenv.sh
-          python3 -m pip install slack_sdk
-          python3 scripts/merge_report_qa.py \
-              ${{ secrets.QA_REPORT_SLACK_TOKEN }} \
-              ${{ secrets.QA_REPORT_SLACK_CHANNEL }}
-

+ 0 - 89
.github/workflows/pvs_studio.yml

@@ -1,89 +0,0 @@
-name: 'Static C/C++ analysis with PVS-Studio'
-
-on:
-  push:
-    branches:
-      - dev
-    tags:
-      - '*'
-  pull_request:
-
-env:
-  TARGETS: f7
-  DEFAULT_TARGET: f7
-  FBT_TOOLCHAIN_PATH: /runner/_work
-
-jobs:
-  analyse_c_cpp:
-    if: ${{ !github.event.pull_request.head.repo.fork }}
-    runs-on: [self-hosted, FlipperZeroShell]
-    steps:
-      - name: 'Wipe workspace'
-        run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
-
-      - name: 'Checkout code'
-        uses: actions/checkout@v3
-        with:
-          fetch-depth: 1
-          ref: ${{ github.event.pull_request.head.sha }}
-
-      - name: 'Get commit details'
-        id: names
-        run: |
-          if [[ ${{ github.event_name }} == 'pull_request' ]]; then
-            TYPE="pull"
-          elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
-            TYPE="tag"
-          else
-            TYPE="other"
-          fi
-          python3 scripts/get_env.py "--event_file=${{ github.event_path }}" "--type=$TYPE" || cat "${{ github.event_path }}"
-
-      - name: 'Supply PVS credentials'
-        run: |
-          pvs-studio-analyzer credentials ${{ secrets.PVS_STUDIO_CREDENTIALS }}
-
-      - name: 'Convert PVS-Studio output to html and detect warnings'
-        id: pvs-warn
-        run: |
-          WARNINGS=0
-          ./fbt COMPACT=1 PVSNOBROWSER=1 firmware_pvs || WARNINGS=1
-          echo "warnings=${WARNINGS}" >> $GITHUB_OUTPUT
-
-      - name: 'Upload report'
-        if: ${{ !github.event.pull_request.head.repo.fork && (steps.pvs-warn.outputs.warnings != 0) }}
-        uses: prewk/s3-cp-action@v2
-        with:
-          aws_s3_endpoint: "${{ secrets.PVS_AWS_ENDPOINT }}"
-          aws_access_key_id: "${{ secrets.PVS_AWS_ACCESS_KEY }}"
-          aws_secret_access_key: "${{ secrets.PVS_AWS_SECRET_KEY }}"
-          source: "./build/f7-firmware-DC/pvsreport"
-          dest: "s3://${{ secrets.PVS_AWS_BUCKET }}/${{steps.names.outputs.branch_name}}/${{steps.names.outputs.default_target}}-${{steps.names.outputs.suffix}}/"
-          flags: "--recursive --acl public-read"
-
-      - name: 'Find Previous Comment'
-        if: ${{ !github.event.pull_request.head.repo.fork && github.event.pull_request && (steps.pvs-warn.outputs.warnings != 0) }}
-        uses: peter-evans/find-comment@v2
-        id: fc
-        with:
-          issue-number: ${{ github.event.pull_request.number }}
-          comment-author: 'github-actions[bot]'
-          body-includes: 'PVS-Studio report for commit'
-
-      - name: 'Create or update comment'
-        if: ${{ !github.event.pull_request.head.repo.fork && github.event.pull_request && (steps.pvs-warn.outputs.warnings != 0) }}
-        uses: peter-evans/create-or-update-comment@v1
-        with:
-          comment-id: ${{ steps.fc.outputs.comment-id }}
-          issue-number: ${{ github.event.pull_request.number }}
-          body: |
-            **PVS-Studio report for commit `${{steps.names.outputs.commit_sha}}`:**
-            - [Report](https://pvs.flipp.dev/${{steps.names.outputs.branch_name}}/${{steps.names.outputs.default_target}}-${{steps.names.outputs.suffix}}/index.html)
-          edit-mode: replace
-
-      - name: 'Raise exception'
-        if: ${{ steps.pvs-warn.outputs.warnings != 0 }}
-        run: |
-          echo "Please fix all PVS warnings before merge"
-          exit 1
-

+ 0 - 14
.github/workflows/reindex.yml

@@ -1,14 +0,0 @@
-name: 'Reindex'
-
-on:
-  release:
-    types: [prereleased,released]
-
-jobs:
-  reindex:
-    name: 'Reindex updates'
-    runs-on: [self-hosted,FlipperZeroShell]
-    steps:
-      - name: Trigger reindex
-        run: |
-          curl -X POST -F 'key=${{ secrets.REINDEX_KEY }}' ${{ secrets.REINDEX_URL }}

+ 0 - 64
.github/workflows/unit_tests.yml

@@ -1,64 +0,0 @@
-name: 'Unit tests'
-
-on:
-  pull_request:
-
-env:
-  TARGETS: f7
-  DEFAULT_TARGET: f7
-  FBT_TOOLCHAIN_PATH: /opt
-
-jobs:
-  run_units_on_bench:
-    runs-on: [self-hosted, FlipperZeroUnitTest]
-    steps:
-      - name: 'Wipe workspace'
-        run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
-
-      - name: Checkout code
-        uses: actions/checkout@v3
-        with:
-          fetch-depth: 1
-          ref: ${{ github.event.pull_request.head.sha }}
-
-      - name: 'Get flipper from device manager (mock)'
-        id: device
-        run: |
-          echo "flipper=/dev/ttyACM0" >> $GITHUB_OUTPUT
-
-      - name: 'Flash unit tests firmware'
-        id: flashing
-        if: success()
-        run: |
-          ./fbt flash OPENOCD_ADAPTER_SERIAL=2A0906016415303030303032 FIRMWARE_APP_SET=unit_tests FORCE=1
-
-      - name: 'Wait for flipper and format ext'
-        id: format_ext
-        if: steps.flashing.outcome == 'success'
-        run: |
-          source scripts/toolchain/fbtenv.sh
-          python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
-          python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} format_ext
-
-      - name: 'Copy assets and unit data, reboot and wait for flipper'
-        id: copy
-        if: steps.format_ext.outcome == 'success'
-        run: |
-          source scripts/toolchain/fbtenv.sh
-          python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} -f send assets/resources /ext
-          python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} -f send assets/unit_tests /ext/unit_tests
-          python3 scripts/power.py -p ${{steps.device.outputs.flipper}} reboot
-          python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
-
-      - name: 'Run units and validate results'
-        id: run_units
-        if: steps.copy.outcome == 'success'
-        timeout-minutes: 2.5
-        run: |
-          source scripts/toolchain/fbtenv.sh
-          python3 scripts/testing/units.py ${{steps.device.outputs.flipper}}
-
-      - name: 'Check GDB output'
-        if: failure()
-        run: |
-          ./fbt gdb_trace_all OPENOCD_ADAPTER_SERIAL=2A0906016415303030303032 FIRMWARE_APP_SET=unit_tests FORCE=1

+ 0 - 72
.github/workflows/updater_test.yml

@@ -1,72 +0,0 @@
-name: 'Updater test'
-
-on:
-  pull_request:
-
-env:
-  TARGETS: f7
-  DEFAULT_TARGET: f7
-  FBT_TOOLCHAIN_PATH: /opt
-
-jobs:
-  test_updater_on_bench:
-    runs-on: [self-hosted, FlipperZeroUpdaterTest]
-    steps:
-      - name: 'Wipe workspace'
-        run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
-
-      - name: Checkout code
-        uses: actions/checkout@v3
-        with:
-          fetch-depth: 1
-          submodules: false
-          ref: ${{ github.event.pull_request.head.sha }}
-
-      - name: 'Get flipper from device manager (mock)'
-        id: device
-        run: |
-          echo "flipper=Rekigyn" >> $GITHUB_OUTPUT
-          echo "stlink=0F020D026415303030303032" >> $GITHUB_OUTPUT
-
-      - name: 'Flashing target firmware'
-        id: first_full_flash
-        run: |
-          source scripts/toolchain/fbtenv.sh
-          ./fbt flash_usb_full PORT=${{steps.device.outputs.flipper}} FORCE=1
-          python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
-
-      - name: 'Validating updater'
-        id: second_full_flash
-        if: success()
-        run: |
-          source scripts/toolchain/fbtenv.sh
-          ./fbt flash_usb PORT=${{steps.device.outputs.flipper}} FORCE=1
-          python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
-
-      - name: 'Get last release tag'
-        id: release_tag
-        if: failure()
-        run: |
-          echo "tag=$(git tag -l --sort=-version:refname | grep -v "rc\|RC" | head -1)" >> $GITHUB_OUTPUT
-
-      - name: 'Wipe workspace'
-        run: find ./ -mount -maxdepth 1 -exec rm -rf {} \;
-
-      - name: 'Checkout latest release'
-        uses: actions/checkout@v3
-        if: failure()
-        with:
-          fetch-depth: 1
-          ref: ${{ steps.release_tag.outputs.tag }}
-
-      - name: 'Flash last release'
-        if: failure()
-        run: |
-          ./fbt flash OPENOCD_ADAPTER_SERIAL=${{steps.device.outputs.stlink}} FORCE=1
-
-      - name: 'Wait for flipper and format ext'
-        if: failure()
-        run: |
-          source scripts/toolchain/fbtenv.sh
-          python3 scripts/testing/await_flipper.py ${{steps.device.outputs.flipper}}
-          python3 scripts/storage.py -p ${{steps.device.outputs.flipper}} format_ext

+ 0 - 66
.gitignore

@@ -1,66 +0,0 @@
-*~
-*.swp
-*.swo
-*.gdb_history
-*.old
-
-
-# LSP
-.cache
-compile_commands.json
-
-# JetBrains IDEs
-.idea/
-
-# Python VirtEnvironments
-.env
-.venv
-env/
-venv/
-
-# Python Byte-compiled / optimized files
-__pycache__/
-*.py[cod]
-*$py.class
-*.pickle
-
-.obj/
-bindings/
-.DS_Store
-.mxproject
-Brewfile.lock.json
-
-# Visual Studio Code
-/.vscode/
-
-# Kate
-.kateproject
-.kateconfig
-
-# legendary cmake's
-build
-CMakeLists.txt
-
-# bundle output
-dist
-
-# kde
-.directory
-
-# SCons
-.sconsign.dblite
-# SCons build dir
-build/
-
-# Toolchain
-/toolchain
-
-# openocd output file
-openocd.log
-
-# PVS Studio temporary files
-.PVS-Studio/
-PVS-Studio.log
-*.PVS-Studio.*
-
-.gdbinit

+ 0 - 42
.gitmodules

@@ -1,42 +0,0 @@
-[submodule "lib/mlib"]
-	path = lib/mlib
-	url = https://github.com/P-p-H-d/mlib.git
-[submodule "lib/littlefs"]
-	path = lib/littlefs
-	url = https://github.com/littlefs-project/littlefs.git
-[submodule "lib/nanopb"]
-	path = lib/nanopb
-	url = https://github.com/nanopb/nanopb.git
-[submodule "assets/protobuf"]
-	path = assets/protobuf
-	url = https://github.com/flipperdevices/flipperzero-protobuf.git
-[submodule "lib/libusb_stm32"]
-	path = lib/libusb_stm32
-	url = https://github.com/flipperdevices/libusb_stm32.git
-[submodule "lib/FreeRTOS-Kernel"]
-	path = lib/FreeRTOS-Kernel
-	url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
-[submodule "lib/microtar"]
-	path = lib/microtar
-	url = https://github.com/amachronic/microtar.git
-[submodule "lib/mbedtls"]
-	path = lib/mbedtls
-	url = https://github.com/Mbed-TLS/mbedtls.git
-[submodule "lib/cxxheaderparser"]
-	path = lib/cxxheaderparser
-	url = https://github.com/robotpy/cxxheaderparser.git
-[submodule "applications/external/dap_link/lib/free-dap"]
-	path = applications/external/dap_link/lib/free-dap
-	url = https://github.com/ataradov/free-dap.git
-[submodule "lib/heatshrink"]
-	path = lib/heatshrink
-	url = https://github.com/flipperdevices/heatshrink.git
-[submodule "lib/st_cmsis_device_wb"]
-	path = lib/stm32wb_cmsis
-	url = https://github.com/STMicroelectronics/cmsis_device_wb
-[submodule "lib/stm32wbxx_hal_driver"]
-	path = lib/stm32wb_hal
-	url = https://github.com/STMicroelectronics/stm32wbxx_hal_driver
-[submodule "lib/stm32wb_copro"]
-	path = lib/stm32wb_copro
-	url = https://github.com/flipperdevices/stm32wb_copro.git

+ 0 - 49
.pvsconfig

@@ -1,49 +0,0 @@
-# MLib macros we can't do much about.
-//-V:M_LET:1048,1044
-//-V:M_EACH:1048,1044
-//-V:ARRAY_DEF:760,747,568,776,729,712,654
-//-V:LIST_DEF:760,747,568,712,729,654,776
-//-V:BPTREE_DEF2:779,1086,557,773,512
-//-V:DICT_DEF2:779,524,776,760,1044,1001,729,590,568,747,685
-//-V:ALGO_DEF:1048,747,1044
-//-V:TUPLE_DEF2:524,590,1001,760
-
-# Non-severe malloc/null pointer deref warnings
-//-V::522:2,3
-
-# Warning about headers with copyleft license
-//-V::1042
-
-# Potentially null argument warnings
-//-V:memset:575
-//-V:memcpy:575
-//-V:memcmp:575
-//-V:strlen:575
-//-V:strcpy:575
-//-V:strncpy:575
-//-V:strchr:575
-
-# For loop warning on M_FOREACH
-//-V:for:1044
-
-# Bitwise OR
-//-V:bit:792
-
-# Do not complain about similar code
-//-V::525
-
-# Common embedded development pointer operations
-//-V::566
-//-V::1032
-
-# Warnings about length mismatch
-//-V:property_value_out:666
-
-# Model-related warnings
-//-V:with_view_model:1044,1048
-
-# Functions that always return the same error code
-//-V:picopass_device_decrypt:1048
-
-# Examples
-//V_EXCLUDE_PATH applications/examples/

+ 0 - 1
.pvsoptions

@@ -1 +0,0 @@
---ignore-ccache -C gccarm --rules-config .pvsconfig -e lib/cmsis_core -e lib/fatfs -e lib/fnv1a-hash -e lib/FreeRTOS-Kernel -e lib/heatshrink -e lib/libusb_stm32 -e lib/littlefs -e lib/mbedtls -e lib/micro-ecc -e lib/microtar -e lib/mlib -e lib/qrcode -e lib/ST25RFAL002 -e lib/stm32wb_cmsis -e lib/stm32wb_copro -e lib/stm32wb_hal -e lib/u8g2 -e lib/nanopb -e */arm-none-eabi/* -e applications/external/dap_link/lib/free-dap

+ 0 - 4
.vscode/.gitignore

@@ -1,4 +0,0 @@
-./c_cpp_properties.json
-./launch.json
-./settings.json
-./tasks.json

+ 0 - 17
.vscode/ReadMe.md

@@ -1,17 +0,0 @@
-# Visual Studio Code workspace for Flipper Zero
-
-## Setup
-
- * To start developing with VSCode, run `./fbt vscode_dist` in project root. _That should only be done once_
- * After that, open firmware folder in VSCode: "File" > "Open folder"
-
- For more details on fbt, see [fbt docs](../documentation/fbt.md).
-
-
-## Workflow
-
-Commands for building firmware are invoked through Build menu: Ctrl+Shift+B.
-
-To attach a debugging session, first build and flash firmware, then choose your debug probe in Debug menu (Ctrl+Shift+D).
-
-Note that you have to detach debugging session before rebuilding and re-flashing firmware.

+ 0 - 32
.vscode/example/c_cpp_properties.json

@@ -1,32 +0,0 @@
-{
-    "configurations": [
-        {
-            "name": "Win32",
-            "compilerPath": "${workspaceFolder}/toolchain/x86_64-windows/bin/arm-none-eabi-gcc.exe",
-            "intelliSenseMode": "gcc-arm",
-            "compileCommands": "${workspaceFolder}/build/latest/compile_commands.json",
-            "configurationProvider": "ms-vscode.cpptools",
-            "cStandard": "gnu17",
-            "cppStandard": "c++17"
-        },
-        {
-            "name": "Linux",
-            "compilerPath": "${workspaceFolder}/toolchain/x86_64-linux/bin/arm-none-eabi-gcc",
-            "intelliSenseMode": "gcc-arm",
-            "compileCommands": "${workspaceFolder}/build/latest/compile_commands.json",
-            "configurationProvider": "ms-vscode.cpptools",
-            "cStandard": "gnu17",
-            "cppStandard": "c++17"
-        },
-        {
-            "name": "Mac",
-            "compilerPath": "${workspaceFolder}/toolchain/x86_64-darwin/bin/arm-none-eabi-gcc",
-            "intelliSenseMode": "gcc-arm",
-            "compileCommands": "${workspaceFolder}/build/latest/compile_commands.json",
-            "configurationProvider": "ms-vscode.cpptools",
-            "cStandard": "gnu17",
-            "cppStandard": "c++17"
-        }
-    ],
-    "version": 4
-}

+ 0 - 120
.vscode/example/launch.json

@@ -1,120 +0,0 @@
-{
-    // Use IntelliSense to learn about possible attributes.
-    // Hover to view descriptions of existing attributes.
-    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
-    "version": "0.2.0",
-    "inputs": [
-        {
-            "id": "BLACKMAGIC",
-            "type": "command",
-            "command": "shellCommand.execute",
-            "args": {
-                "useSingleResult": true,
-                "env": {
-                    "PATH": "${workspaceFolder}${command:extension.commandvariable.envListSep}${env:PATH}"
-                },
-                "command": "fbt -s get_blackmagic",
-                "description": "Get Blackmagic device"
-            }
-        }
-    ],
-    "configurations": [
-        {
-            "name": "Attach FW (ST-Link)",
-            "cwd": "${workspaceFolder}",
-            "executable": "./build/latest/firmware.elf",
-            "request": "attach",
-            "type": "cortex-debug",
-            "servertype": "openocd",
-            "device": "stlink",
-            "svdFile": "./scripts/debug/STM32WB55_CM4.svd",
-            // If you're debugging early in the boot process, before OS scheduler is running,
-            // you have to comment out the following line.
-            "rtos": "FreeRTOS",
-            "configFiles": [
-                "interface/stlink.cfg",
-                "./scripts/debug/stm32wbx.cfg",
-            ],
-            "postAttachCommands": [
-                "source scripts/debug/flipperversion.py",
-                "fw-version",
-                // "compare-sections",
-                "source scripts/debug/flipperapps.py",
-                "fap-set-debug-elf-root build/latest/.extapps",
-                // "source scripts/debug/FreeRTOS/FreeRTOS.py",
-            ]
-            // "showDevDebugOutput": "raw",
-        },
-        {
-            "name": "Attach FW (blackmagic)",
-            "cwd": "${workspaceFolder}",
-            "executable": "./build/latest/firmware.elf",
-            "request": "attach",
-            "type": "cortex-debug",
-            "servertype": "external",
-            "gdbTarget": "${input:BLACKMAGIC}",
-            "svdFile": "./scripts/debug/STM32WB55_CM4.svd",
-            "rtos": "FreeRTOS",
-            "postAttachCommands": [
-                "monitor swdp_scan",
-                "attach 1",
-                "set confirm off",
-                "set mem inaccessible-by-default off",
-                "source scripts/debug/flipperversion.py",
-                "fw-version",
-                "source scripts/debug/flipperapps.py",
-                "fap-set-debug-elf-root build/latest/.extapps",
-                // "compare-sections",
-            ]
-            // "showDevDebugOutput": "raw",
-        },
-        {
-            "name": "Attach FW (JLink)",
-            "cwd": "${workspaceFolder}",
-            "executable": "./build/latest/firmware.elf",
-            "request": "attach",
-            "type": "cortex-debug",
-            "servertype": "jlink",
-            "interface": "swd",
-            "device": "STM32WB55RG",
-            "svdFile": "./scripts/debug/STM32WB55_CM4.svd",
-            "rtos": "FreeRTOS",
-            "postAttachCommands": [
-                "source scripts/debug/flipperversion.py",
-                "fw-version",
-                "source scripts/debug/flipperapps.py",
-                "fap-set-debug-elf-root build/latest/.extapps",
-            ]
-            // "showDevDebugOutput": "raw",
-        },
-        {
-            "name": "Attach FW (DAP)",
-            "cwd": "${workspaceFolder}",
-            "executable": "./build/latest/firmware.elf",
-            "request": "attach",
-            "type": "cortex-debug",
-            "servertype": "openocd",
-            "device": "cmsis-dap",
-            "svdFile": "./scripts/debug/STM32WB55_CM4.svd",
-            "rtos": "FreeRTOS",
-            "configFiles": [
-                "interface/cmsis-dap.cfg",
-                "./scripts/debug/stm32wbx.cfg",
-            ],
-            "postAttachCommands": [
-                "source scripts/debug/flipperversion.py",
-                "fw-version",
-                "source scripts/debug/flipperapps.py",
-                "fap-set-debug-elf-root build/latest/.extapps",
-            ],
-            // "showDevDebugOutput": "raw",
-        },
-        {
-            "name": "python debug",
-            "type": "python",
-            "request": "launch",
-            "program": "${file}",
-            "args": []
-        }
-    ]
-}

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

@@ -1,25 +0,0 @@
-{
-    "C_Cpp.default.cStandard": "gnu17",
-    "C_Cpp.default.cppStandard": "c++17",
-    "python.formatting.provider": "black",
-    "workbench.tree.indent": 12,
-    "cortex-debug.enableTelemetry": false,
-    "cortex-debug.variableUseNaturalFormat": true,
-    "cortex-debug.showRTOS": true,
-    "cortex-debug.armToolchainPath.windows": "${workspaceFolder}/toolchain/x86_64-windows/bin",
-    "cortex-debug.armToolchainPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/bin",
-    "cortex-debug.armToolchainPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/bin",
-    "cortex-debug.openocdPath.windows": "${workspaceFolder}/toolchain/x86_64-windows/openocd/bin/openocd.exe",
-    "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.gdbPath.windows": "${workspaceFolder}/toolchain/x86_64-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-py",
-    "editor.formatOnSave": true,
-    "files.associations": {
-        "*.scons": "python",
-        "SConscript": "python",
-        "SConstruct": "python",
-        "*.fam": "python",
-    }
-}

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

@@ -1,183 +0,0 @@
-{
-    // See https://go.microsoft.com/fwlink/?LinkId=733558
-    // for the documentation about the tasks.json format
-    "version": "2.0.0",
-    "tasks": [
-        {
-            "label": "[Release] Build",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt COMPACT=1 DEBUG=0"
-        },
-        {
-            "label": "[Debug] Build",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt"
-        },
-        {
-            "label": "[Release] Flash (ST-Link)",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt COMPACT=1 DEBUG=0 FORCE=1 flash"
-        },
-        {
-            "label": "[Debug] Flash (ST-Link)",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt FORCE=1 flash"
-        },
-        {
-            "label": "[Release] Flash (blackmagic)",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt COMPACT=1 DEBUG=0 FORCE=1 flash_blackmagic"
-        },
-        {
-            "label": "[Debug] Flash (blackmagic)",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt FORCE=1 flash_blackmagic"
-        },
-        {
-            "label": "[Release] Flash (JLink)",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt COMPACT=1 DEBUG=0 FORCE=1 jflash"
-        },
-        {
-            "label": "[Debug] Flash (JLink)",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt FORCE=1 jflash"
-        },
-        {
-            "label": "[Release] Build update bundle",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt updater_package COMPACT=1 DEBUG=0"
-        },
-        {
-            "label": "[Debug] Build update bundle",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt updater_package"
-        },
-        {
-            "label": "[Release] Build updater",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt updater_all COMPACT=1 DEBUG=0"
-        },
-        {
-            "label": "[Debug] Build updater",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt updater_all"
-        },
-        {
-            "label": "[Debug] Flash (USB, w/o resources)",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt FORCE=1 flash_usb"
-        },
-        {
-            "label": "[Release] Flash (USB, w/o resources)",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt COMPACT=1 DEBUG=0 FORCE=1 flash_usb"
-        },
-        {
-            "label": "[Debug:unit_tests] Flash (USB)",
-            "group": "build",
-            "type": "shell",
-            "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)",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt COMPACT=1 DEBUG=0 FORCE=1 flash_usb_full"
-        },
-        {
-            "label": "[Debug] Create PVS-Studio report",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt firmware_pvs"
-        },
-        {
-            "label": "[Debug] Build FAPs",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt fap_dist"
-        },
-        {
-            "label": "[Release] Build FAPs",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt COMPACT=1 DEBUG=0 fap_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}"
-        },
-        {
-            "label": "[Debug] Launch App on Flipper with Serial Console",
-            "dependsOrder": "sequence",
-            "group": "build",
-            "dependsOn": [
-                "[Debug] Launch App on Flipper",
-                "Serial Console"
-            ]
-        },
-        {
-            "label": "[Debug] Build and upload all FAPs to Flipper over USB",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt fap_deploy"
-        },
-        {
-            "label": "[Release] Build and upload all FAPs to Flipper over USB",
-            "group": "build",
-            "type": "shell",
-            "command": "./fbt COMPACT=1 DEBUG=0 fap_deploy"
-        },
-        {
-            // Press Ctrl+] to quit
-            "label": "Serial Console",
-            "type": "shell",
-            "command": "./fbt cli",
-            "group": "none",
-            "isBackground": true,
-            "options": {
-                "env": {
-                    "FBT_NO_SYNC": "0"
-                }
-            },
-            "presentation": {
-                "reveal": "always",
-                "revealProblems": "never",
-                "showReuseMessage": false,
-                "panel": "dedicated",
-                "focus": true,
-                "echo": true,
-                "close": true,
-                "group": "Logger"
-            }
-        }
-    ]
-}

+ 0 - 19
.vscode/extensions.json

@@ -1,19 +0,0 @@
-{
-	// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
-	// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
-	// List of extensions which should be recommended for users of this workspace.
-	"recommendations": [
-		"ms-python.black-formatter",
-		"ms-vscode.cpptools",
-		"amiralizadeh9480.cpp-helper",
-		"marus25.cortex-debug",
-		"zxh404.vscode-proto3",
-		"augustocdias.tasks-shell-input",
-		"rioj7.command-variable"
-	],
-	// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
-	"unwantedRecommendations": [
-		"twxs.cmake",
-		"ms-vscode.cmake-tools"
-	]
-}

+ 0 - 128
CODE_OF_CONDUCT.md

@@ -1,128 +0,0 @@
-# Contributor Covenant Code of Conduct
-
-## Our Pledge
-
-We as members, contributors, and leaders pledge to make participation in our
-community a harassment-free experience for everyone, regardless of age, body
-size, visible or invisible disability, ethnicity, sex characteristics, gender
-identity and expression, level of experience, education, socio-economic status,
-nationality, personal appearance, race, religion, or sexual identity
-and orientation.
-
-We pledge to act and interact in ways that contribute to an open, welcoming,
-diverse, inclusive, and healthy community.
-
-## Our Standards
-
-Examples of behavior that contributes to a positive environment for our
-community include:
-
-* Demonstrating empathy and kindness toward other people
-* Being respectful of differing opinions, viewpoints, and experiences
-* Giving and gracefully accepting constructive feedback
-* Accepting responsibility and apologizing to those affected by our mistakes,
-  and learning from the experience
-* Focusing on what is best not just for us as individuals, but for the
-  overall community
-
-Examples of unacceptable behavior include:
-
-* The use of sexualized language or imagery, and sexual attention or
-  advances of any kind
-* Trolling, insulting or derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or email
-  address, without their explicit permission
-* Other conduct which could reasonably be considered inappropriate in a
-  professional setting
-
-## Enforcement Responsibilities
-
-Community leaders are responsible for clarifying and enforcing our standards of
-acceptable behavior and will take appropriate and fair corrective action in
-response to any behavior that they deem inappropriate, threatening, offensive,
-or harmful.
-
-Community leaders have the right and responsibility to remove, edit, or reject
-comments, commits, code, wiki edits, issues, and other contributions that are
-not aligned to this Code of Conduct, and will communicate reasons for moderation
-decisions when appropriate.
-
-## Scope
-
-This Code of Conduct applies within all community spaces, and also applies when
-an individual is officially representing the community in public spaces.
-Examples of representing our community include using an official e-mail address,
-posting via an official social media account, or acting as an appointed
-representative at an online or offline event.
-
-## Enforcement
-
-Instances of abusive, harassing, or otherwise unacceptable behavior may be
-reported to the community leaders responsible for enforcement at
-hello@flipperdevices.com.
-All complaints will be reviewed and investigated promptly and fairly.
-
-All community leaders are obligated to respect the privacy and security of the
-reporter of any incident.
-
-## Enforcement Guidelines
-
-Community leaders will follow these Community Impact Guidelines in determining
-the consequences for any action they deem in violation of this Code of Conduct:
-
-### 1. Correction
-
-**Community Impact**: Use of inappropriate language or other behavior deemed
-unprofessional or unwelcome in the community.
-
-**Consequence**: A private, written warning from community leaders, providing
-clarity around the nature of the violation and an explanation of why the
-behavior was inappropriate. A public apology may be requested.
-
-### 2. Warning
-
-**Community Impact**: A violation through a single incident or series
-of actions.
-
-**Consequence**: A warning with consequences for continued behavior. No
-interaction with the people involved, including unsolicited interaction with
-those enforcing the Code of Conduct, for a specified period of time. This
-includes avoiding interactions in community spaces as well as external channels
-like social media. Violating these terms may lead to a temporary or
-permanent ban.
-
-### 3. Temporary Ban
-
-**Community Impact**: A serious violation of community standards, including
-sustained inappropriate behavior.
-
-**Consequence**: A temporary ban from any sort of interaction or public
-communication with the community for a specified period of time. No public or
-private interaction with the people involved, including unsolicited interaction
-with those enforcing the Code of Conduct, is allowed during this period.
-Violating these terms may lead to a permanent ban.
-
-### 4. Permanent Ban
-
-**Community Impact**: Demonstrating a pattern of violation of community
-standards, including sustained inappropriate behavior,  harassment of an
-individual, or aggression toward or disparagement of classes of individuals.
-
-**Consequence**: A permanent ban from any sort of public interaction within
-the community.
-
-## Attribution
-
-This Code of Conduct is adapted from the [Contributor Covenant][homepage],
-version 2.0, available at
-https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
-
-Community Impact Guidelines were inspired by [Mozilla's code of conduct
-enforcement ladder](https://github.com/mozilla/diversity).
-
-[homepage]: https://www.contributor-covenant.org
-
-For answers to common questions about this code of conduct, see the FAQ at
-https://www.contributor-covenant.org/faq. Translations are available at
-https://www.contributor-covenant.org/translations.

+ 0 - 101
CODING_STYLE.md

@@ -1,101 +0,0 @@
-# Intro
-
-Nice to see you reading this document, we really appreciate it.
-
-As all documents of this kind it's unable to cover everything.
-But it will cover general rules that we are enforcing on PR review.
-
-Also, we already have automatic rules checking and formatting,
-but it got its limitations and this guide is still mandatory.
-
-Some part of this project do have its own naming and coding guides.
-For example: assets. Take a look into `ReadMe.md` in assets folder for more details.
-
-Also, 3rd party libraries are none of our concern.
-
-And yes, this set is not final and we are open to discussion.
-If you want to add/remove/change something here please feel free to open new ticket.
-
-# Inspiration
-
-Our guide is inspired by, but not claiming to be compatible with:
-
-- https://www.kernel.org/doc/html/v4.10/process/coding-style.html
-- https://docs.unrealengine.com/en-US/Programming/Development/CodingStandard
-- https://webkit.org/code-style-guidelines/
-
-# General rules
-
-## Readability and Simplicity first
-
-Code we write is intended to be public.
-Avoid one-liners from hell and keep code complexity under control.
-Try to make code self-explanatory and add comments if needed.
-Leave references to standards that you are implementing.
-Use project wiki to document new/reverse engineered standards.
-
-## Variable and function names must clearly define what it's doing
-
-It's ok if it will be long, but it should clearly state what it's doing, without need to dive into code.
-This also applies to function/method's code.
-Try to avoid one letter variables.
-
-## Encapsulation
-
-Don't expose raw data, provide methods to work with it.
-Almost everything in flipper firmware is built around this concept.
-
-# C coding style
-
-- Tab is 4 spaces
-- Use `fbt format` to reformat source code and check style guide before commit
-
-## Naming
-
-### Type names are PascalCase
-
-Examples:
-
-	FuriHalUsb
-	Gui
-	SubGhzKeystore
-
-
-### Functions are snake_case
-
-	furi_hal_usb_init
-	gui_add_view_port
-	subghz_keystore_read
-
-### File and Package name is a prefix for it's content
-
-This rule makes easier to locate types, functions and sources.
-
-For example:
-
-We have abstraction that we call `SubGhz Keystore`, so there will be:
-file `subghz_keystore.h` we have type `SubGhzKeystore` and function `subghz_keystore_read`.
-
-### File names
-
-- Directories: `^[0-9A-Za-z_]+$`
-- File names: `^[0-9A-Za-z_]+\.[a-z]+$`
-- File extensions: `[ ".h", ".c", ".cpp", ".cxx", ".hpp" ]`
-
-Enforced by linter.
-
-### Standard function/method names
-
-Suffixes:
-
-- `alloc` - allocate and init instance. C style constructor. Returns pointer to instance.
-- `free` - de-init and release instance. C style destructor. Takes pointer to instance.
-
-# C++ coding style
-
-Work In Progress. Use C style guide as a base.
-
-# Python coding style
-
-- Tab is 4 spaces
-- Use [black](https://pypi.org/project/black/) to reformat source code before commit

+ 0 - 72
CONTRIBUTING.md

@@ -1,72 +0,0 @@
-# Welcome to FlipperZero contributing guide <!-- omit in toc -->
-
-Thank you for investing your time in contributing to our project! 
-
-Read our [Code of Conduct](CODE_OF_CONDUCT.md) to keep our community approachable and respectable.
-
-In this guide you will get an overview of the contribution workflow from opening an issue, creating a PR, reviewing, and merging the PR.
-
-## New contributor guide
-
-See the [ReadMe](ReadMe.md) to get an overview of the project. Here are some helpful resources to get you comfortable with open source contribution:
-
-- [Finding ways to contribute to open source on GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/finding-ways-to-contribute-to-open-source-on-github)
-- [Set up Git](https://docs.github.com/en/get-started/quickstart/set-up-git)
-- [GitHub flow](https://docs.github.com/en/get-started/quickstart/github-flow)
-- [Collaborating with pull requests](https://docs.github.com/en/github/collaborating-with-pull-requests)
-
-## Getting started
-
-Before writing code and creating PR make sure that it aligns with our mission and guidelines:
-
-- All our devices are intended for research and education.
-- PR that contains code intended to commit crimes is not going to be accepted.
-- Your PR must comply with our [Coding Style](CODING_STYLE.md)
-- Your PR must contain code compatible with project [LICENSE](LICENSE).
-- PR will only be merged if it passes CI/CD.
-- PR will only be merged if it passes review by code owner.
-
-Feel free to ask questions in issues if you're not sure.
-
-### Issues
-
-#### Create a new issue
-
-If you found a problem, [search if an issue already exists](https://docs.github.com/en/github/searching-for-information-on-github/searching-on-github/searching-issues-and-pull-requests#search-by-the-title-body-or-comments). If a related issue doesn't exist, you can open a new issue using a relevant [issue form](https://github.com/flipperdevices/flipperzero-firmware/issues/new/choose). 
-
-#### Solve an issue
-
-Scan through our [existing issues](https://github.com/flipperdevices/flipperzero-firmware/issues) to find one that interests you.
-
-### Make Changes
-
-1. Fork the repository.
-- Using GitHub Desktop:
-  - [Getting started with GitHub Desktop](https://docs.github.com/en/desktop/installing-and-configuring-github-desktop/getting-started-with-github-desktop) will guide you through setting up Desktop.
-  - Once Desktop is set up, you can use it to [fork the repo](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/cloning-and-forking-repositories-from-github-desktop)!
-
-- Using the command line:
-  - [Fork the repo](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#fork-an-example-repository) so that you can make your changes without affecting the original project until you're ready to merge them.
-
-2. Install build requirements
-
-3. Create a working branch and start with your changes!
-
-### Commit your update
-
-Commit the changes once you are happy with them. Make sure that code compilation is not broken and passes tests. Check syntax and formatting.
-
-### Pull Request
-
-When you're done making the changes, open a pull request, often referred to as a PR. 
-- Fill out the "Ready for review" template, so we can review your PR. This template helps reviewers understand your changes and the purpose of your pull request. 
-- Don't forget to [link PR to issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if you are solving one.
-- Enable the checkbox to [allow maintainer edits](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork) so the branch can be updated for a merge.
-Once you submit your PR, a Docs team member will review your proposal. We may ask questions or request for additional information.
-- We may ask for changes to be made before a PR can be merged, either using [suggested changes](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request) or pull request comments. You can apply suggested changes directly through the UI. You can make any other changes in your fork, then commit them to your branch.
-- As you update your PR and apply changes, mark each conversation as [resolved](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#resolving-conversations).
-- If you run into any merge issues, checkout this [git tutorial](https://lab.github.com/githubtraining/managing-merge-conflicts) to help you resolve merge conflicts and other issues.
-
-### Your PR is merged!
-
-Congratulations :tada::tada: The FlipperDevices team thanks you :sparkles:.

+ 0 - 355
SConstruct

@@ -1,355 +0,0 @@
-#
-# Main Flipper Build System entry point
-#
-# This file is evaluated by scons (the build system) every time fbt is invoked.
-# Scons constructs all referenced environments & their targets' dependency
-# trees on startup. So, to keep startup time as low as possible, we're hiding
-# construction of certain targets behind command-line options.
-
-import os
-from fbt.util import path_as_posix
-
-DefaultEnvironment(tools=[])
-
-EnsurePythonVersion(3, 8)
-
-# Progress(["OwO\r", "owo\r", "uwu\r", "owo\r"], interval=15)
-
-# This environment is created only for loading options & validating file/dir existence
-fbt_variables = SConscript("site_scons/commandline.scons")
-cmd_environment = Environment(
-    toolpath=["#/scripts/fbt_tools"],
-    tools=[
-        ("fbt_help", {"vars": fbt_variables}),
-    ],
-    variables=fbt_variables,
-)
-
-# Building basic environment - tools, utility methods, cross-compilation
-# settings, gcc flags for Cortex-M4, basic builders and more
-coreenv = SConscript(
-    "site_scons/environ.scons",
-    exports={"VAR_ENV": cmd_environment},
-    toolpath=["#/scripts/fbt_tools"],
-)
-SConscript("site_scons/cc.scons", exports={"ENV": coreenv})
-
-# Create a separate "dist" environment and add construction envs to it
-distenv = coreenv.Clone(
-    tools=[
-        "fbt_dist",
-        "fbt_debugopts",
-        "openocd",
-        "blackmagic",
-        "jflash",
-    ],
-    ENV=os.environ,
-    UPDATE_BUNDLE_DIR="dist/${DIST_DIR}/f${TARGET_HW}-update-${DIST_SUFFIX}",
-)
-
-firmware_env = distenv.AddFwProject(
-    base_env=coreenv,
-    fw_type="firmware",
-    fw_env_key="FW_ENV",
-)
-
-# If enabled, initialize updater-related targets
-if GetOption("fullenv") or any(
-    filter(lambda target: "updater" in target or "flash_usb" in target, BUILD_TARGETS)
-):
-    updater_env = distenv.AddFwProject(
-        base_env=coreenv,
-        fw_type="updater",
-        fw_env_key="UPD_ENV",
-    )
-
-    # Target for self-update package
-    dist_basic_arguments = [
-        "--bundlever",
-        '"${UPDATE_VERSION_STRING}"',
-    ]
-    dist_radio_arguments = [
-        "--radio",
-        '"${ROOT_DIR.abspath}/${COPRO_STACK_BIN_DIR}/${COPRO_STACK_BIN}"',
-        "--radiotype",
-        "${COPRO_STACK_TYPE}",
-        "${COPRO_DISCLAIMER}",
-        "--obdata",
-        '"${ROOT_DIR.abspath}/${COPRO_OB_DATA}"',
-    ]
-    dist_resource_arguments = [
-        "-r",
-        '"${ROOT_DIR.abspath}/assets/resources"',
-    ]
-    dist_splash_arguments = (
-        [
-            "--splash",
-            distenv.subst("assets/slideshow/$UPDATE_SPLASH"),
-        ]
-        if distenv["UPDATE_SPLASH"]
-        else []
-    )
-
-    selfupdate_dist = distenv.DistCommand(
-        "updater_package",
-        (distenv["DIST_DEPENDS"], firmware_env["FW_RESOURCES"]),
-        DIST_EXTRA=[
-            *dist_basic_arguments,
-            *dist_radio_arguments,
-            *dist_resource_arguments,
-            *dist_splash_arguments,
-        ],
-    )
-
-    selfupdate_min_dist = distenv.DistCommand(
-        "updater_minpackage",
-        distenv["DIST_DEPENDS"],
-        DIST_EXTRA=dist_basic_arguments,
-    )
-
-    # Updater debug
-    distenv.PhonyTarget(
-        "updater_debug",
-        "${GDBPYCOM}",
-        source=updater_env["FW_ELF"],
-        GDBREMOTE="${OPENOCD_GDB_PIPE}",
-    )
-
-    distenv.PhonyTarget(
-        "updater_blackmagic",
-        "${GDBPYCOM}",
-        source=updater_env["FW_ELF"],
-        GDBOPTS=distenv.subst("$GDBOPTS_BLACKMAGIC"),
-        GDBREMOTE="${BLACKMAGIC_ADDR}",
-    )
-
-    # Installation over USB & CLI
-    usb_update_package = distenv.AddUsbFlashTarget(
-        "#build/usbinstall.flag", (firmware_env["FW_RESOURCES"], selfupdate_dist)
-    )
-    distenv.Alias("flash_usb_full", usb_update_package)
-
-    usb_minupdate_package = distenv.AddUsbFlashTarget(
-        "#build/minusbinstall.flag", (selfupdate_min_dist,)
-    )
-    distenv.Alias("flash_usb", usb_minupdate_package)
-
-
-# Target for copying & renaming binaries to dist folder
-basic_dist = distenv.DistCommand("fw_dist", distenv["DIST_DEPENDS"])
-distenv.Default(basic_dist)
-
-dist_dir_name = distenv.GetProjetDirName()
-dist_dir = distenv.Dir(f"#/dist/{dist_dir_name}")
-external_apps_artifacts = firmware_env["FW_EXTAPPS"]
-external_app_list = external_apps_artifacts.application_map.values()
-
-fap_dist = [
-    distenv.Install(
-        dist_dir.Dir("debug_elf"),
-        list(app_artifact.debug for app_artifact in external_app_list),
-    ),
-    *(
-        distenv.Install(
-            dist_dir.File(dist_entry[1]).dir,
-            app_artifact.compact,
-        )
-        for app_artifact in external_app_list
-        for dist_entry in app_artifact.dist_entries
-    ),
-]
-Depends(
-    fap_dist,
-    list(app_artifact.validator for app_artifact in external_app_list),
-)
-Alias("fap_dist", fap_dist)
-# distenv.Default(fap_dist)
-
-distenv.Depends(firmware_env["FW_RESOURCES"], external_apps_artifacts.resources_dist)
-
-# Copy all faps to device
-
-fap_deploy = distenv.PhonyTarget(
-    "fap_deploy",
-    "${PYTHON3} ${ROOT_DIR}/scripts/storage.py send ${SOURCE} /ext/apps",
-    source=Dir("#/assets/resources/apps"),
-)
-
-
-# Target for bundling core2 package for qFlipper
-copro_dist = distenv.CoproBuilder(
-    "#/build/core2_firmware.tgz",
-    [],
-)
-distenv.AlwaysBuild(copro_dist)
-distenv.Alias("copro_dist", copro_dist)
-
-firmware_flash = distenv.AddOpenOCDFlashTarget(firmware_env)
-distenv.Alias("flash", firmware_flash)
-
-firmware_jflash = distenv.AddJFlashTarget(firmware_env)
-distenv.Alias("jflash", firmware_jflash)
-
-firmware_bm_flash = distenv.PhonyTarget(
-    "flash_blackmagic",
-    "$GDB $GDBOPTS $SOURCES $GDBFLASH",
-    source=firmware_env["FW_ELF"],
-    GDBOPTS="${GDBOPTS_BASE} ${GDBOPTS_BLACKMAGIC}",
-    GDBREMOTE="${BLACKMAGIC_ADDR}",
-    GDBFLASH=[
-        "-ex",
-        "load",
-        "-ex",
-        "quit",
-    ],
-)
-
-gdb_backtrace_all_threads = distenv.PhonyTarget(
-    "gdb_trace_all",
-    "$GDB $GDBOPTS $SOURCES $GDBFLASH",
-    source=firmware_env["FW_ELF"],
-    GDBOPTS="${GDBOPTS_BASE}",
-    GDBREMOTE="${OPENOCD_GDB_PIPE}",
-    GDBFLASH=[
-        "-ex",
-        "thread apply all bt",
-        "-ex",
-        "quit",
-    ],
-)
-
-# Debugging firmware
-firmware_debug = distenv.PhonyTarget(
-    "debug",
-    "${GDBPYCOM}",
-    source=firmware_env["FW_ELF"],
-    GDBOPTS="${GDBOPTS_BASE}",
-    GDBREMOTE="${OPENOCD_GDB_PIPE}",
-    FBT_FAP_DEBUG_ELF_ROOT=path_as_posix(firmware_env.subst("$FBT_FAP_DEBUG_ELF_ROOT")),
-)
-distenv.Depends(firmware_debug, firmware_flash)
-
-distenv.PhonyTarget(
-    "blackmagic",
-    "${GDBPYCOM}",
-    source=firmware_env["FW_ELF"],
-    GDBOPTS="${GDBOPTS_BASE} ${GDBOPTS_BLACKMAGIC}",
-    GDBREMOTE="${BLACKMAGIC_ADDR}",
-    FBT_FAP_DEBUG_ELF_ROOT=path_as_posix(firmware_env.subst("$FBT_FAP_DEBUG_ELF_ROOT")),
-)
-
-# Debug alien elf
-debug_other_opts = [
-    "-ex",
-    "source ${FBT_DEBUG_DIR}/PyCortexMDebug/PyCortexMDebug.py",
-    # "-ex",
-    # "source ${FBT_DEBUG_DIR}/FreeRTOS/FreeRTOS.py",
-    "-ex",
-    "source ${FBT_DEBUG_DIR}/flipperversion.py",
-    "-ex",
-    "fw-version",
-]
-
-distenv.PhonyTarget(
-    "debug_other",
-    "${GDBPYCOM}",
-    GDBOPTS="${GDBOPTS_BASE}",
-    GDBREMOTE="${OPENOCD_GDB_PIPE}",
-    GDBPYOPTS=debug_other_opts,
-)
-
-distenv.PhonyTarget(
-    "debug_other_blackmagic",
-    "${GDBPYCOM}",
-    GDBOPTS="${GDBOPTS_BASE}  ${GDBOPTS_BLACKMAGIC}",
-    GDBREMOTE="${BLACKMAGIC_ADDR}",
-    GDBPYOPTS=debug_other_opts,
-)
-
-
-# Just start OpenOCD
-distenv.PhonyTarget(
-    "openocd",
-    "${OPENOCDCOM}",
-)
-
-# Linter
-distenv.PhonyTarget(
-    "lint",
-    "${PYTHON3} ${FBT_SCRIPT_DIR}/lint.py check ${LINT_SOURCES}",
-    LINT_SOURCES=[n.srcnode() for n in firmware_env["LINT_SOURCES"]],
-)
-
-distenv.PhonyTarget(
-    "format",
-    "${PYTHON3} ${FBT_SCRIPT_DIR}/lint.py format ${LINT_SOURCES}",
-    LINT_SOURCES=[n.srcnode() for n in firmware_env["LINT_SOURCES"]],
-)
-
-# PY_LINT_SOURCES contains recursively-built modules' SConscript files + application manifests
-# Here we add additional Python files residing in repo root
-firmware_env.Append(
-    PY_LINT_SOURCES=[
-        # Py code folders
-        "site_scons",
-        "scripts",
-        # Extra files
-        "SConstruct",
-        "firmware.scons",
-        "fbt_options.py",
-    ]
-)
-
-
-black_commandline = "@${PYTHON3} -m black ${PY_BLACK_ARGS} ${PY_LINT_SOURCES}"
-black_base_args = ["--include", '"\\.scons|\\.py|SConscript|SConstruct"']
-
-distenv.PhonyTarget(
-    "lint_py",
-    black_commandline,
-    PY_BLACK_ARGS=[
-        "--check",
-        "--diff",
-        *black_base_args,
-    ],
-    PY_LINT_SOURCES=firmware_env["PY_LINT_SOURCES"],
-)
-
-distenv.PhonyTarget(
-    "format_py",
-    black_commandline,
-    PY_BLACK_ARGS=black_base_args,
-    PY_LINT_SOURCES=firmware_env["PY_LINT_SOURCES"],
-)
-
-# Start Flipper CLI via PySerial's miniterm
-distenv.PhonyTarget("cli", "${PYTHON3} ${FBT_SCRIPT_DIR}/serial_cli.py")
-
-
-# Find blackmagic probe
-distenv.PhonyTarget(
-    "get_blackmagic",
-    "@echo $( ${BLACKMAGIC_ADDR} $)",
-)
-
-
-# Find STLink probe ids
-distenv.PhonyTarget(
-    "get_stlink",
-    distenv.Action(
-        lambda **kw: distenv.GetDevices(),
-        None,
-    ),
-)
-
-# Prepare vscode environment
-vscode_dist = distenv.Install("#.vscode", distenv.Glob("#.vscode/example/*"))
-distenv.Precious(vscode_dist)
-distenv.NoClean(vscode_dist)
-distenv.Alias("vscode_dist", vscode_dist)
-
-# Configure shell with build tools
-distenv.PhonyTarget(
-    "env",
-    "@echo $( ${FBT_SCRIPT_DIR}/toolchain/fbtenv.sh $)",
-)

+ 0 - 0
applications/external/wifi_marauder_companion/application.fam → application.fam


+ 0 - 94
applications/ReadMe.md

@@ -1,94 +0,0 @@
-# Structure
-
-## 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 
-- `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
-
-
-## External
-
-External applications deployed to SD Card
-
-- `clock`               - Clock application
-- `dap_link`            - DAP Link OnChip debugger
-- `hid_app`             - USB/BT Remote controller
-- `music_player`        - Music player app (demo)
-- `nfc_magic`           - NFC MFC Magic card application
-- `picopass`            - Picopass reader / writer
-- `signal_generator`    - Signal generator app: PWM and clock generator
-- `snake_game`          - Snake game application
-- `spi_mem_manager`     - SPI Memory reader / flasher
-- `weather_station`     - SubGHz weather station
-
-## services
-
-Background services providing system APIs to applications.
-
-- `applications.h`      - Firmware application list header
-
-- `bt`                  - BLE service and application
-- `cli`                 - Console service and API
-- `crypto`              - Crypto cli tools
-- `desktop`             - Desktop service
-- `dialogs`             - Dialogs service: GUI Dialogs for your app
-- `dolphin`             - Dolphin service and supplementary apps
-- `gui`                 - GUI service and API
-- `input`               - Input service
-- `loader`              - Application loader service
-- `notification`        - Notification service 
-- `power`               - Power service
-- `rpc`                 - RPC service and API
-- `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
-- `system`              - System settings
-
-
-## system
-
-Utility apps not visible in other menus.
-
-- `storage_move_to_sd`  - Data migration tool for internal storage
-- `updater`             - Update service & application

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

@@ -1,11 +0,0 @@
-#include "accessor_app.h"
-
-// app enter function
-extern "C" int32_t accessor_app(void* p) {
-    UNUSED(p);
-    AccessorApp* app = new AccessorApp();
-    app->run();
-    delete app;
-
-    return 255;
-}

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

@@ -1,141 +0,0 @@
-#include "accessor_app.h"
-#include <furi.h>
-#include <furi_hal.h>
-#include <stdarg.h>
-
-void AccessorApp::run(void) {
-    AccessorEvent event;
-    bool consumed;
-    bool exit = false;
-
-    wiegand.begin();
-    onewire_host_start(onewire_host);
-
-    scenes[current_scene]->on_enter(this);
-
-    while(!exit) {
-        view.receive_event(&event);
-
-        consumed = scenes[current_scene]->on_event(this, &event);
-
-        if(!consumed) {
-            if(event.type == AccessorEvent::Type::Back) {
-                exit = switch_to_previous_scene();
-            }
-        }
-    };
-
-    scenes[current_scene]->on_exit(this);
-
-    wiegand.end();
-    onewire_host_stop(onewire_host);
-}
-
-AccessorApp::AccessorApp()
-    : text_store{0} {
-    notification = static_cast<NotificationApp*>(furi_record_open(RECORD_NOTIFICATION));
-    onewire_host = onewire_host_alloc(&gpio_ibutton);
-    furi_hal_power_enable_otg();
-}
-
-AccessorApp::~AccessorApp() {
-    furi_hal_power_disable_otg();
-    furi_record_close(RECORD_NOTIFICATION);
-    onewire_host_free(onewire_host);
-}
-
-AccessorAppViewManager* AccessorApp::get_view_manager() {
-    return &view;
-}
-
-void AccessorApp::switch_to_next_scene(Scene next_scene) {
-    previous_scenes_list.push_front(current_scene);
-
-    if(next_scene != Scene::Exit) {
-        scenes[current_scene]->on_exit(this);
-        current_scene = next_scene;
-        scenes[current_scene]->on_enter(this);
-    }
-}
-
-void AccessorApp::search_and_switch_to_previous_scene(std::initializer_list<Scene> scenes_list) {
-    Scene previous_scene = Scene::Start;
-    bool scene_found = false;
-
-    while(!scene_found) {
-        previous_scene = get_previous_scene();
-        for(Scene element : scenes_list) {
-            if(previous_scene == element || previous_scene == Scene::Start) {
-                scene_found = true;
-                break;
-            }
-        }
-    }
-
-    scenes[current_scene]->on_exit(this);
-    current_scene = previous_scene;
-    scenes[current_scene]->on_enter(this);
-}
-
-bool AccessorApp::switch_to_previous_scene(uint8_t count) {
-    Scene previous_scene = Scene::Start;
-
-    for(uint8_t i = 0; i < count; i++) {
-        previous_scene = get_previous_scene();
-        if(previous_scene == Scene::Exit) break;
-    }
-
-    if(previous_scene == Scene::Exit) {
-        return true;
-    } else {
-        scenes[current_scene]->on_exit(this);
-        current_scene = previous_scene;
-        scenes[current_scene]->on_enter(this);
-        return false;
-    }
-}
-
-AccessorApp::Scene AccessorApp::get_previous_scene() {
-    Scene scene = previous_scenes_list.front();
-    previous_scenes_list.pop_front();
-    return scene;
-}
-
-/***************************** NOTIFY *******************************/
-
-void AccessorApp::notify_green_blink() {
-    notification_message(notification, &sequence_blink_green_10);
-}
-
-void AccessorApp::notify_success() {
-    notification_message(notification, &sequence_success);
-}
-
-/*************************** TEXT STORE *****************************/
-
-char* AccessorApp::get_text_store() {
-    return text_store;
-}
-
-uint8_t AccessorApp::get_text_store_size() {
-    return text_store_size;
-}
-
-void AccessorApp::set_text_store(const char* text...) {
-    va_list args;
-    va_start(args, text);
-
-    vsnprintf(text_store, text_store_size, text, args);
-
-    va_end(args);
-}
-
-/*************************** APP RESOURCES *****************************/
-
-WIEGAND* AccessorApp::get_wiegand() {
-    return &wiegand;
-}
-
-OneWireHost* AccessorApp::get_one_wire() {
-    return onewire_host;
-}

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

@@ -1,54 +0,0 @@
-#pragma once
-#include <map>
-#include <list>
-#include "accessor_view_manager.h"
-#include "scene/accessor_scene_start.h"
-#include "helpers/wiegand.h"
-#include <one_wire/one_wire_host.h>
-#include <notification/notification_messages.h>
-
-class AccessorApp {
-public:
-    void run(void);
-
-    AccessorApp();
-    ~AccessorApp();
-
-    enum class Scene : uint8_t {
-        Exit,
-        Start,
-    };
-
-    AccessorAppViewManager* get_view_manager();
-    void switch_to_next_scene(Scene index);
-    void search_and_switch_to_previous_scene(std::initializer_list<Scene> scenes_list);
-    bool switch_to_previous_scene(uint8_t count = 1);
-    Scene get_previous_scene();
-
-    void notify_green_blink();
-    void notify_success();
-
-    char* get_text_store();
-    uint8_t get_text_store_size();
-    void set_text_store(const char* text...);
-
-    WIEGAND* get_wiegand();
-    OneWireHost* get_one_wire();
-
-private:
-    std::list<Scene> previous_scenes_list = {Scene::Exit};
-    Scene current_scene = Scene::Start;
-    AccessorAppViewManager view;
-
-    std::map<Scene, AccessorScene*> scenes = {
-        {Scene::Start, new AccessorSceneStart()},
-    };
-
-    static const uint8_t text_store_size = 128;
-    char text_store[text_store_size + 1];
-
-    WIEGAND wiegand;
-    OneWireHost* onewire_host;
-
-    NotificationApp* notification;
-};

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

@@ -1,19 +0,0 @@
-#pragma once
-#include <stdint.h>
-
-class AccessorEvent {
-public:
-    // events enum
-    enum class Type : uint8_t {
-        Tick,
-        Back,
-    };
-
-    // payload
-    union {
-        uint32_t menu_index;
-    } payload;
-
-    // event type
-    Type type;
-};

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

@@ -1,80 +0,0 @@
-#include "accessor_view_manager.h"
-#include "accessor_event.h"
-#include <callback-connector.h>
-
-AccessorAppViewManager::AccessorAppViewManager() {
-    event_queue = furi_message_queue_alloc(10, sizeof(AccessorEvent));
-
-    view_dispatcher = view_dispatcher_alloc();
-    auto callback = cbc::obtain_connector(this, &AccessorAppViewManager::previous_view_callback);
-
-    // allocate views
-    submenu = submenu_alloc();
-    add_view(ViewType::Submenu, submenu_get_view(submenu));
-
-    popup = popup_alloc();
-    add_view(ViewType::Popup, popup_get_view(popup));
-
-    gui = static_cast<Gui*>(furi_record_open(RECORD_GUI));
-    view_dispatcher_attach_to_gui(view_dispatcher, gui, ViewDispatcherTypeFullscreen);
-
-    // set previous view callback for all views
-    view_set_previous_callback(submenu_get_view(submenu), callback);
-    view_set_previous_callback(popup_get_view(popup), callback);
-}
-
-AccessorAppViewManager::~AccessorAppViewManager() {
-    // remove views
-    view_dispatcher_remove_view(
-        view_dispatcher, static_cast<uint32_t>(AccessorAppViewManager::ViewType::Submenu));
-    view_dispatcher_remove_view(
-        view_dispatcher, static_cast<uint32_t>(AccessorAppViewManager::ViewType::Popup));
-
-    // free view modules
-    furi_record_close(RECORD_GUI);
-    submenu_free(submenu);
-    popup_free(popup);
-
-    // free dispatcher
-    view_dispatcher_free(view_dispatcher);
-
-    // free event queue
-    furi_message_queue_free(event_queue);
-}
-
-void AccessorAppViewManager::switch_to(ViewType type) {
-    view_dispatcher_switch_to_view(view_dispatcher, static_cast<uint32_t>(type));
-}
-
-Submenu* AccessorAppViewManager::get_submenu() {
-    return submenu;
-}
-
-Popup* AccessorAppViewManager::get_popup() {
-    return popup;
-}
-
-void AccessorAppViewManager::receive_event(AccessorEvent* event) {
-    if(furi_message_queue_get(event_queue, event, 100) != FuriStatusOk) {
-        event->type = AccessorEvent::Type::Tick;
-    }
-}
-
-void AccessorAppViewManager::send_event(AccessorEvent* event) {
-    FuriStatus result = furi_message_queue_put(event_queue, event, 0);
-    furi_check(result == FuriStatusOk);
-}
-
-uint32_t AccessorAppViewManager::previous_view_callback(void*) {
-    if(event_queue != NULL) {
-        AccessorEvent event;
-        event.type = AccessorEvent::Type::Back;
-        send_event(&event);
-    }
-
-    return VIEW_IGNORE;
-}
-
-void AccessorAppViewManager::add_view(ViewType view_type, View* view) {
-    view_dispatcher_add_view(view_dispatcher, static_cast<uint32_t>(view_type), view);
-}

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

@@ -1,39 +0,0 @@
-#pragma once
-#include <furi.h>
-#include <gui/view_dispatcher.h>
-#include <gui/modules/submenu.h>
-#include <gui/modules/popup.h>
-#include "accessor_event.h"
-
-class AccessorAppViewManager {
-public:
-    enum class ViewType : uint8_t {
-        Submenu,
-        Popup,
-        Tune,
-    };
-
-    FuriMessageQueue* event_queue;
-
-    AccessorAppViewManager();
-    ~AccessorAppViewManager();
-
-    void switch_to(ViewType type);
-
-    void receive_event(AccessorEvent* event);
-    void send_event(AccessorEvent* event);
-
-    Submenu* get_submenu();
-    Popup* get_popup();
-
-private:
-    ViewDispatcher* view_dispatcher;
-    Gui* gui;
-
-    uint32_t previous_view_callback(void* context);
-    void add_view(ViewType view_type, View* view);
-
-    // view elements
-    Submenu* submenu;
-    Popup* popup;
-};

+ 0 - 12
applications/debug/accessor/application.fam

@@ -1,12 +0,0 @@
-App(
-    appid="accessor",
-    name="Accessor",
-    apptype=FlipperAppType.DEBUG,
-    targets=["f7"],
-    entry_point="accessor_app",
-    cdefines=["APP_ACCESSOR"],
-    requires=["gui"],
-    stack_size=4 * 1024,
-    order=40,
-    fap_category="Debug",
-)

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

@@ -1,221 +0,0 @@
-#include "wiegand.h"
-#include <furi.h>
-#include <furi_hal.h>
-
-volatile unsigned long WIEGAND::_cardTempHigh = 0;
-volatile unsigned long WIEGAND::_cardTemp = 0;
-volatile unsigned long WIEGAND::_lastWiegand = 0;
-unsigned long WIEGAND::_code = 0;
-unsigned long WIEGAND::_codeHigh = 0;
-volatile int WIEGAND::_bitCount = 0;
-int WIEGAND::_wiegandType = 0;
-
-constexpr uint32_t clocks_in_ms = 64 * 1000;
-const GpioPin* const pinD0 = &gpio_ext_pa4;
-const GpioPin* const pinD1 = &gpio_ext_pa7;
-
-WIEGAND::WIEGAND() {
-}
-
-unsigned long WIEGAND::getCode() {
-    return _code;
-}
-
-unsigned long WIEGAND::getCodeHigh() {
-    return _codeHigh;
-}
-
-int WIEGAND::getWiegandType() {
-    return _wiegandType;
-}
-
-bool WIEGAND::available() {
-    bool ret;
-    FURI_CRITICAL_ENTER();
-    ret = DoWiegandConversion();
-    FURI_CRITICAL_EXIT();
-    return ret;
-}
-
-static void input_isr_d0(void* _ctx) {
-    WIEGAND* _this = static_cast<WIEGAND*>(_ctx);
-    _this->ReadD0();
-}
-
-static void input_isr_d1(void* _ctx) {
-    WIEGAND* _this = static_cast<WIEGAND*>(_ctx);
-    _this->ReadD1();
-}
-
-void WIEGAND::begin() {
-    _lastWiegand = 0;
-    _cardTempHigh = 0;
-    _cardTemp = 0;
-    _code = 0;
-    _wiegandType = 0;
-    _bitCount = 0;
-
-    furi_hal_gpio_init_simple(pinD0, GpioModeInterruptFall); // Set D0 pin as input
-    furi_hal_gpio_init_simple(pinD1, GpioModeInterruptFall); // Set D1 pin as input
-
-    furi_hal_gpio_add_int_callback(pinD0, input_isr_d0, this);
-    furi_hal_gpio_add_int_callback(pinD1, input_isr_d1, this);
-}
-
-void WIEGAND::end() {
-    furi_hal_gpio_remove_int_callback(pinD0);
-    furi_hal_gpio_remove_int_callback(pinD1);
-
-    furi_hal_gpio_init_simple(pinD0, GpioModeAnalog);
-    furi_hal_gpio_init_simple(pinD1, GpioModeAnalog);
-}
-
-void WIEGAND::ReadD0() {
-    _bitCount++; // Increment bit count for Interrupt connected to D0
-    if(_bitCount > 31) // If bit count more than 31, process high bits
-    {
-        _cardTempHigh |= ((0x80000000 & _cardTemp) >> 31); //	shift value to high bits
-        _cardTempHigh <<= 1;
-        _cardTemp <<= 1;
-    } else {
-        _cardTemp <<= 1; // D0 represent binary 0, so just left shift card data
-    }
-    _lastWiegand = DWT->CYCCNT; // Keep track of last wiegand bit received
-}
-
-void WIEGAND::ReadD1() {
-    _bitCount++; // Increment bit count for Interrupt connected to D1
-    if(_bitCount > 31) // If bit count more than 31, process high bits
-    {
-        _cardTempHigh |= ((0x80000000 & _cardTemp) >> 31); // shift value to high bits
-        _cardTempHigh <<= 1;
-        _cardTemp |= 1;
-        _cardTemp <<= 1;
-    } else {
-        _cardTemp |= 1; // D1 represent binary 1, so OR card data with 1 then
-        _cardTemp <<= 1; // left shift card data
-    }
-    _lastWiegand = DWT->CYCCNT; // Keep track of last wiegand bit received
-}
-
-unsigned long WIEGAND::GetCardId(
-    volatile unsigned long* codehigh,
-    volatile unsigned long* codelow,
-    char bitlength) {
-    if(bitlength == 26) // EM tag
-        return (*codelow & 0x1FFFFFE) >> 1;
-
-    if(bitlength == 24) return (*codelow & 0x7FFFFE) >> 1;
-
-    if(bitlength == 34) // Mifare
-    {
-        *codehigh = *codehigh & 0x03; // only need the 2 LSB of the codehigh
-        *codehigh <<= 30; // shift 2 LSB to MSB
-        *codelow >>= 1;
-        return *codehigh | *codelow;
-    }
-
-    if(bitlength == 32) {
-        return (*codelow & 0x7FFFFFFE) >> 1;
-    }
-
-    return *codelow; // EM tag or Mifare without parity bits
-}
-
-char translateEnterEscapeKeyPress(char originalKeyPress) {
-    switch(originalKeyPress) {
-    case 0x0b: // 11 or * key
-        return 0x0d; // 13 or ASCII ENTER
-
-    case 0x0a: // 10 or # key
-        return 0x1b; // 27 or ASCII ESCAPE
-
-    default:
-        return originalKeyPress;
-    }
-}
-
-bool WIEGAND::DoWiegandConversion() {
-    unsigned long cardID;
-    unsigned long sysTick = DWT->CYCCNT;
-
-    if((sysTick - _lastWiegand) >
-       (25 * clocks_in_ms)) // if no more signal coming through after 25ms
-    {
-        if((_bitCount == 24) || (_bitCount == 26) || (_bitCount == 32) || (_bitCount == 34) ||
-           (_bitCount == 37) || (_bitCount == 40) || (_bitCount == 8) ||
-           (_bitCount ==
-            4)) // bitCount for keypress=4 or 8, Wiegand 26=24 or 26, Wiegand 34=32 or 34
-        {
-            _codeHigh = 0;
-            // shift right 1 bit to get back the real value - interrupt done 1 left shift in advance
-            _cardTemp >>= 1;
-            // bit count more than 32 bits, shift high bits right to make adjustment
-            if(_bitCount > 32) _cardTempHigh >>= 1;
-
-            if(_bitCount == 8) // keypress wiegand with integrity
-            {
-                // 8-bit Wiegand keyboard data, high nibble is the "NOT" of low nibble
-                // eg if key 1 pressed, data=E1 in binary 11100001 , high nibble=1110 , low nibble = 0001
-                char highNibble = (_cardTemp & 0xf0) >> 4;
-                char lowNibble = (_cardTemp & 0x0f);
-                _wiegandType = _bitCount;
-                _bitCount = 0;
-                _cardTemp = 0;
-                _cardTempHigh = 0;
-
-                if(lowNibble ==
-                   (~highNibble & 0x0f)) // check if low nibble matches the "NOT" of high nibble.
-                {
-                    _code = (int)translateEnterEscapeKeyPress(lowNibble);
-                    return true;
-                } else {
-                    _lastWiegand = sysTick;
-                    return false;
-                }
-
-                // TODO: Handle validation failure case!
-            } else if(4 == _bitCount) {
-                // 4-bit Wiegand codes have no data integrity check so we just
-                // read the LOW nibble.
-                _code = (int)translateEnterEscapeKeyPress(_cardTemp & 0x0000000F);
-
-                _wiegandType = _bitCount;
-                _bitCount = 0;
-                _cardTemp = 0;
-                _cardTempHigh = 0;
-
-                return true;
-            } else if(40 == _bitCount) {
-                _cardTempHigh >>= 1;
-
-                _code = _cardTemp;
-                _codeHigh = _cardTempHigh;
-
-                _wiegandType = _bitCount;
-                _bitCount = 0;
-                _cardTemp = 0;
-                _cardTempHigh = 0;
-
-                return true;
-            } else {
-                // wiegand 26 or wiegand 34
-                cardID = GetCardId(&_cardTempHigh, &_cardTemp, _bitCount);
-                _wiegandType = _bitCount;
-                _bitCount = 0;
-                _cardTemp = 0;
-                _cardTempHigh = 0;
-                _code = cardID;
-                return true;
-            }
-        } else {
-            // well time over 25 ms and bitCount !=8 , !=26, !=34 , must be noise or nothing then.
-            _lastWiegand = sysTick;
-            _bitCount = 0;
-            _cardTemp = 0;
-            _cardTempHigh = 0;
-            return false;
-        }
-    } else
-        return false;
-}

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

@@ -1,30 +0,0 @@
-#pragma once
-
-class WIEGAND {
-public:
-    WIEGAND();
-    void begin();
-    void end();
-    bool available();
-    unsigned long getCode();
-    unsigned long getCodeHigh();
-    int getWiegandType();
-
-    static void ReadD0();
-    static void ReadD1();
-
-private:
-    static bool DoWiegandConversion();
-    static unsigned long GetCardId(
-        volatile unsigned long* codehigh,
-        volatile unsigned long* codelow,
-        char bitlength);
-
-    static volatile unsigned long _cardTempHigh;
-    static volatile unsigned long _cardTemp;
-    static volatile unsigned long _lastWiegand;
-    static volatile int _bitCount;
-    static int _wiegandType;
-    static unsigned long _code;
-    static unsigned long _codeHigh;
-};

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

@@ -1,13 +0,0 @@
-#pragma once
-#include "../accessor_app.h"
-
-class AccessorApp;
-
-class AccessorScene {
-public:
-    virtual void on_enter(AccessorApp* app) = 0;
-    virtual bool on_event(AccessorApp* app, AccessorEvent* event) = 0;
-    virtual void on_exit(AccessorApp* app) = 0;
-
-private:
-};

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

@@ -1,88 +0,0 @@
-#include "../accessor_app.h"
-#include "../accessor_view_manager.h"
-#include "../accessor_event.h"
-#include <callback-connector.h>
-#include "accessor_scene_start.h"
-
-void AccessorSceneStart::on_enter(AccessorApp* app) {
-    AccessorAppViewManager* view_manager = app->get_view_manager();
-    Popup* popup = view_manager->get_popup();
-
-    popup_set_header(popup, "Accessor App", 64, 16, AlignCenter, AlignBottom);
-    app->set_text_store("[??????]");
-    popup_set_text(popup, app->get_text_store(), 64, 22, AlignCenter, AlignTop);
-
-    view_manager->switch_to(AccessorAppViewManager::ViewType::Popup);
-}
-
-bool AccessorSceneStart::on_event(AccessorApp* app, AccessorEvent* event) {
-    bool consumed = false;
-
-    if(event->type == AccessorEvent::Type::Tick) {
-        WIEGAND* wiegand = app->get_wiegand();
-        Popup* popup = app->get_view_manager()->get_popup();
-        OneWireHost* onewire_host = app->get_one_wire();
-
-        uint8_t data[8] = {0, 0, 0, 0, 0, 0, 0, 0};
-        uint8_t type = 0;
-
-        if(wiegand->available()) {
-            type = wiegand->getWiegandType();
-
-            for(uint8_t i = 0; i < 4; i++) {
-                data[i] = wiegand->getCode() >> (i * 8);
-            }
-
-            for(uint8_t i = 4; i < 8; i++) {
-                data[i] = wiegand->getCodeHigh() >> ((i - 4) * 8);
-            }
-        } else {
-            FURI_CRITICAL_ENTER();
-            if(onewire_host_reset(onewire_host)) {
-                type = 255;
-                onewire_host_write(onewire_host, 0x33);
-                for(uint8_t i = 0; i < 8; i++) {
-                    data[i] = onewire_host_read(onewire_host);
-                }
-
-                for(uint8_t i = 0; i < 7; i++) {
-                    data[i] = data[i + 1];
-                }
-            }
-            FURI_CRITICAL_EXIT();
-        }
-
-        if(type > 0) {
-            if(type == 255) {
-                app->set_text_store(
-                    "[%02X %02X %02X %02X %02X %02X DS]",
-                    data[5],
-                    data[4],
-                    data[3],
-                    data[2],
-                    data[1],
-                    data[0]);
-            } else {
-                app->set_text_store(
-                    "[%02X %02X %02X %02X %02X %02X W%u]",
-                    data[5],
-                    data[4],
-                    data[3],
-                    data[2],
-                    data[1],
-                    data[0],
-                    type);
-            }
-            popup_set_text(popup, app->get_text_store(), 64, 22, AlignCenter, AlignTop);
-            app->notify_success();
-        }
-    }
-
-    return consumed;
-}
-
-void AccessorSceneStart::on_exit(AccessorApp* app) {
-    Popup* popup = app->get_view_manager()->get_popup();
-    popup_set_header(popup, NULL, 0, 0, AlignCenter, AlignBottom);
-    popup_set_text(popup, NULL, 0, 0, AlignCenter, AlignTop);
-}

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

@@ -1,9 +0,0 @@
-#pragma once
-#include "accessor_scene_generic.h"
-
-class AccessorSceneStart : public AccessorScene {
-public:
-    void on_enter(AccessorApp* app) final;
-    bool on_event(AccessorApp* app, AccessorEvent* event) final;
-    void on_exit(AccessorApp* app) final;
-};

+ 0 - 16
applications/debug/application.fam

@@ -1,16 +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",
-    ],
-)

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

@@ -1,15 +0,0 @@
-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",
-    fap_libs=["assets"],
-)

+ 0 - 101
applications/debug/battery_test_app/battery_test_app.c

@@ -1,101 +0,0 @@
-#include "battery_test_app.h"
-
-#include <notification/notification_messages.h>
-
-void battery_test_dialog_callback(DialogExResult result, void* context) {
-    furi_assert(context);
-    BatteryTestApp* app = context;
-    if(result == DialogExResultLeft) {
-        view_dispatcher_stop(app->view_dispatcher);
-    } else if(result == DialogExResultRight) {
-        view_dispatcher_switch_to_view(app->view_dispatcher, BatteryTestAppViewBatteryInfo);
-    }
-}
-
-uint32_t battery_test_exit_confirm_view() {
-    return BatteryTestAppViewExitDialog;
-}
-
-static void battery_test_battery_info_update_model(void* context) {
-    BatteryTestApp* app = context;
-    power_get_info(app->power, &app->info);
-    BatteryInfoModel battery_info_data = {
-        .vbus_voltage = app->info.voltage_vbus,
-        .gauge_voltage = app->info.voltage_gauge,
-        .gauge_current = app->info.current_gauge,
-        .gauge_temperature = app->info.temperature_gauge,
-        .charge = app->info.charge,
-        .health = app->info.health,
-    };
-    battery_info_set_data(app->battery_info, &battery_info_data);
-    notification_message(app->notifications, &sequence_display_backlight_on);
-}
-
-BatteryTestApp* battery_test_alloc() {
-    BatteryTestApp* app = malloc(sizeof(BatteryTestApp));
-
-    // Records
-    app->gui = furi_record_open(RECORD_GUI);
-    app->power = furi_record_open(RECORD_POWER);
-    app->notifications = furi_record_open(RECORD_NOTIFICATION);
-
-    // View dispatcher
-    app->view_dispatcher = view_dispatcher_alloc();
-    view_dispatcher_enable_queue(app->view_dispatcher);
-    view_dispatcher_set_event_callback_context(app->view_dispatcher, app);
-    view_dispatcher_set_tick_event_callback(
-        app->view_dispatcher, battery_test_battery_info_update_model, 500);
-    view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
-
-    // Views
-    app->battery_info = battery_info_alloc();
-    view_set_previous_callback(
-        battery_info_get_view(app->battery_info), battery_test_exit_confirm_view);
-    view_dispatcher_add_view(
-        app->view_dispatcher,
-        BatteryTestAppViewBatteryInfo,
-        battery_info_get_view(app->battery_info));
-
-    app->dialog = dialog_ex_alloc();
-    dialog_ex_set_header(app->dialog, "Close Battery Test?", 64, 12, AlignCenter, AlignTop);
-    dialog_ex_set_left_button_text(app->dialog, "Exit");
-    dialog_ex_set_right_button_text(app->dialog, "Stay");
-    dialog_ex_set_result_callback(app->dialog, battery_test_dialog_callback);
-    dialog_ex_set_context(app->dialog, app);
-
-    view_dispatcher_add_view(
-        app->view_dispatcher, BatteryTestAppViewExitDialog, dialog_ex_get_view(app->dialog));
-
-    battery_test_battery_info_update_model(app);
-    view_dispatcher_switch_to_view(app->view_dispatcher, BatteryTestAppViewBatteryInfo);
-    return app;
-}
-
-void battery_test_free(BatteryTestApp* app) {
-    furi_assert(app);
-
-    // Views
-    view_dispatcher_remove_view(app->view_dispatcher, BatteryTestAppViewBatteryInfo);
-    battery_info_free(app->battery_info);
-    view_dispatcher_remove_view(app->view_dispatcher, BatteryTestAppViewExitDialog);
-    dialog_ex_free(app->dialog);
-    // View dispatcher
-    view_dispatcher_free(app->view_dispatcher);
-    // Records
-    furi_record_close(RECORD_POWER);
-    furi_record_close(RECORD_GUI);
-    furi_record_close(RECORD_NOTIFICATION);
-    free(app);
-}
-
-int32_t battery_test_app(void* p) {
-    UNUSED(p);
-    BatteryTestApp* app = battery_test_alloc();
-    // Disable battery low level notification
-    power_enable_low_battery_level_notification(app->power, false);
-
-    view_dispatcher_run(app->view_dispatcher);
-    power_enable_low_battery_level_notification(app->power, true);
-    battery_test_free(app);
-    return 0;
-}

+ 0 - 25
applications/debug/battery_test_app/battery_test_app.h

@@ -1,25 +0,0 @@
-#include <furi.h>
-#include <power/power_service/power.h>
-#include <gui/gui.h>
-#include <gui/view.h>
-#include <gui/view_dispatcher.h>
-#include <notification/notification.h>
-
-#include <gui/modules/dialog_ex.h>
-// FIXME
-#include "../settings/power_settings_app/views/battery_info.h"
-
-typedef struct {
-    Power* power;
-    Gui* gui;
-    NotificationApp* notifications;
-    ViewDispatcher* view_dispatcher;
-    BatteryInfo* battery_info;
-    DialogEx* dialog;
-    PowerInfo info;
-} BatteryTestApp;
-
-typedef enum {
-    BatteryTestAppViewBatteryInfo,
-    BatteryTestAppViewExitDialog,
-} BatteryTestAppView;

+ 0 - 148
applications/debug/battery_test_app/views/battery_info.c

@@ -1,148 +0,0 @@
-#include "battery_info.h"
-#include <furi.h>
-#include <gui/elements.h>
-#include <assets_icons.h>
-
-#define LOW_CHARGE_THRESHOLD 10
-#define HIGH_DRAIN_CURRENT_THRESHOLD 100
-
-struct BatteryInfo {
-    View* view;
-};
-
-static void draw_stat(Canvas* canvas, int x, int y, const Icon* icon, char* val) {
-    canvas_draw_frame(canvas, x - 7, y + 7, 30, 13);
-    canvas_draw_icon(canvas, x, y, icon);
-    canvas_set_color(canvas, ColorWhite);
-    canvas_draw_box(canvas, x - 4, y + 16, 24, 6);
-    canvas_set_color(canvas, ColorBlack);
-    canvas_draw_str_aligned(canvas, x + 8, y + 22, AlignCenter, AlignBottom, val);
-};
-
-static void draw_battery(Canvas* canvas, BatteryInfoModel* data, int x, int y) {
-    char emote[20] = {};
-    char header[20] = {};
-    char value[20] = {};
-
-    int32_t drain_current = data->gauge_current * (-1000);
-    uint32_t charge_current = data->gauge_current * 1000;
-
-    // Draw battery
-    canvas_draw_icon(canvas, x, y, &I_BatteryBody_52x28);
-    if(charge_current > 0) {
-        canvas_draw_icon(canvas, x + 16, y + 7, &I_FaceCharging_29x14);
-    } else if(drain_current > HIGH_DRAIN_CURRENT_THRESHOLD) {
-        canvas_draw_icon(canvas, x + 16, y + 7, &I_FaceConfused_29x14);
-    } else if(data->charge < LOW_CHARGE_THRESHOLD) {
-        canvas_draw_icon(canvas, x + 16, y + 7, &I_FaceNopower_29x14);
-    } else {
-        canvas_draw_icon(canvas, x + 16, y + 7, &I_FaceNormal_29x14);
-    }
-
-    // Draw bubble
-    elements_bubble(canvas, 53, 0, 71, 39);
-
-    // Set text
-    if(charge_current > 0) {
-        snprintf(emote, sizeof(emote), "%s", "Yummy!");
-        snprintf(header, sizeof(header), "%s", "Charging at");
-        snprintf(
-            value,
-            sizeof(value),
-            "%lu.%luV   %lumA",
-            (uint32_t)(data->vbus_voltage),
-            (uint32_t)(data->vbus_voltage * 10) % 10,
-            charge_current);
-    } else if(drain_current > 0) {
-        snprintf(
-            emote,
-            sizeof(emote),
-            "%s",
-            drain_current > HIGH_DRAIN_CURRENT_THRESHOLD ? "Oh no!" : "Om-nom-nom!");
-        snprintf(header, sizeof(header), "%s", "Consumption is");
-        snprintf(
-            value,
-            sizeof(value),
-            "%ld %s",
-            drain_current,
-            drain_current > HIGH_DRAIN_CURRENT_THRESHOLD ? "mA!" : "mA");
-    } else if(drain_current != 0) {
-        snprintf(header, 20, "...");
-    } else if(data->charging_voltage < 4.2) {
-        // Non-default battery charging limit, mention it
-        snprintf(emote, sizeof(emote), "Charged!");
-        snprintf(header, sizeof(header), "Limited to");
-        snprintf(
-            value,
-            sizeof(value),
-            "%lu.%luV",
-            (uint32_t)(data->charging_voltage),
-            (uint32_t)(data->charging_voltage * 10) % 10);
-    } else {
-        snprintf(header, sizeof(header), "Charged!");
-    }
-
-    canvas_draw_str_aligned(canvas, 92, y + 3, AlignCenter, AlignCenter, emote);
-    canvas_draw_str_aligned(canvas, 92, y + 15, AlignCenter, AlignCenter, header);
-    canvas_draw_str_aligned(canvas, 92, y + 27, AlignCenter, AlignCenter, value);
-};
-
-static void battery_info_draw_callback(Canvas* canvas, void* context) {
-    furi_assert(context);
-    BatteryInfoModel* model = context;
-
-    canvas_clear(canvas);
-    canvas_set_color(canvas, ColorBlack);
-    draw_battery(canvas, model, 0, 5);
-
-    char batt_level[10];
-    char temperature[10];
-    char voltage[10];
-    char health[10];
-
-    snprintf(batt_level, sizeof(batt_level), "%lu%%", (uint32_t)model->charge);
-    snprintf(temperature, sizeof(temperature), "%lu C", (uint32_t)model->gauge_temperature);
-    snprintf(
-        voltage,
-        sizeof(voltage),
-        "%lu.%01lu V",
-        (uint32_t)model->gauge_voltage,
-        (uint32_t)(model->gauge_voltage * 10) % 10UL);
-    snprintf(health, sizeof(health), "%d%%", model->health);
-
-    draw_stat(canvas, 8, 42, &I_Battery_16x16, batt_level);
-    draw_stat(canvas, 40, 42, &I_Temperature_16x16, temperature);
-    draw_stat(canvas, 72, 42, &I_Voltage_16x16, voltage);
-    draw_stat(canvas, 104, 42, &I_Health_16x16, health);
-}
-
-BatteryInfo* battery_info_alloc() {
-    BatteryInfo* battery_info = malloc(sizeof(BatteryInfo));
-    battery_info->view = view_alloc();
-    view_set_context(battery_info->view, battery_info);
-    view_allocate_model(battery_info->view, ViewModelTypeLocking, sizeof(BatteryInfoModel));
-    view_set_draw_callback(battery_info->view, battery_info_draw_callback);
-
-    return battery_info;
-}
-
-void battery_info_free(BatteryInfo* battery_info) {
-    furi_assert(battery_info);
-    view_free(battery_info->view);
-    free(battery_info);
-}
-
-View* battery_info_get_view(BatteryInfo* battery_info) {
-    furi_assert(battery_info);
-    return battery_info->view;
-}
-
-void battery_info_set_data(BatteryInfo* battery_info, BatteryInfoModel* data) {
-    furi_assert(battery_info);
-    furi_assert(data);
-    with_view_model(
-        battery_info->view,
-        BatteryInfoModel * model,
-        { memcpy(model, data, sizeof(BatteryInfoModel)); },
-        true);
-}

+ 0 - 23
applications/debug/battery_test_app/views/battery_info.h

@@ -1,23 +0,0 @@
-#pragma once
-
-#include <gui/view.h>
-
-typedef struct BatteryInfo BatteryInfo;
-
-typedef struct {
-    float vbus_voltage;
-    float gauge_voltage;
-    float gauge_current;
-    float gauge_temperature;
-    float charging_voltage;
-    uint8_t charge;
-    uint8_t health;
-} BatteryInfoModel;
-
-BatteryInfo* battery_info_alloc();
-
-void battery_info_free(BatteryInfo* battery_info);
-
-View* battery_info_get_view(BatteryInfo* battery_info);
-
-void battery_info_set_data(BatteryInfo* battery_info, BatteryInfoModel* data);

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

@@ -1,11 +0,0 @@
-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 - 126
applications/debug/blink_test/blink_test.c

@@ -1,126 +0,0 @@
-#include <core/common_defines.h>
-#include <furi.h>
-#include <furi_hal.h>
-
-#include <gui/gui.h>
-#include <input/input.h>
-
-#include <notification/notification_messages.h>
-
-typedef enum {
-    BlinkEventTypeTick,
-    BlinkEventTypeInput,
-} BlinkEventType;
-
-typedef struct {
-    BlinkEventType type;
-    InputEvent input;
-} BlinkEvent;
-
-static const NotificationSequence blink_test_sequence_hw_blink_start_red = {
-    &message_blink_start_10,
-    &message_blink_set_color_red,
-    &message_do_not_reset,
-    NULL,
-};
-
-static const NotificationSequence blink_test_sequence_hw_blink_green = {
-    &message_blink_set_color_green,
-    NULL,
-};
-
-static const NotificationSequence blink_test_sequence_hw_blink_blue = {
-    &message_blink_set_color_blue,
-    NULL,
-};
-
-static const NotificationSequence blink_test_sequence_hw_blink_stop = {
-    &message_blink_stop,
-    NULL,
-};
-
-static const NotificationSequence* blink_test_colors[] = {
-    &sequence_blink_red_100,
-    &sequence_blink_green_100,
-    &sequence_blink_blue_100,
-    &sequence_blink_yellow_100,
-    &sequence_blink_cyan_100,
-    &sequence_blink_magenta_100,
-    &sequence_blink_white_100,
-    &blink_test_sequence_hw_blink_start_red,
-    &blink_test_sequence_hw_blink_green,
-    &blink_test_sequence_hw_blink_blue,
-    &blink_test_sequence_hw_blink_stop,
-};
-
-static void blink_test_update(void* ctx) {
-    furi_assert(ctx);
-    FuriMessageQueue* event_queue = ctx;
-    BlinkEvent event = {.type = BlinkEventTypeTick};
-    // It's OK to loose this event if system overloaded
-    furi_message_queue_put(event_queue, &event, 0);
-}
-
-static void blink_test_draw_callback(Canvas* canvas, void* ctx) {
-    UNUSED(ctx);
-    canvas_clear(canvas);
-    canvas_set_font(canvas, FontPrimary);
-    canvas_draw_str(canvas, 2, 10, "Blink application");
-}
-
-static void blink_test_input_callback(InputEvent* input_event, void* ctx) {
-    furi_assert(ctx);
-    FuriMessageQueue* event_queue = ctx;
-
-    BlinkEvent event = {.type = BlinkEventTypeInput, .input = *input_event};
-    furi_message_queue_put(event_queue, &event, FuriWaitForever);
-}
-
-int32_t blink_test_app(void* p) {
-    UNUSED(p);
-    FuriMessageQueue* event_queue = furi_message_queue_alloc(8, sizeof(BlinkEvent));
-
-    // Configure view port
-    ViewPort* view_port = view_port_alloc();
-    view_port_draw_callback_set(view_port, blink_test_draw_callback, NULL);
-    view_port_input_callback_set(view_port, blink_test_input_callback, event_queue);
-    FuriTimer* timer = furi_timer_alloc(blink_test_update, FuriTimerTypePeriodic, event_queue);
-    furi_timer_start(timer, furi_kernel_get_tick_frequency());
-
-    // Register view port in GUI
-    Gui* gui = furi_record_open(RECORD_GUI);
-    gui_add_view_port(gui, view_port, GuiLayerFullscreen);
-
-    NotificationApp* notifications = furi_record_open(RECORD_NOTIFICATION);
-
-    uint8_t state = 0;
-    BlinkEvent event;
-
-    while(1) {
-        furi_check(furi_message_queue_get(event_queue, &event, FuriWaitForever) == FuriStatusOk);
-        if(event.type == BlinkEventTypeInput) {
-            if((event.input.type == InputTypeShort) && (event.input.key == InputKeyBack)) {
-                break;
-            }
-        } else {
-            notification_message(notifications, blink_test_colors[state]);
-            state++;
-            if(state >= COUNT_OF(blink_test_colors)) {
-                state = 0;
-            }
-        }
-    }
-
-    notification_message(notifications, &blink_test_sequence_hw_blink_stop);
-
-    furi_timer_free(timer);
-
-    gui_remove_view_port(gui, view_port);
-    view_port_free(view_port);
-    furi_message_queue_free(event_queue);
-
-    furi_record_close(RECORD_NOTIFICATION);
-    furi_record_close(RECORD_GUI);
-
-    return 0;
-}

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

@@ -1,18 +0,0 @@
-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 - 118
applications/debug/bt_debug_app/bt_debug_app.c

@@ -1,118 +0,0 @@
-#include "bt_debug_app.h"
-#include <furi_hal_bt.h>
-
-#define TAG "BtDebugApp"
-
-enum BtDebugSubmenuIndex {
-    BtDebugSubmenuIndexCarrierTest,
-    BtDebugSubmenuIndexPacketTest,
-};
-
-void bt_debug_submenu_callback(void* context, uint32_t index) {
-    furi_assert(context);
-    BtDebugApp* app = context;
-    if(index == BtDebugSubmenuIndexCarrierTest) {
-        view_dispatcher_switch_to_view(app->view_dispatcher, BtDebugAppViewCarrierTest);
-    } else if(index == BtDebugSubmenuIndexPacketTest) {
-        view_dispatcher_switch_to_view(app->view_dispatcher, BtDebugAppViewPacketTest);
-    }
-}
-
-uint32_t bt_debug_exit(void* context) {
-    UNUSED(context);
-    return VIEW_NONE;
-}
-
-uint32_t bt_debug_start_view(void* context) {
-    UNUSED(context);
-    return BtDebugAppViewSubmenu;
-}
-
-BtDebugApp* bt_debug_app_alloc() {
-    BtDebugApp* app = malloc(sizeof(BtDebugApp));
-
-    // Gui
-    app->gui = furi_record_open(RECORD_GUI);
-
-    // View dispatcher
-    app->view_dispatcher = view_dispatcher_alloc();
-    view_dispatcher_enable_queue(app->view_dispatcher);
-    view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
-
-    // Views
-    app->submenu = submenu_alloc();
-    submenu_add_item(
-        app->submenu,
-        "Carrier test",
-        BtDebugSubmenuIndexCarrierTest,
-        bt_debug_submenu_callback,
-        app);
-    submenu_add_item(
-        app->submenu, "Packet test", BtDebugSubmenuIndexPacketTest, bt_debug_submenu_callback, app);
-    view_set_previous_callback(submenu_get_view(app->submenu), bt_debug_exit);
-    view_dispatcher_add_view(
-        app->view_dispatcher, BtDebugAppViewSubmenu, submenu_get_view(app->submenu));
-    app->bt_carrier_test = bt_carrier_test_alloc();
-    view_set_previous_callback(
-        bt_carrier_test_get_view(app->bt_carrier_test), bt_debug_start_view);
-    view_dispatcher_add_view(
-        app->view_dispatcher,
-        BtDebugAppViewCarrierTest,
-        bt_carrier_test_get_view(app->bt_carrier_test));
-    app->bt_packet_test = bt_packet_test_alloc();
-    view_set_previous_callback(bt_packet_test_get_view(app->bt_packet_test), bt_debug_start_view);
-    view_dispatcher_add_view(
-        app->view_dispatcher,
-        BtDebugAppViewPacketTest,
-        bt_packet_test_get_view(app->bt_packet_test));
-
-    // Switch to menu
-    view_dispatcher_switch_to_view(app->view_dispatcher, BtDebugAppViewSubmenu);
-
-    return app;
-}
-
-void bt_debug_app_free(BtDebugApp* app) {
-    furi_assert(app);
-
-    // Free views
-    view_dispatcher_remove_view(app->view_dispatcher, BtDebugAppViewSubmenu);
-    submenu_free(app->submenu);
-    view_dispatcher_remove_view(app->view_dispatcher, BtDebugAppViewCarrierTest);
-    bt_carrier_test_free(app->bt_carrier_test);
-    view_dispatcher_remove_view(app->view_dispatcher, BtDebugAppViewPacketTest);
-    bt_packet_test_free(app->bt_packet_test);
-    view_dispatcher_free(app->view_dispatcher);
-
-    // Close gui record
-    furi_record_close(RECORD_GUI);
-    app->gui = NULL;
-
-    // Free rest
-    free(app);
-}
-
-int32_t bt_debug_app(void* p) {
-    UNUSED(p);
-    if(!furi_hal_bt_is_testing_supported()) {
-        FURI_LOG_E(TAG, "Incorrect radio stack: radio testing features are absent.");
-        DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS);
-        dialog_message_show_storage_error(dialogs, "Incorrect\nRadioStack");
-        return 255;
-    }
-
-    BtDebugApp* app = bt_debug_app_alloc();
-    // Was bt active?
-    const bool was_active = furi_hal_bt_is_active();
-    // Stop advertising
-    furi_hal_bt_stop_advertising();
-
-    view_dispatcher_run(app->view_dispatcher);
-
-    // Restart advertising
-    if(was_active) {
-        furi_hal_bt_start_advertising();
-    }
-    bt_debug_app_free(app);
-    return 0;
-}

+ 0 - 26
applications/debug/bt_debug_app/bt_debug_app.h

@@ -1,26 +0,0 @@
-#pragma once
-
-#include <furi.h>
-#include <gui/gui.h>
-#include <gui/view.h>
-#include <gui/view_dispatcher.h>
-#include <gui/modules/submenu.h>
-
-#include <dialogs/dialogs.h>
-
-#include "views/bt_carrier_test.h"
-#include "views/bt_packet_test.h"
-
-typedef struct {
-    Gui* gui;
-    ViewDispatcher* view_dispatcher;
-    Submenu* submenu;
-    BtCarrierTest* bt_carrier_test;
-    BtPacketTest* bt_packet_test;
-} BtDebugApp;
-
-typedef enum {
-    BtDebugAppViewSubmenu,
-    BtDebugAppViewCarrierTest,
-    BtDebugAppViewPacketTest,
-} BtDebugAppView;

+ 0 - 188
applications/debug/bt_debug_app/views/bt_carrier_test.c

@@ -1,188 +0,0 @@
-#include "bt_carrier_test.h"
-#include "bt_test.h"
-#include "bt_test_types.h"
-#include <furi_hal_bt.h>
-
-struct BtCarrierTest {
-    BtTest* bt_test;
-    BtTestParam* bt_param_channel;
-    BtTestMode mode;
-    BtTestChannel channel;
-    BtTestPower power;
-    FuriTimer* timer;
-};
-
-static BtTestParamValue bt_param_mode[] = {
-    {.value = BtTestModeRx, .str = "Rx"},
-    {.value = BtTestModeTx, .str = "Tx"},
-    {.value = BtTestModeTxHopping, .str = "Hopping Tx"},
-};
-
-static BtTestParamValue bt_param_channel[] = {
-    {.value = BtTestChannel2402, .str = "2402 MHz"},
-    {.value = BtTestChannel2440, .str = "2440 MHz"},
-    {.value = BtTestChannel2480, .str = "2480 MHz"},
-};
-
-static BtTestParamValue bt_param_power[] = {
-    {.value = BtPower0dB, .str = "0 dB"},
-    {.value = BtPower2dB, .str = "2 dB"},
-    {.value = BtPower4dB, .str = "4 dB"},
-    {.value = BtPower6dB, .str = "6 dB"},
-};
-
-static void bt_carrier_test_start(BtCarrierTest* bt_carrier_test) {
-    furi_assert(bt_carrier_test);
-    if(bt_carrier_test->mode == BtTestModeRx) {
-        furi_hal_bt_start_packet_rx(bt_carrier_test->channel, 1);
-        furi_timer_start(bt_carrier_test->timer, furi_kernel_get_tick_frequency() / 4);
-    } else if(bt_carrier_test->mode == BtTestModeTxHopping) {
-        furi_hal_bt_start_tone_tx(bt_carrier_test->channel, bt_carrier_test->power);
-        furi_timer_start(bt_carrier_test->timer, furi_kernel_get_tick_frequency() * 2);
-    } else if(bt_carrier_test->mode == BtTestModeTx) {
-        furi_hal_bt_start_tone_tx(bt_carrier_test->channel, bt_carrier_test->power);
-    }
-}
-
-static void bt_carrier_test_switch_channel(BtCarrierTest* bt_carrier_test) {
-    furi_assert(bt_carrier_test);
-    furi_hal_bt_stop_tone_tx();
-    uint8_t channel_i = 0;
-    if(bt_carrier_test->channel == BtTestChannel2402) {
-        bt_carrier_test->channel = BtTestChannel2440;
-        channel_i = 1;
-    } else if(bt_carrier_test->channel == BtTestChannel2440) {
-        bt_carrier_test->channel = BtTestChannel2480;
-        channel_i = 2;
-    } else if(bt_carrier_test->channel == BtTestChannel2480) {
-        bt_carrier_test->channel = BtTestChannel2402;
-        channel_i = 0;
-    }
-    furi_hal_bt_start_tone_tx(bt_carrier_test->channel, bt_carrier_test->power);
-    bt_test_set_current_value_index(bt_carrier_test->bt_param_channel, channel_i);
-    bt_test_set_current_value_text(
-        bt_carrier_test->bt_param_channel, bt_param_channel[channel_i].str);
-}
-
-static void bt_carrier_test_stop(BtCarrierTest* bt_carrier_test) {
-    furi_assert(bt_carrier_test);
-    if(bt_carrier_test->mode == BtTestModeTxHopping) {
-        furi_hal_bt_stop_tone_tx();
-        furi_timer_stop(bt_carrier_test->timer);
-    } else if(bt_carrier_test->mode == BtTestModeTx) {
-        furi_hal_bt_stop_tone_tx();
-    } else if(bt_carrier_test->mode == BtTestModeRx) {
-        furi_hal_bt_stop_packet_test();
-        furi_timer_stop(bt_carrier_test->timer);
-    }
-}
-
-static uint32_t bt_carrier_test_param_changed(BtTestParam* param, BtTestParamValue* param_val) {
-    furi_assert(param);
-    uint8_t index = bt_test_get_current_value_index(param);
-    bt_test_set_current_value_text(param, param_val[index].str);
-    return param_val[index].value;
-}
-
-static void bt_carrier_test_mode_changed(BtTestParam* param) {
-    BtCarrierTest* bt_carrier_test = bt_test_get_context(param);
-    bt_carrier_test_stop(bt_carrier_test);
-    bt_carrier_test->mode = bt_carrier_test_param_changed(param, bt_param_mode);
-}
-
-static void bt_carrier_test_channel_changed(BtTestParam* param) {
-    BtCarrierTest* bt_carrier_test = bt_test_get_context(param);
-    bt_carrier_test_stop(bt_carrier_test);
-    bt_carrier_test->channel = bt_carrier_test_param_changed(param, bt_param_channel);
-}
-
-static void bt_carrier_test_param_channel(BtTestParam* param) {
-    BtCarrierTest* bt_carrier_test = bt_test_get_context(param);
-    bt_carrier_test_stop(bt_carrier_test);
-    bt_carrier_test->power = bt_carrier_test_param_changed(param, bt_param_power);
-}
-
-static void bt_carrier_test_change_state_callback(BtTestState state, void* context) {
-    furi_assert(context);
-    BtCarrierTest* bt_carrier_test = context;
-    furi_hal_bt_stop_tone_tx();
-    if(state == BtTestStateStarted) {
-        bt_carrier_test_start(bt_carrier_test);
-    } else if(state == BtTestStateStopped) {
-        bt_carrier_test_stop(bt_carrier_test);
-    }
-}
-
-static void bt_carrier_test_exit_callback(void* context) {
-    furi_assert(context);
-    BtCarrierTest* bt_carrier_test = context;
-    bt_carrier_test_stop(bt_carrier_test);
-}
-
-static void bt_test_carrier_timer_callback(void* context) {
-    furi_assert(context);
-    BtCarrierTest* bt_carrier_test = context;
-    if(bt_carrier_test->mode == BtTestModeRx) {
-        bt_test_set_rssi(bt_carrier_test->bt_test, furi_hal_bt_get_rssi());
-    } else if(bt_carrier_test->mode == BtTestModeTxHopping) {
-        bt_carrier_test_switch_channel(bt_carrier_test);
-    }
-}
-
-BtCarrierTest* bt_carrier_test_alloc() {
-    BtCarrierTest* bt_carrier_test = malloc(sizeof(BtCarrierTest));
-    bt_carrier_test->bt_test = bt_test_alloc();
-    bt_test_set_context(bt_carrier_test->bt_test, bt_carrier_test);
-    bt_test_set_change_state_callback(
-        bt_carrier_test->bt_test, bt_carrier_test_change_state_callback);
-    bt_test_set_back_callback(bt_carrier_test->bt_test, bt_carrier_test_exit_callback);
-
-    BtTestParam* param;
-    param = bt_test_param_add(
-        bt_carrier_test->bt_test,
-        "Mode",
-        COUNT_OF(bt_param_mode),
-        bt_carrier_test_mode_changed,
-        bt_carrier_test);
-    bt_test_set_current_value_index(param, 0);
-    bt_test_set_current_value_text(param, bt_param_mode[0].str);
-    bt_carrier_test->mode = BtTestModeRx;
-
-    param = bt_test_param_add(
-        bt_carrier_test->bt_test,
-        "Channel",
-        COUNT_OF(bt_param_channel),
-        bt_carrier_test_channel_changed,
-        bt_carrier_test);
-    bt_test_set_current_value_index(param, 0);
-    bt_test_set_current_value_text(param, bt_param_channel[0].str);
-    bt_carrier_test->channel = BtTestChannel2402;
-    bt_carrier_test->bt_param_channel = param;
-
-    param = bt_test_param_add(
-        bt_carrier_test->bt_test,
-        "Power",
-        COUNT_OF(bt_param_power),
-        bt_carrier_test_param_channel,
-        bt_carrier_test);
-    bt_test_set_current_value_index(param, 0);
-    bt_test_set_current_value_text(param, bt_param_power[0].str);
-    bt_carrier_test->power = BtPower0dB;
-
-    bt_carrier_test->timer =
-        furi_timer_alloc(bt_test_carrier_timer_callback, FuriTimerTypePeriodic, bt_carrier_test);
-
-    return bt_carrier_test;
-}
-
-void bt_carrier_test_free(BtCarrierTest* bt_carrier_test) {
-    furi_assert(bt_carrier_test);
-    bt_test_free(bt_carrier_test->bt_test);
-    furi_timer_free(bt_carrier_test->timer);
-    free(bt_carrier_test);
-}
-
-View* bt_carrier_test_get_view(BtCarrierTest* bt_carrier_test) {
-    furi_assert(bt_carrier_test);
-    return bt_test_get_view(bt_carrier_test->bt_test);
-}

+ 0 - 10
applications/debug/bt_debug_app/views/bt_carrier_test.h

@@ -1,10 +0,0 @@
-#pragma once
-#include <gui/view.h>
-
-typedef struct BtCarrierTest BtCarrierTest;
-
-BtCarrierTest* bt_carrier_test_alloc();
-
-void bt_carrier_test_free(BtCarrierTest* bt_carrier_test);
-
-View* bt_carrier_test_get_view(BtCarrierTest* bt_carrier_test);

+ 0 - 155
applications/debug/bt_debug_app/views/bt_packet_test.c

@@ -1,155 +0,0 @@
-#include "bt_packet_test.h"
-#include "bt_test.h"
-#include "bt_test_types.h"
-#include <furi_hal_bt.h>
-
-struct BtPacketTest {
-    BtTest* bt_test;
-    BtTestMode mode;
-    BtTestChannel channel;
-    BtTestDataRate data_rate;
-    FuriTimer* timer;
-};
-
-static BtTestParamValue bt_param_mode[] = {
-    {.value = BtTestModeRx, .str = "Rx"},
-    {.value = BtTestModeTx, .str = "Tx"},
-};
-
-static BtTestParamValue bt_param_channel[] = {
-    {.value = BtTestChannel2402, .str = "2402 MHz"},
-    {.value = BtTestChannel2440, .str = "2440 MHz"},
-    {.value = BtTestChannel2480, .str = "2480 MHz"},
-};
-
-static BtTestParamValue bt_param_data_rate[] = {
-    {.value = BtDataRate1M, .str = "1 Mbps"},
-    {.value = BtDataRate2M, .str = "2 Mbps"},
-};
-
-static void bt_packet_test_start(BtPacketTest* bt_packet_test) {
-    furi_assert(bt_packet_test);
-    if(bt_packet_test->mode == BtTestModeRx) {
-        furi_hal_bt_start_packet_rx(bt_packet_test->channel, bt_packet_test->data_rate);
-        furi_timer_start(bt_packet_test->timer, furi_kernel_get_tick_frequency() / 4);
-    } else if(bt_packet_test->mode == BtTestModeTx) {
-        furi_hal_bt_start_packet_tx(bt_packet_test->channel, 1, bt_packet_test->data_rate);
-    }
-}
-
-static void bt_packet_test_stop(BtPacketTest* bt_packet_test) {
-    furi_assert(bt_packet_test);
-    if(bt_packet_test->mode == BtTestModeTx) {
-        furi_hal_bt_stop_packet_test();
-        bt_test_set_packets_tx(bt_packet_test->bt_test, furi_hal_bt_get_transmitted_packets());
-    } else if(bt_packet_test->mode == BtTestModeRx) {
-        bt_test_set_packets_rx(bt_packet_test->bt_test, furi_hal_bt_stop_packet_test());
-        furi_timer_stop(bt_packet_test->timer);
-    }
-}
-
-static uint32_t bt_packet_test_param_changed(BtTestParam* param, BtTestParamValue* param_val) {
-    furi_assert(param);
-    uint8_t index = bt_test_get_current_value_index(param);
-    bt_test_set_current_value_text(param, param_val[index].str);
-    return param_val[index].value;
-}
-
-static void bt_packet_test_mode_changed(BtTestParam* param) {
-    BtPacketTest* bt_packet_test = bt_test_get_context(param);
-    bt_packet_test_stop(bt_packet_test);
-    bt_packet_test->mode = bt_packet_test_param_changed(param, bt_param_mode);
-}
-
-static void bt_packet_test_channel_changed(BtTestParam* param) {
-    BtPacketTest* bt_packet_test = bt_test_get_context(param);
-    bt_packet_test_stop(bt_packet_test);
-    bt_packet_test->channel = bt_packet_test_param_changed(param, bt_param_channel);
-}
-
-static void bt_packet_test_param_channel(BtTestParam* param) {
-    BtPacketTest* bt_packet_test = bt_test_get_context(param);
-    bt_packet_test_stop(bt_packet_test);
-    bt_packet_test->data_rate = bt_packet_test_param_changed(param, bt_param_data_rate);
-}
-
-static void bt_packet_test_change_state_callback(BtTestState state, void* context) {
-    furi_assert(context);
-    BtPacketTest* bt_packet_test = context;
-    if(state == BtTestStateStarted) {
-        bt_packet_test_start(bt_packet_test);
-    } else if(state == BtTestStateStopped) {
-        bt_packet_test_stop(bt_packet_test);
-    }
-}
-
-static void bt_packet_test_exit_callback(void* context) {
-    furi_assert(context);
-    BtPacketTest* bt_packet_test = context;
-    bt_packet_test_stop(bt_packet_test);
-}
-
-static void bt_test_packet_timer_callback(void* context) {
-    furi_assert(context);
-    BtPacketTest* bt_packet_test = context;
-    if(bt_packet_test->mode == BtTestModeRx) {
-        bt_test_set_rssi(bt_packet_test->bt_test, furi_hal_bt_get_rssi());
-    }
-}
-
-BtPacketTest* bt_packet_test_alloc() {
-    BtPacketTest* bt_packet_test = malloc(sizeof(BtPacketTest));
-    bt_packet_test->bt_test = bt_test_alloc();
-    bt_test_set_context(bt_packet_test->bt_test, bt_packet_test);
-    bt_test_set_change_state_callback(
-        bt_packet_test->bt_test, bt_packet_test_change_state_callback);
-    bt_test_set_back_callback(bt_packet_test->bt_test, bt_packet_test_exit_callback);
-
-    BtTestParam* param;
-    param = bt_test_param_add(
-        bt_packet_test->bt_test,
-        "Mode",
-        COUNT_OF(bt_param_mode),
-        bt_packet_test_mode_changed,
-        bt_packet_test);
-    bt_test_set_current_value_index(param, 0);
-    bt_test_set_current_value_text(param, bt_param_mode[0].str);
-    bt_packet_test->mode = BtTestModeRx;
-
-    param = bt_test_param_add(
-        bt_packet_test->bt_test,
-        "Channel",
-        COUNT_OF(bt_param_channel),
-        bt_packet_test_channel_changed,
-        bt_packet_test);
-    bt_test_set_current_value_index(param, 0);
-    bt_test_set_current_value_text(param, bt_param_channel[0].str);
-    bt_packet_test->channel = BtTestChannel2402;
-
-    param = bt_test_param_add(
-        bt_packet_test->bt_test,
-        "Data rate",
-        COUNT_OF(bt_param_data_rate),
-        bt_packet_test_param_channel,
-        bt_packet_test);
-    bt_test_set_current_value_index(param, 0);
-    bt_test_set_current_value_text(param, bt_param_data_rate[0].str);
-    bt_packet_test->data_rate = BtDataRate1M;
-
-    bt_packet_test->timer =
-        furi_timer_alloc(bt_test_packet_timer_callback, FuriTimerTypePeriodic, bt_packet_test);
-
-    return bt_packet_test;
-}
-
-void bt_packet_test_free(BtPacketTest* bt_packet_test) {
-    furi_assert(bt_packet_test);
-    bt_test_free(bt_packet_test->bt_test);
-    furi_timer_free(bt_packet_test->timer);
-    free(bt_packet_test);
-}
-
-View* bt_packet_test_get_view(BtPacketTest* bt_packet_test) {
-    furi_assert(bt_packet_test);
-    return bt_test_get_view(bt_packet_test->bt_test);
-}

+ 0 - 10
applications/debug/bt_debug_app/views/bt_packet_test.h

@@ -1,10 +0,0 @@
-#pragma once
-#include <gui/view.h>
-
-typedef struct BtPacketTest BtPacketTest;
-
-BtPacketTest* bt_packet_test_alloc();
-
-void bt_packet_test_free(BtPacketTest* bt_packet_test);
-
-View* bt_packet_test_get_view(BtPacketTest* bt_packet_test);

+ 0 - 434
applications/debug/bt_debug_app/views/bt_test.c

@@ -1,434 +0,0 @@
-#include "bt_test.h"
-
-#include <gui/canvas.h>
-#include <gui/elements.h>
-
-#include <lib/toolbox/float_tools.h>
-#include <m-array.h>
-#include <furi.h>
-#include <inttypes.h>
-#include <stdint.h>
-
-struct BtTestParam {
-    const char* label;
-    uint8_t current_value_index;
-    FuriString* current_value_text;
-    uint8_t values_count;
-    BtTestParamChangeCallback change_callback;
-    void* context;
-};
-
-ARRAY_DEF(BtTestParamArray, BtTestParam, M_POD_OPLIST);
-
-struct BtTest {
-    View* view;
-    BtTestChangeStateCallback change_state_callback;
-    BtTestBackCallback back_callback;
-    void* context;
-};
-
-typedef struct {
-    BtTestState state;
-    BtTestParamArray_t params;
-    uint8_t position;
-    uint8_t window_position;
-    const char* message;
-    float rssi;
-    uint32_t packets_num_rx;
-    uint32_t packets_num_tx;
-} BtTestModel;
-
-#define BT_TEST_START_MESSAGE "Ok - Start"
-#define BT_TEST_STOP_MESSAGE "Ok - Stop"
-
-static void bt_test_process_up(BtTest* bt_test);
-static void bt_test_process_down(BtTest* bt_test);
-static void bt_test_process_left(BtTest* bt_test);
-static void bt_test_process_right(BtTest* bt_test);
-static void bt_test_process_ok(BtTest* bt_test);
-static void bt_test_process_back(BtTest* bt_test);
-
-static void bt_test_draw_callback(Canvas* canvas, void* _model) {
-    BtTestModel* model = _model;
-    char info_str[32];
-
-    const uint8_t param_height = 16;
-    const uint8_t param_width = 123;
-
-    canvas_clear(canvas);
-
-    uint8_t position = 0;
-    BtTestParamArray_it_t it;
-
-    canvas_set_font(canvas, FontSecondary);
-    for(BtTestParamArray_it(it, model->params); !BtTestParamArray_end_p(it);
-        BtTestParamArray_next(it)) {
-        uint8_t param_position = position - model->window_position;
-        uint8_t params_on_screen = 3;
-        uint8_t y_offset = 0;
-
-        if(param_position < params_on_screen) {
-            const BtTestParam* param = BtTestParamArray_cref(it);
-            uint8_t param_y = y_offset + (param_position * param_height);
-            uint8_t param_text_y = param_y + param_height - 4;
-
-            if(position == model->position) {
-                canvas_set_color(canvas, ColorBlack);
-                elements_slightly_rounded_box(
-                    canvas, 0, param_y + 1, param_width, param_height - 2);
-                canvas_set_color(canvas, ColorWhite);
-            } else {
-                canvas_set_color(canvas, ColorBlack);
-            }
-
-            canvas_draw_str(canvas, 6, param_text_y, param->label);
-
-            if(param->current_value_index > 0) {
-                canvas_draw_str(canvas, 50, param_text_y, "<");
-            }
-
-            canvas_draw_str(
-                canvas, 61, param_text_y, furi_string_get_cstr(param->current_value_text));
-
-            if(param->current_value_index < (param->values_count - 1)) {
-                canvas_draw_str(canvas, 113, param_text_y, ">");
-            }
-        }
-
-        position++;
-    }
-
-    elements_scrollbar(canvas, model->position, BtTestParamArray_size(model->params));
-    canvas_draw_str(canvas, 6, 60, model->message);
-    if(model->state == BtTestStateStarted) {
-        if(!float_is_equal(model->rssi, 0.0f)) {
-            snprintf(info_str, sizeof(info_str), "RSSI:%3.1f dB", (double)model->rssi);
-            canvas_draw_str_aligned(canvas, 124, 60, AlignRight, AlignBottom, info_str);
-        }
-    } else if(model->state == BtTestStateStopped) {
-        if(model->packets_num_rx) {
-            snprintf(info_str, sizeof(info_str), "%" PRIu32 " pack rcv", model->packets_num_rx);
-            canvas_draw_str_aligned(canvas, 124, 60, AlignRight, AlignBottom, info_str);
-        } else if(model->packets_num_tx) {
-            snprintf(info_str, sizeof(info_str), "%" PRIu32 " pack sent", model->packets_num_tx);
-            canvas_draw_str_aligned(canvas, 124, 60, AlignRight, AlignBottom, info_str);
-        }
-    }
-}
-
-static bool bt_test_input_callback(InputEvent* event, void* context) {
-    BtTest* bt_test = context;
-    furi_assert(bt_test);
-    bool consumed = false;
-
-    if(event->type == InputTypeShort) {
-        switch(event->key) {
-        case InputKeyUp:
-            consumed = true;
-            bt_test_process_up(bt_test);
-            break;
-        case InputKeyDown:
-            consumed = true;
-            bt_test_process_down(bt_test);
-            break;
-        case InputKeyLeft:
-            consumed = true;
-            bt_test_process_left(bt_test);
-            break;
-        case InputKeyRight:
-            consumed = true;
-            bt_test_process_right(bt_test);
-            break;
-        case InputKeyOk:
-            consumed = true;
-            bt_test_process_ok(bt_test);
-            break;
-        case InputKeyBack:
-            consumed = false;
-            bt_test_process_back(bt_test);
-            break;
-        default:
-            break;
-        }
-    }
-
-    return consumed;
-}
-
-void bt_test_process_up(BtTest* bt_test) {
-    with_view_model( // -V658
-        bt_test->view,
-        BtTestModel * model,
-        {
-            uint8_t params_on_screen = 3;
-            if(model->position > 0) {
-                model->position--;
-                if(((model->position - model->window_position) < 1) &&
-                   model->window_position > 0) {
-                    model->window_position--;
-                }
-            } else {
-                model->position = BtTestParamArray_size(model->params) - 1;
-                if(model->position > (params_on_screen - 1)) {
-                    model->window_position = model->position - (params_on_screen - 1);
-                }
-            }
-        },
-        true);
-}
-
-void bt_test_process_down(BtTest* bt_test) {
-    with_view_model(
-        bt_test->view,
-        BtTestModel * model,
-        {
-            uint8_t params_on_screen = 3;
-            if(model->position < (BtTestParamArray_size(model->params) - 1)) {
-                model->position++;
-                if((model->position - model->window_position) > (params_on_screen - 2) &&
-                   model->window_position <
-                       (BtTestParamArray_size(model->params) - params_on_screen)) {
-                    model->window_position++;
-                }
-            } else {
-                model->position = 0;
-                model->window_position = 0;
-            }
-        },
-        true);
-}
-
-BtTestParam* bt_test_get_selected_param(BtTestModel* model) {
-    BtTestParam* param = NULL;
-
-    BtTestParamArray_it_t it;
-    uint8_t position = 0;
-    for(BtTestParamArray_it(it, model->params); !BtTestParamArray_end_p(it);
-        BtTestParamArray_next(it)) {
-        if(position == model->position) {
-            break;
-        }
-        position++;
-    }
-
-    param = BtTestParamArray_ref(it);
-
-    furi_assert(param);
-    return param;
-}
-
-void bt_test_process_left(BtTest* bt_test) {
-    BtTestParam* param;
-    with_view_model(
-        bt_test->view,
-        BtTestModel * model,
-        {
-            param = bt_test_get_selected_param(model);
-            if(param->current_value_index > 0) {
-                param->current_value_index--;
-                if(param->change_callback) {
-                    model->state = BtTestStateStopped;
-                    model->message = BT_TEST_START_MESSAGE;
-                    model->rssi = 0.0f;
-                    model->packets_num_rx = 0;
-                    model->packets_num_tx = 0;
-                }
-            }
-        },
-        true);
-    if(param->change_callback) {
-        param->change_callback(param);
-    }
-}
-
-void bt_test_process_right(BtTest* bt_test) {
-    BtTestParam* param;
-    with_view_model(
-        bt_test->view,
-        BtTestModel * model,
-        {
-            param = bt_test_get_selected_param(model);
-            if(param->current_value_index < (param->values_count - 1)) {
-                param->current_value_index++;
-                if(param->change_callback) {
-                    model->state = BtTestStateStopped;
-                    model->message = BT_TEST_START_MESSAGE;
-                    model->rssi = 0.0f;
-                    model->packets_num_rx = 0;
-                    model->packets_num_tx = 0;
-                }
-            }
-        },
-        true);
-    if(param->change_callback) {
-        param->change_callback(param);
-    }
-}
-
-void bt_test_process_ok(BtTest* bt_test) {
-    BtTestState state;
-    with_view_model(
-        bt_test->view,
-        BtTestModel * model,
-        {
-            if(model->state == BtTestStateStarted) {
-                model->state = BtTestStateStopped;
-                model->message = BT_TEST_START_MESSAGE;
-                model->rssi = 0.0f;
-                model->packets_num_rx = 0;
-                model->packets_num_tx = 0;
-            } else if(model->state == BtTestStateStopped) {
-                model->state = BtTestStateStarted;
-                model->message = BT_TEST_STOP_MESSAGE;
-            }
-            state = model->state;
-        },
-        true);
-    if(bt_test->change_state_callback) {
-        bt_test->change_state_callback(state, bt_test->context);
-    }
-}
-
-void bt_test_process_back(BtTest* bt_test) {
-    with_view_model(
-        bt_test->view,
-        BtTestModel * model,
-        {
-            model->state = BtTestStateStopped;
-            model->rssi = 0.0f;
-            model->packets_num_rx = 0;
-            model->packets_num_tx = 0;
-        },
-        false);
-    if(bt_test->back_callback) {
-        bt_test->back_callback(bt_test->context);
-    }
-}
-
-BtTest* bt_test_alloc() {
-    BtTest* bt_test = malloc(sizeof(BtTest));
-    bt_test->view = view_alloc();
-    view_set_context(bt_test->view, bt_test);
-    view_allocate_model(bt_test->view, ViewModelTypeLocking, sizeof(BtTestModel));
-    view_set_draw_callback(bt_test->view, bt_test_draw_callback);
-    view_set_input_callback(bt_test->view, bt_test_input_callback);
-
-    with_view_model(
-        bt_test->view,
-        BtTestModel * model,
-        {
-            model->state = BtTestStateStopped;
-            model->message = "Ok - Start";
-            BtTestParamArray_init(model->params);
-            model->position = 0;
-            model->window_position = 0;
-            model->rssi = 0.0f;
-            model->packets_num_tx = 0;
-            model->packets_num_rx = 0;
-        },
-        true);
-
-    return bt_test;
-}
-
-void bt_test_free(BtTest* bt_test) {
-    furi_assert(bt_test);
-
-    with_view_model(
-        bt_test->view,
-        BtTestModel * model,
-        {
-            BtTestParamArray_it_t it;
-            for(BtTestParamArray_it(it, model->params); !BtTestParamArray_end_p(it);
-                BtTestParamArray_next(it)) {
-                furi_string_free(BtTestParamArray_ref(it)->current_value_text);
-            }
-            BtTestParamArray_clear(model->params);
-        },
-        false);
-    view_free(bt_test->view);
-    free(bt_test);
-}
-
-View* bt_test_get_view(BtTest* bt_test) {
-    furi_assert(bt_test);
-    return bt_test->view;
-}
-
-BtTestParam* bt_test_param_add(
-    BtTest* bt_test,
-    const char* label,
-    uint8_t values_count,
-    BtTestParamChangeCallback change_callback,
-    void* context) {
-    BtTestParam* param = NULL;
-    furi_assert(label);
-    furi_assert(bt_test);
-
-    with_view_model(
-        bt_test->view,
-        BtTestModel * model,
-        {
-            param = BtTestParamArray_push_new(model->params);
-            param->label = label;
-            param->values_count = values_count;
-            param->change_callback = change_callback;
-            param->context = context;
-            param->current_value_index = 0;
-            param->current_value_text = furi_string_alloc();
-        },
-        true);
-
-    return param;
-}
-
-void bt_test_set_rssi(BtTest* bt_test, float rssi) {
-    furi_assert(bt_test);
-    with_view_model(
-        bt_test->view, BtTestModel * model, { model->rssi = rssi; }, true);
-}
-
-void bt_test_set_packets_tx(BtTest* bt_test, uint32_t packets_num) {
-    furi_assert(bt_test);
-    with_view_model(
-        bt_test->view, BtTestModel * model, { model->packets_num_tx = packets_num; }, true);
-}
-
-void bt_test_set_packets_rx(BtTest* bt_test, uint32_t packets_num) {
-    furi_assert(bt_test);
-    with_view_model(
-        bt_test->view, BtTestModel * model, { model->packets_num_rx = packets_num; }, true);
-}
-
-void bt_test_set_change_state_callback(BtTest* bt_test, BtTestChangeStateCallback callback) {
-    furi_assert(bt_test);
-    furi_assert(callback);
-    bt_test->change_state_callback = callback;
-}
-
-void bt_test_set_back_callback(BtTest* bt_test, BtTestBackCallback callback) {
-    furi_assert(bt_test);
-    furi_assert(callback);
-    bt_test->back_callback = callback;
-}
-
-void bt_test_set_context(BtTest* bt_test, void* context) {
-    furi_assert(bt_test);
-    bt_test->context = context;
-}
-
-void bt_test_set_current_value_index(BtTestParam* param, uint8_t current_value_index) {
-    param->current_value_index = current_value_index;
-}
-
-void bt_test_set_current_value_text(BtTestParam* param, const char* current_value_text) {
-    furi_string_set(param->current_value_text, current_value_text);
-}
-
-uint8_t bt_test_get_current_value_index(BtTestParam* param) {
-    return param->current_value_index;
-}
-
-void* bt_test_get_context(BtTestParam* param) {
-    return param->context;
-}

+ 0 - 46
applications/debug/bt_debug_app/views/bt_test.h

@@ -1,46 +0,0 @@
-#pragma once
-#include <gui/view.h>
-
-typedef enum {
-    BtTestStateStarted,
-    BtTestStateStopped,
-} BtTestState;
-
-typedef struct BtTest BtTest;
-typedef void (*BtTestChangeStateCallback)(BtTestState state, void* context);
-typedef void (*BtTestBackCallback)(void* context);
-typedef struct BtTestParam BtTestParam;
-typedef void (*BtTestParamChangeCallback)(BtTestParam* param);
-
-BtTest* bt_test_alloc();
-
-void bt_test_free(BtTest* bt_test);
-
-View* bt_test_get_view(BtTest* bt_test);
-
-BtTestParam* bt_test_param_add(
-    BtTest* bt_test,
-    const char* label,
-    uint8_t values_count,
-    BtTestParamChangeCallback change_callback,
-    void* context);
-
-void bt_test_set_change_state_callback(BtTest* bt_test, BtTestChangeStateCallback callback);
-
-void bt_test_set_back_callback(BtTest* bt_test, BtTestBackCallback callback);
-
-void bt_test_set_context(BtTest* bt_test, void* context);
-
-void bt_test_set_rssi(BtTest* bt_test, float rssi);
-
-void bt_test_set_packets_tx(BtTest* bt_test, uint32_t packets_num);
-
-void bt_test_set_packets_rx(BtTest* bt_test, uint32_t packets_num);
-
-void bt_test_set_current_value_index(BtTestParam* param, uint8_t current_value_index);
-
-void bt_test_set_current_value_text(BtTestParam* param, const char* current_value_text);
-
-uint8_t bt_test_get_current_value_index(BtTestParam* param);
-
-void* bt_test_get_context(BtTestParam* param);

+ 0 - 30
applications/debug/bt_debug_app/views/bt_test_types.h

@@ -1,30 +0,0 @@
-#pragma once
-
-typedef enum {
-    BtTestModeRx,
-    BtTestModeTx,
-    BtTestModeTxHopping,
-} BtTestMode;
-
-typedef enum {
-    BtTestChannel2402 = 0,
-    BtTestChannel2440 = 19,
-    BtTestChannel2480 = 39,
-} BtTestChannel;
-
-typedef enum {
-    BtPower0dB = 0x19,
-    BtPower2dB = 0x1B,
-    BtPower4dB = 0x1D,
-    BtPower6dB = 0x1F,
-} BtTestPower;
-
-typedef enum {
-    BtDataRate1M = 1,
-    BtDataRate2M = 2,
-} BtTestDataRate;
-
-typedef struct {
-    uint32_t value;
-    const char* str;
-} BtTestParamValue;

+ 0 - 10
applications/debug/direct_draw/application.fam

@@ -1,10 +0,0 @@
-App(
-    appid="direct_draw",
-    name="Direct Draw",
-    apptype=FlipperAppType.DEBUG,
-    entry_point="direct_draw_app",
-    requires=["gui", "input"],
-    stack_size=2 * 1024,
-    order=70,
-    fap_category="Debug",
-)

+ 0 - 112
applications/debug/direct_draw/direct_draw.c

@@ -1,112 +0,0 @@
-#include <furi.h>
-#include <gui/gui.h>
-#include <gui/canvas_i.h>
-#include <input/input.h>
-
-#define BUFFER_SIZE (32U)
-
-typedef struct {
-    FuriPubSub* input;
-    FuriPubSubSubscription* input_subscription;
-    Gui* gui;
-    Canvas* canvas;
-    bool stop;
-    uint32_t counter;
-} DirectDraw;
-
-static void gui_input_events_callback(const void* value, void* ctx) {
-    furi_assert(value);
-    furi_assert(ctx);
-
-    DirectDraw* instance = ctx;
-    const InputEvent* event = value;
-
-    if(event->key == InputKeyBack && event->type == InputTypeShort) {
-        instance->stop = true;
-    }
-}
-
-static DirectDraw* direct_draw_alloc() {
-    DirectDraw* instance = malloc(sizeof(DirectDraw));
-
-    instance->input = furi_record_open(RECORD_INPUT_EVENTS);
-    instance->gui = furi_record_open(RECORD_GUI);
-    instance->canvas = gui_direct_draw_acquire(instance->gui);
-
-    instance->input_subscription =
-        furi_pubsub_subscribe(instance->input, gui_input_events_callback, instance);
-
-    return instance;
-}
-
-static void direct_draw_free(DirectDraw* instance) {
-    furi_pubsub_unsubscribe(instance->input, instance->input_subscription);
-
-    instance->canvas = NULL;
-    gui_direct_draw_release(instance->gui);
-    furi_record_close(RECORD_GUI);
-    furi_record_close(RECORD_INPUT_EVENTS);
-}
-
-static void direct_draw_block(Canvas* canvas, uint32_t size, uint32_t counter) {
-    size += 16;
-    uint8_t width = canvas_width(canvas) - size;
-    uint8_t height = canvas_height(canvas) - size;
-
-    uint8_t x = counter % width;
-    if((counter / width) % 2) {
-        x = width - x;
-    }
-
-    uint8_t y = counter % height;
-    if((counter / height) % 2) {
-        y = height - y;
-    }
-
-    canvas_draw_box(canvas, x, y, size, size);
-}
-
-static void direct_draw_run(DirectDraw* instance) {
-    size_t start = DWT->CYCCNT;
-    size_t counter = 0;
-    float fps = 0;
-
-    vTaskPrioritySet(furi_thread_get_current_id(), FuriThreadPriorityIdle);
-
-    do {
-        size_t elapsed = DWT->CYCCNT - start;
-        char buffer[BUFFER_SIZE] = {0};
-
-        if(elapsed >= 64000000) {
-            fps = (float)counter / ((float)elapsed / 64000000.0f);
-
-            start = DWT->CYCCNT;
-            counter = 0;
-        }
-        snprintf(buffer, BUFFER_SIZE, "FPS: %.1f", (double)fps);
-
-        canvas_reset(instance->canvas);
-        canvas_set_color(instance->canvas, ColorXOR);
-        direct_draw_block(instance->canvas, instance->counter % 16, instance->counter);
-        direct_draw_block(instance->canvas, instance->counter * 2 % 16, instance->counter * 2);
-        direct_draw_block(instance->canvas, instance->counter * 3 % 16, instance->counter * 3);
-        direct_draw_block(instance->canvas, instance->counter * 4 % 16, instance->counter * 4);
-        direct_draw_block(instance->canvas, instance->counter * 5 % 16, instance->counter * 5);
-        canvas_draw_str(instance->canvas, 10, 10, buffer);
-        canvas_commit(instance->canvas);
-
-        counter++;
-        instance->counter++;
-        furi_thread_yield();
-    } while(!instance->stop);
-}
-
-int32_t direct_draw_app(void* p) {
-    UNUSED(p);
-
-    DirectDraw* instance = direct_draw_alloc();
-    direct_draw_run(instance);
-    direct_draw_free(instance);
-
-    return 0;
-}

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

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

+ 0 - 231
applications/debug/display_test/display_test.c

@@ -1,231 +0,0 @@
-#include "display_test.h"
-
-#include <furi_hal.h>
-#include <furi.h>
-
-// Need access to u8g2
-#include <gui/gui_i.h>
-#include <gui/canvas_i.h>
-#include <u8g2_glue.h>
-
-#include <gui/view_dispatcher.h>
-#include <gui/modules/submenu.h>
-#include <gui/modules/variable_item_list.h>
-
-#include "view_display_test.h"
-
-#define TAG "DisplayTest"
-
-typedef struct {
-    Gui* gui;
-    ViewDispatcher* view_dispatcher;
-    ViewDisplayTest* view_display_test;
-    VariableItemList* variable_item_list;
-    Submenu* submenu;
-
-    bool config_bias;
-    uint8_t config_contrast;
-    uint8_t config_regulation_ratio;
-} DisplayTest;
-
-typedef enum {
-    DisplayTestViewSubmenu,
-    DisplayTestViewConfigure,
-    DisplayTestViewDisplayTest,
-} DisplayTestView;
-
-const bool config_bias_value[] = {
-    true,
-    false,
-};
-const char* const config_bias_text[] = {
-    "1/7",
-    "1/9",
-};
-
-const uint8_t config_regulation_ratio_value[] = {
-    0b000,
-    0b001,
-    0b010,
-    0b011,
-    0b100,
-    0b101,
-    0b110,
-    0b111,
-};
-const char* const config_regulation_ratio_text[] = {
-    "3.0",
-    "3.5",
-    "4.0",
-    "4.5",
-    "5.0",
-    "5.5",
-    "6.0",
-    "6.5",
-};
-
-static void display_test_submenu_callback(void* context, uint32_t index) {
-    DisplayTest* instance = (DisplayTest*)context;
-    view_dispatcher_switch_to_view(instance->view_dispatcher, index);
-}
-
-static uint32_t display_test_previous_callback(void* context) {
-    UNUSED(context);
-    return DisplayTestViewSubmenu;
-}
-
-static uint32_t display_test_exit_callback(void* context) {
-    UNUSED(context);
-    return VIEW_NONE;
-}
-
-static void display_test_reload_config(DisplayTest* instance) {
-    FURI_LOG_I(
-        TAG,
-        "contrast: %d, regulation_ratio: %d, bias: %d",
-        instance->config_contrast,
-        instance->config_regulation_ratio,
-        instance->config_bias);
-    u8x8_d_st756x_init(
-        &instance->gui->canvas->fb.u8x8,
-        instance->config_contrast,
-        instance->config_regulation_ratio,
-        instance->config_bias);
-}
-
-static void display_config_set_bias(VariableItem* item) {
-    DisplayTest* instance = variable_item_get_context(item);
-    uint8_t index = variable_item_get_current_value_index(item);
-    variable_item_set_current_value_text(item, config_bias_text[index]);
-    instance->config_bias = config_bias_value[index];
-    display_test_reload_config(instance);
-}
-
-static void display_config_set_regulation_ratio(VariableItem* item) {
-    DisplayTest* instance = variable_item_get_context(item);
-    uint8_t index = variable_item_get_current_value_index(item);
-    variable_item_set_current_value_text(item, config_regulation_ratio_text[index]);
-    instance->config_regulation_ratio = config_regulation_ratio_value[index];
-    display_test_reload_config(instance);
-}
-
-static void display_config_set_contrast(VariableItem* item) {
-    DisplayTest* instance = variable_item_get_context(item);
-    uint8_t index = variable_item_get_current_value_index(item);
-    FuriString* temp;
-    temp = furi_string_alloc();
-    furi_string_cat_printf(temp, "%d", index);
-    variable_item_set_current_value_text(item, furi_string_get_cstr(temp));
-    furi_string_free(temp);
-    instance->config_contrast = index;
-    display_test_reload_config(instance);
-}
-
-DisplayTest* display_test_alloc() {
-    DisplayTest* instance = malloc(sizeof(DisplayTest));
-
-    View* view = NULL;
-
-    instance->gui = furi_record_open(RECORD_GUI);
-    instance->view_dispatcher = view_dispatcher_alloc();
-    view_dispatcher_enable_queue(instance->view_dispatcher);
-    view_dispatcher_attach_to_gui(
-        instance->view_dispatcher, instance->gui, ViewDispatcherTypeFullscreen);
-
-    // Test
-    instance->view_display_test = view_display_test_alloc();
-    view = view_display_test_get_view(instance->view_display_test);
-    view_set_previous_callback(view, display_test_previous_callback);
-    view_dispatcher_add_view(instance->view_dispatcher, DisplayTestViewDisplayTest, view);
-
-    // Configure
-    instance->variable_item_list = variable_item_list_alloc();
-    view = variable_item_list_get_view(instance->variable_item_list);
-    view_set_previous_callback(view, display_test_previous_callback);
-    view_dispatcher_add_view(instance->view_dispatcher, DisplayTestViewConfigure, view);
-
-    // Configuration items
-    VariableItem* item;
-    instance->config_bias = false;
-    instance->config_contrast = 32;
-    instance->config_regulation_ratio = 0b101;
-    // Bias
-    item = variable_item_list_add(
-        instance->variable_item_list,
-        "Bias:",
-        COUNT_OF(config_bias_value),
-        display_config_set_bias,
-        instance);
-    variable_item_set_current_value_index(item, 1);
-    variable_item_set_current_value_text(item, config_bias_text[1]);
-    // Regulation Ratio
-    item = variable_item_list_add(
-        instance->variable_item_list,
-        "Reg Ratio:",
-        COUNT_OF(config_regulation_ratio_value),
-        display_config_set_regulation_ratio,
-        instance);
-    variable_item_set_current_value_index(item, 5);
-    variable_item_set_current_value_text(item, config_regulation_ratio_text[5]);
-    // Contrast
-    item = variable_item_list_add(
-        instance->variable_item_list, "Contrast:", 64, display_config_set_contrast, instance);
-    variable_item_set_current_value_index(item, 32);
-    variable_item_set_current_value_text(item, "32");
-
-    // Menu
-    instance->submenu = submenu_alloc();
-    view = submenu_get_view(instance->submenu);
-    view_set_previous_callback(view, display_test_exit_callback);
-    view_dispatcher_add_view(instance->view_dispatcher, DisplayTestViewSubmenu, view);
-    submenu_add_item(
-        instance->submenu,
-        "Test",
-        DisplayTestViewDisplayTest,
-        display_test_submenu_callback,
-        instance);
-    submenu_add_item(
-        instance->submenu,
-        "Configure",
-        DisplayTestViewConfigure,
-        display_test_submenu_callback,
-        instance);
-
-    return instance;
-}
-
-void display_test_free(DisplayTest* instance) {
-    view_dispatcher_remove_view(instance->view_dispatcher, DisplayTestViewSubmenu);
-    submenu_free(instance->submenu);
-
-    view_dispatcher_remove_view(instance->view_dispatcher, DisplayTestViewConfigure);
-    variable_item_list_free(instance->variable_item_list);
-
-    view_dispatcher_remove_view(instance->view_dispatcher, DisplayTestViewDisplayTest);
-    view_display_test_free(instance->view_display_test);
-
-    view_dispatcher_free(instance->view_dispatcher);
-    furi_record_close(RECORD_GUI);
-
-    free(instance);
-}
-
-int32_t display_test_run(DisplayTest* instance) {
-    UNUSED(instance);
-    view_dispatcher_switch_to_view(instance->view_dispatcher, DisplayTestViewSubmenu);
-    view_dispatcher_run(instance->view_dispatcher);
-
-    return 0;
-}
-
-int32_t display_test_app(void* p) {
-    UNUSED(p);
-
-    DisplayTest* instance = display_test_alloc();
-
-    int32_t ret = display_test_run(instance);
-
-    display_test_free(instance);
-
-    return ret;
-}

+ 0 - 1
applications/debug/display_test/display_test.h

@@ -1 +0,0 @@
-#pragma once

+ 0 - 185
applications/debug/display_test/view_display_test.c

@@ -1,185 +0,0 @@
-#include "view_display_test.h"
-
-typedef struct {
-    uint32_t test;
-    uint32_t size;
-    uint32_t counter;
-    bool flip_flop;
-} ViewDisplayTestModel;
-
-struct ViewDisplayTest {
-    View* view;
-    FuriTimer* timer;
-};
-
-static void view_display_test_draw_callback_intro(Canvas* canvas, void* _model) {
-    UNUSED(_model);
-    canvas_draw_str(canvas, 12, 24, "Use < and > to switch tests");
-    canvas_draw_str(canvas, 12, 36, "Use ^ and v to switch size");
-    canvas_draw_str(canvas, 32, 48, "Use (o) to flip");
-}
-
-static void view_display_test_draw_callback_fill(Canvas* canvas, void* _model) {
-    ViewDisplayTestModel* model = _model;
-    if(model->flip_flop) {
-        uint8_t width = canvas_width(canvas);
-        uint8_t height = canvas_height(canvas);
-        canvas_draw_box(canvas, 0, 0, width, height);
-    }
-}
-
-static void view_display_test_draw_callback_hstripe(Canvas* canvas, void* _model) {
-    ViewDisplayTestModel* model = _model;
-    uint8_t block = 1 + model->size;
-    uint8_t width = canvas_width(canvas);
-    uint8_t height = canvas_height(canvas);
-
-    for(uint8_t y = model->flip_flop * block; y < height; y += 2 * block) {
-        canvas_draw_box(canvas, 0, y, width, block);
-    }
-}
-
-static void view_display_test_draw_callback_vstripe(Canvas* canvas, void* _model) {
-    ViewDisplayTestModel* model = _model;
-    uint8_t block = 1 + model->size;
-    uint8_t width = canvas_width(canvas);
-    uint8_t height = canvas_height(canvas);
-
-    for(uint8_t x = model->flip_flop * block; x < width; x += 2 * block) {
-        canvas_draw_box(canvas, x, 0, block, height);
-    }
-}
-
-static void view_display_test_draw_callback_check(Canvas* canvas, void* _model) {
-    ViewDisplayTestModel* model = _model;
-    uint8_t block = 1 + model->size;
-    uint8_t width = canvas_width(canvas);
-    uint8_t height = canvas_height(canvas);
-
-    bool flip_flop = model->flip_flop;
-    for(uint8_t x = 0; x < width; x += block) {
-        bool last_flip_flop = flip_flop;
-        for(uint8_t y = 0; y < height; y += block) {
-            if(flip_flop) {
-                canvas_draw_box(canvas, x, y, block, block);
-            }
-            flip_flop = !flip_flop;
-        }
-        if(last_flip_flop == flip_flop) {
-            flip_flop = !flip_flop;
-        }
-    }
-}
-
-static void view_display_test_draw_callback_move(Canvas* canvas, void* _model) {
-    ViewDisplayTestModel* model = _model;
-    uint8_t block = 1 + model->size;
-    uint8_t width = canvas_width(canvas) - block;
-    uint8_t height = canvas_height(canvas) - block;
-
-    uint8_t x = model->counter % width;
-    if((model->counter / width) % 2) {
-        x = width - x;
-    }
-
-    uint8_t y = model->counter % height;
-    if((model->counter / height) % 2) {
-        y = height - y;
-    }
-
-    canvas_draw_box(canvas, x, y, block, block);
-}
-
-const ViewDrawCallback view_display_test_tests[] = {
-    view_display_test_draw_callback_intro,
-    view_display_test_draw_callback_fill,
-    view_display_test_draw_callback_hstripe,
-    view_display_test_draw_callback_vstripe,
-    view_display_test_draw_callback_check,
-    view_display_test_draw_callback_move,
-};
-
-static void view_display_test_draw_callback(Canvas* canvas, void* _model) {
-    ViewDisplayTestModel* model = _model;
-    view_display_test_tests[model->test](canvas, _model);
-}
-
-static bool view_display_test_input_callback(InputEvent* event, void* context) {
-    ViewDisplayTest* instance = context;
-
-    bool consumed = false;
-    if(event->type == InputTypeShort || event->type == InputTypeRepeat) {
-        with_view_model(
-            instance->view,
-            ViewDisplayTestModel * model,
-            {
-                if(event->key == InputKeyLeft && model->test > 0) {
-                    model->test--;
-                    consumed = true;
-                } else if(
-                    event->key == InputKeyRight &&
-                    model->test < (COUNT_OF(view_display_test_tests) - 1)) {
-                    model->test++;
-                    consumed = true;
-                } else if(event->key == InputKeyDown && model->size > 0) {
-                    model->size--;
-                    consumed = true;
-                } else if(event->key == InputKeyUp && model->size < 24) {
-                    model->size++;
-                    consumed = true;
-                } else if(event->key == InputKeyOk) {
-                    model->flip_flop = !model->flip_flop;
-                    consumed = true;
-                }
-            },
-            consumed);
-    }
-
-    return consumed;
-}
-
-static void view_display_test_enter(void* context) {
-    ViewDisplayTest* instance = context;
-    furi_timer_start(instance->timer, furi_kernel_get_tick_frequency() / 32);
-}
-
-static void view_display_test_exit(void* context) {
-    ViewDisplayTest* instance = context;
-    furi_timer_stop(instance->timer);
-}
-
-static void view_display_test_timer_callback(void* context) {
-    ViewDisplayTest* instance = context;
-    with_view_model(
-        instance->view, ViewDisplayTestModel * model, { model->counter++; }, true);
-}
-
-ViewDisplayTest* view_display_test_alloc() {
-    ViewDisplayTest* instance = malloc(sizeof(ViewDisplayTest));
-
-    instance->view = view_alloc();
-    view_set_context(instance->view, instance);
-    view_allocate_model(instance->view, ViewModelTypeLockFree, sizeof(ViewDisplayTestModel));
-    view_set_draw_callback(instance->view, view_display_test_draw_callback);
-    view_set_input_callback(instance->view, view_display_test_input_callback);
-    view_set_enter_callback(instance->view, view_display_test_enter);
-    view_set_exit_callback(instance->view, view_display_test_exit);
-
-    instance->timer =
-        furi_timer_alloc(view_display_test_timer_callback, FuriTimerTypePeriodic, instance);
-
-    return instance;
-}
-
-void view_display_test_free(ViewDisplayTest* instance) {
-    furi_assert(instance);
-
-    furi_timer_free(instance->timer);
-    view_free(instance->view);
-    free(instance);
-}
-
-View* view_display_test_get_view(ViewDisplayTest* instance) {
-    furi_assert(instance);
-    return instance->view;
-}

+ 0 - 12
applications/debug/display_test/view_display_test.h

@@ -1,12 +0,0 @@
-#pragma once
-
-#include <stdint.h>
-#include <gui/view.h>
-
-typedef struct ViewDisplayTest ViewDisplayTest;
-
-ViewDisplayTest* view_display_test_alloc();
-
-void view_display_test_free(ViewDisplayTest* instance);
-
-View* view_display_test_get_view(ViewDisplayTest* instance);

+ 0 - 9
applications/debug/example_custom_font/application.fam

@@ -1,9 +0,0 @@
-App(
-    appid="example_custom_font",
-    name="Example: custom font",
-    apptype=FlipperAppType.DEBUG,
-    entry_point="example_custom_font_main",
-    requires=["gui"],
-    stack_size=1 * 1024,
-    fap_category="Debug",
-)

+ 0 - 98
applications/debug/example_custom_font/example_custom_font.c

@@ -1,98 +0,0 @@
-#include <furi.h>
-#include <furi_hal.h>
-
-#include <gui/gui.h>
-#include <input/input.h>
-
-//This arrays contains the font itself. You can use any u8g2 font you want
-
-/*
-Fontname: -Raccoon-Fixed4x6-Medium-R-Normal--6-60-75-75-P-40-ISO10646-1
-Copyright: 
-Glyphs: 95/203
-BBX Build Mode: 0
-*/
-const uint8_t u8g2_font_tom_thumb_4x6_tr[725] =
-    "_\0\2\2\2\3\3\4\4\3\6\0\377\5\377\5\0\0\352\1\330\2\270 \5\340\315\0!\6\265\310"
-    "\254\0\42\6\213\313$\25#\10\227\310\244\241\206\12$\10\227\310\215\70b\2%\10\227\310d\324F\1"
-    "&\10\227\310(\65R\22'\5\251\313\10(\6\266\310\251\62)\10\226\310\304\224\24\0*\6\217\312\244"
-    "\16+\7\217\311\245\225\0,\6\212\310)\0-\5\207\312\14.\5\245\310\4/\7\227\310Ve\4\60"
-    "\7\227\310-k\1\61\6\226\310\255\6\62\10\227\310h\220\312\1\63\11\227\310h\220\62X\0\64\10\227"
-    "\310$\65b\1\65\10\227\310\214\250\301\2\66\10\227\310\315\221F\0\67\10\227\310\314TF\0\70\10\227"
-    "\310\214\64\324\10\71\10\227\310\214\64\342\2:\6\255\311\244\0;\7\222\310e\240\0<\10\227\310\246\32"
-    "d\20=\6\217\311l\60>\11\227\310d\220A*\1\77\10\227\310\314\224a\2@\10\227\310UC\3"
-    "\1A\10\227\310UC\251\0B\10\227\310\250\264\322\2C\7\227\310\315\32\10D\10\227\310\250d-\0"
-    "E\10\227\310\214\70\342\0F\10\227\310\214\70b\4G\10\227\310\315\221\222\0H\10\227\310$\65\224\12"
-    "I\7\227\310\254X\15J\7\227\310\226\252\2K\10\227\310$\265\222\12L\7\227\310\304\346\0M\10\227"
-    "\310\244\61\224\12N\10\227\310\244q\250\0O\7\227\310UV\5P\10\227\310\250\264b\4Q\10\227\310"
-    "Uj$\1R\10\227\310\250\64V\1S\10\227\310m\220\301\2T\7\227\310\254\330\2U\7\227\310$"
-    "W\22V\10\227\310$\253L\0W\10\227\310$\65\206\12X\10\227\310$\325R\1Y\10\227\310$U"
-    "V\0Z\7\227\310\314T\16[\7\227\310\214X\16\134\10\217\311d\220A\0]\7\227\310\314r\4^"
-    "\5\213\313\65_\5\207\310\14`\6\212\313\304\0a\7\223\310\310\65\2b\10\227\310D\225\324\2c\7"
-    "\223\310\315\14\4d\10\227\310\246\245\222\0e\6\223\310\235\2f\10\227\310\246\264b\2g\10\227\307\35"
-    "\61%\0h\10\227\310D\225\254\0i\6\265\310\244\1j\10\233\307f\30U\5k\10\227\310\304\264T"
-    "\1l\7\227\310\310\326\0m\7\223\310<R\0n\7\223\310\250d\5o\7\223\310U\252\2p\10\227"
-    "\307\250\244V\4q\10\227\307-\225d\0r\6\223\310\315\22s\10\223\310\215\70\22\0t\10\227\310\245"
-    "\25\243\0u\7\223\310$+\11v\10\223\310$\65R\2w\7\223\310\244q\4x\7\223\310\244\62\25"
-    "y\11\227\307$\225dJ\0z\7\223\310\254\221\6{\10\227\310\251\32D\1|\6\265\310(\1}\11"
-    "\227\310\310\14RR\0~\6\213\313\215\4\0\0\0\4\377\377\0";
-
-// Screen is 128x64 px
-static void app_draw_callback(Canvas* canvas, void* ctx) {
-    UNUSED(ctx);
-
-    canvas_clear(canvas);
-
-    canvas_set_custom_u8g2_font(canvas, u8g2_font_tom_thumb_4x6_tr);
-
-    canvas_draw_str(canvas, 0, 6, "This is a tiny custom font");
-    canvas_draw_str(canvas, 0, 12, "012345.?! ,:;\"\'@#$%");
-}
-
-static void app_input_callback(InputEvent* input_event, void* ctx) {
-    furi_assert(ctx);
-
-    FuriMessageQueue* event_queue = ctx;
-    furi_message_queue_put(event_queue, input_event, FuriWaitForever);
-}
-
-int32_t example_custom_font_main(void* p) {
-    UNUSED(p);
-    FuriMessageQueue* event_queue = furi_message_queue_alloc(8, sizeof(InputEvent));
-
-    // Configure view port
-    ViewPort* view_port = view_port_alloc();
-    view_port_draw_callback_set(view_port, app_draw_callback, view_port);
-    view_port_input_callback_set(view_port, app_input_callback, event_queue);
-
-    // Register view port in GUI
-    Gui* gui = furi_record_open(RECORD_GUI);
-    gui_add_view_port(gui, view_port, GuiLayerFullscreen);
-
-    InputEvent event;
-
-    bool running = true;
-
-    while(running) {
-        if(furi_message_queue_get(event_queue, &event, 100) == FuriStatusOk) {
-            if((event.type == InputTypePress) || (event.type == InputTypeRepeat)) {
-                switch(event.key) {
-                case InputKeyBack:
-                    running = false;
-                    break;
-                default:
-                    break;
-                }
-            }
-        }
-    }
-
-    view_port_enabled_set(view_port, false);
-    gui_remove_view_port(gui, view_port);
-    view_port_free(view_port);
-    furi_message_queue_free(event_queue);
-
-    furi_record_close(RECORD_GUI);
-
-    return 0;
-}

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

@@ -1,12 +0,0 @@
-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",
-    fap_icon_assets="icons",
-)

+ 0 - 99
applications/debug/file_browser_test/file_browser_app.c

@@ -1,99 +0,0 @@
-#include "file_browser_app_i.h"
-#include <file_browser_test_icons.h>
-
-#include <gui/modules/file_browser.h>
-#include <storage/storage.h>
-#include <lib/toolbox/path.h>
-#include <furi.h>
-#include <furi_hal.h>
-
-static bool file_browser_app_custom_event_callback(void* context, uint32_t event) {
-    furi_assert(context);
-    FileBrowserApp* app = context;
-    return scene_manager_handle_custom_event(app->scene_manager, event);
-}
-
-static bool file_browser_app_back_event_callback(void* context) {
-    furi_assert(context);
-    FileBrowserApp* app = context;
-    return scene_manager_handle_back_event(app->scene_manager);
-}
-
-static void file_browser_app_tick_event_callback(void* context) {
-    furi_assert(context);
-    FileBrowserApp* app = context;
-    scene_manager_handle_tick_event(app->scene_manager);
-}
-
-FileBrowserApp* file_browser_app_alloc(char* arg) {
-    UNUSED(arg);
-    FileBrowserApp* app = malloc(sizeof(FileBrowserApp));
-
-    app->gui = furi_record_open(RECORD_GUI);
-    app->dialogs = furi_record_open(RECORD_DIALOGS);
-
-    app->view_dispatcher = view_dispatcher_alloc();
-    view_dispatcher_enable_queue(app->view_dispatcher);
-
-    app->scene_manager = scene_manager_alloc(&file_browser_scene_handlers, app);
-
-    view_dispatcher_set_event_callback_context(app->view_dispatcher, app);
-    view_dispatcher_set_tick_event_callback(
-        app->view_dispatcher, file_browser_app_tick_event_callback, 500);
-    view_dispatcher_set_custom_event_callback(
-        app->view_dispatcher, file_browser_app_custom_event_callback);
-    view_dispatcher_set_navigation_event_callback(
-        app->view_dispatcher, file_browser_app_back_event_callback);
-
-    app->widget = widget_alloc();
-
-    app->file_path = furi_string_alloc();
-    app->file_browser = file_browser_alloc(app->file_path);
-    file_browser_configure(app->file_browser, "*", NULL, true, false, &I_badusb_10px, true);
-
-    view_dispatcher_add_view(
-        app->view_dispatcher, FileBrowserAppViewStart, widget_get_view(app->widget));
-    view_dispatcher_add_view(
-        app->view_dispatcher, FileBrowserAppViewResult, widget_get_view(app->widget));
-    view_dispatcher_add_view(
-        app->view_dispatcher, FileBrowserAppViewBrowser, file_browser_get_view(app->file_browser));
-
-    view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
-
-    scene_manager_next_scene(app->scene_manager, FileBrowserSceneStart);
-
-    return app;
-}
-
-void file_browser_app_free(FileBrowserApp* app) {
-    furi_assert(app);
-
-    // Views
-    view_dispatcher_remove_view(app->view_dispatcher, FileBrowserAppViewStart);
-    view_dispatcher_remove_view(app->view_dispatcher, FileBrowserAppViewResult);
-    view_dispatcher_remove_view(app->view_dispatcher, FileBrowserAppViewBrowser);
-    widget_free(app->widget);
-    file_browser_free(app->file_browser);
-
-    // View dispatcher
-    view_dispatcher_free(app->view_dispatcher);
-    scene_manager_free(app->scene_manager);
-
-    // Close records
-    furi_record_close(RECORD_GUI);
-    furi_record_close(RECORD_NOTIFICATION);
-    furi_record_close(RECORD_DIALOGS);
-
-    furi_string_free(app->file_path);
-
-    free(app);
-}
-
-int32_t file_browser_app(void* p) {
-    FileBrowserApp* file_browser_app = file_browser_app_alloc((char*)p);
-
-    view_dispatcher_run(file_browser_app->view_dispatcher);
-
-    file_browser_app_free(file_browser_app);
-    return 0;
-}

+ 0 - 32
applications/debug/file_browser_test/file_browser_app_i.h

@@ -1,32 +0,0 @@
-#pragma once
-
-#include "scenes/file_browser_scene.h"
-
-#include <gui/gui.h>
-#include <gui/view_dispatcher.h>
-#include <gui/scene_manager.h>
-#include <gui/modules/submenu.h>
-#include <gui/modules/file_browser.h>
-#include <dialogs/dialogs.h>
-#include <notification/notification_messages.h>
-#include <gui/modules/variable_item_list.h>
-#include <gui/modules/widget.h>
-
-typedef struct FileBrowserApp FileBrowserApp;
-
-struct FileBrowserApp {
-    Gui* gui;
-    ViewDispatcher* view_dispatcher;
-    SceneManager* scene_manager;
-    DialogsApp* dialogs;
-    Widget* widget;
-    FileBrowser* file_browser;
-
-    FuriString* file_path;
-};
-
-typedef enum {
-    FileBrowserAppViewStart,
-    FileBrowserAppViewBrowser,
-    FileBrowserAppViewResult,
-} FileBrowserAppView;

BIN
applications/debug/file_browser_test/icons/badusb_10px.png


+ 0 - 30
applications/debug/file_browser_test/scenes/file_browser_scene.c

@@ -1,30 +0,0 @@
-#include "file_browser_scene.h"
-
-// Generate scene on_enter handlers array
-#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_enter,
-void (*const file_browser_scene_on_enter_handlers[])(void*) = {
-#include "file_browser_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Generate scene on_event handlers array
-#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_event,
-bool (*const file_browser_scene_on_event_handlers[])(void* context, SceneManagerEvent event) = {
-#include "file_browser_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Generate scene on_exit handlers array
-#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_exit,
-void (*const file_browser_scene_on_exit_handlers[])(void* context) = {
-#include "file_browser_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Initialize scene handlers configuration structure
-const SceneManagerHandlers file_browser_scene_handlers = {
-    .on_enter_handlers = file_browser_scene_on_enter_handlers,
-    .on_event_handlers = file_browser_scene_on_event_handlers,
-    .on_exit_handlers = file_browser_scene_on_exit_handlers,
-    .scene_num = FileBrowserSceneNum,
-};

+ 0 - 29
applications/debug/file_browser_test/scenes/file_browser_scene.h

@@ -1,29 +0,0 @@
-#pragma once
-
-#include <gui/scene_manager.h>
-
-// Generate scene id and total number
-#define ADD_SCENE(prefix, name, id) FileBrowserScene##id,
-typedef enum {
-#include "file_browser_scene_config.h"
-    FileBrowserSceneNum,
-} FileBrowserScene;
-#undef ADD_SCENE
-
-extern const SceneManagerHandlers file_browser_scene_handlers;
-
-// Generate scene on_enter handlers declaration
-#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_enter(void*);
-#include "file_browser_scene_config.h"
-#undef ADD_SCENE
-
-// Generate scene on_event handlers declaration
-#define ADD_SCENE(prefix, name, id) \
-    bool prefix##_scene_##name##_on_event(void* context, SceneManagerEvent event);
-#include "file_browser_scene_config.h"
-#undef ADD_SCENE
-
-// Generate scene on_exit handlers declaration
-#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_exit(void* context);
-#include "file_browser_scene_config.h"
-#undef ADD_SCENE

+ 0 - 40
applications/debug/file_browser_test/scenes/file_browser_scene_browser.c

@@ -1,40 +0,0 @@
-#include "../file_browser_app_i.h"
-#include <furi.h>
-
-#define DEFAULT_PATH "/"
-#define EXTENSION "*"
-
-bool file_browser_scene_browser_on_event(void* context, SceneManagerEvent event) {
-    UNUSED(context);
-    FileBrowserApp* app = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        scene_manager_next_scene(app->scene_manager, FileBrowserSceneResult);
-        consumed = true;
-    } else if(event.type == SceneManagerEventTypeTick) {
-    }
-    return consumed;
-}
-
-static void file_browser_callback(void* context) {
-    FileBrowserApp* app = context;
-    furi_assert(app);
-    view_dispatcher_send_custom_event(app->view_dispatcher, SceneManagerEventTypeCustom);
-}
-
-void file_browser_scene_browser_on_enter(void* context) {
-    FileBrowserApp* app = context;
-
-    file_browser_set_callback(app->file_browser, file_browser_callback, app);
-
-    file_browser_start(app->file_browser, app->file_path);
-
-    view_dispatcher_switch_to_view(app->view_dispatcher, FileBrowserAppViewBrowser);
-}
-
-void file_browser_scene_browser_on_exit(void* context) {
-    FileBrowserApp* app = context;
-
-    file_browser_stop(app->file_browser);
-}

+ 0 - 3
applications/debug/file_browser_test/scenes/file_browser_scene_config.h

@@ -1,3 +0,0 @@
-ADD_SCENE(file_browser, start, Start)
-ADD_SCENE(file_browser, browser, Browser)
-ADD_SCENE(file_browser, result, Result)

+ 0 - 41
applications/debug/file_browser_test/scenes/file_browser_scene_result.c

@@ -1,41 +0,0 @@
-#include "../file_browser_app_i.h"
-#include <furi.h>
-
-void file_browser_scene_result_ok_callback(InputType type, void* context) {
-    furi_assert(context);
-    FileBrowserApp* app = context;
-    view_dispatcher_send_custom_event(app->view_dispatcher, type);
-}
-
-bool file_browser_scene_result_on_event(void* context, SceneManagerEvent event) {
-    UNUSED(context);
-    //FileBrowserApp* app = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        consumed = true;
-    } else if(event.type == SceneManagerEventTypeTick) {
-    }
-    return consumed;
-}
-
-void file_browser_scene_result_on_enter(void* context) {
-    FileBrowserApp* app = context;
-
-    widget_add_string_multiline_element(
-        app->widget,
-        64,
-        10,
-        AlignCenter,
-        AlignTop,
-        FontSecondary,
-        furi_string_get_cstr(app->file_path));
-
-    view_dispatcher_switch_to_view(app->view_dispatcher, FileBrowserAppViewResult);
-}
-
-void file_browser_scene_result_on_exit(void* context) {
-    UNUSED(context);
-    FileBrowserApp* app = context;
-    widget_reset(app->widget);
-}

+ 0 - 46
applications/debug/file_browser_test/scenes/file_browser_scene_start.c

@@ -1,46 +0,0 @@
-#include "../file_browser_app_i.h"
-
-#include <furi_hal.h>
-#include <gui/modules/widget_elements/widget_element_i.h>
-#include <storage/storage.h>
-
-static void
-    file_browser_scene_start_ok_callback(GuiButtonType result, InputType type, void* context) {
-    UNUSED(result);
-    furi_assert(context);
-    FileBrowserApp* app = context;
-    if(type == InputTypeShort) {
-        view_dispatcher_send_custom_event(app->view_dispatcher, type);
-    }
-}
-
-bool file_browser_scene_start_on_event(void* context, SceneManagerEvent event) {
-    FileBrowserApp* app = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        furi_string_set(app->file_path, ANY_PATH("badusb/demo_windows.txt"));
-        scene_manager_next_scene(app->scene_manager, FileBrowserSceneBrowser);
-        consumed = true;
-    } else if(event.type == SceneManagerEventTypeTick) {
-    }
-    return consumed;
-}
-
-void file_browser_scene_start_on_enter(void* context) {
-    FileBrowserApp* app = context;
-
-    widget_add_string_multiline_element(
-        app->widget, 64, 20, AlignCenter, AlignTop, FontSecondary, "Press OK to start");
-
-    widget_add_button_element(
-        app->widget, GuiButtonTypeCenter, "Ok", file_browser_scene_start_ok_callback, app);
-
-    view_dispatcher_switch_to_view(app->view_dispatcher, FileBrowserAppViewStart);
-}
-
-void file_browser_scene_start_on_exit(void* context) {
-    UNUSED(context);
-    FileBrowserApp* app = context;
-    widget_reset(app->widget);
-}

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

@@ -1,11 +0,0 @@
-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 - 157
applications/debug/keypad_test/keypad_test.c

@@ -1,157 +0,0 @@
-#include <furi.h>
-#include <gui/gui.h>
-#include <input/input.h>
-
-#define TAG "KeypadTest"
-
-typedef struct {
-    bool press[5];
-    uint16_t up;
-    uint16_t down;
-    uint16_t left;
-    uint16_t right;
-    uint16_t ok;
-    FuriMutex* mutex;
-} KeypadTestState;
-
-static void keypad_test_reset_state(KeypadTestState* state) {
-    state->left = 0;
-    state->right = 0;
-    state->up = 0;
-    state->down = 0;
-    state->ok = 0;
-}
-
-static void keypad_test_render_callback(Canvas* canvas, void* ctx) {
-    KeypadTestState* state = ctx;
-    furi_mutex_acquire(state->mutex, FuriWaitForever);
-    canvas_clear(canvas);
-    char strings[5][20];
-
-    snprintf(strings[0], 20, "Ok: %d", state->ok);
-    snprintf(strings[1], 20, "L: %d", state->left);
-    snprintf(strings[2], 20, "R: %d", state->right);
-    snprintf(strings[3], 20, "U: %d", state->up);
-    snprintf(strings[4], 20, "D: %d", state->down);
-
-    canvas_set_font(canvas, FontPrimary);
-    canvas_draw_str(canvas, 0, 10, "Keypad test");
-
-    canvas_set_font(canvas, FontSecondary);
-    canvas_draw_str(canvas, 0, 24, strings[1]);
-    canvas_draw_str(canvas, 35, 24, strings[2]);
-    canvas_draw_str(canvas, 0, 36, strings[3]);
-    canvas_draw_str(canvas, 35, 36, strings[4]);
-    canvas_draw_str(canvas, 0, 48, strings[0]);
-    canvas_draw_circle(canvas, 100, 26, 25);
-
-    if(state->press[0]) canvas_draw_disc(canvas, 118, 26, 5);
-    if(state->press[1]) canvas_draw_disc(canvas, 82, 26, 5);
-    if(state->press[2]) canvas_draw_disc(canvas, 100, 8, 5);
-    if(state->press[3]) canvas_draw_disc(canvas, 100, 44, 5);
-    if(state->press[4]) canvas_draw_disc(canvas, 100, 26, 5);
-
-    canvas_draw_str(canvas, 10, 63, "[back] - reset, hold to exit");
-
-    furi_mutex_release(state->mutex);
-}
-
-static void keypad_test_input_callback(InputEvent* input_event, void* ctx) {
-    FuriMessageQueue* event_queue = ctx;
-    furi_message_queue_put(event_queue, input_event, FuriWaitForever);
-}
-
-int32_t keypad_test_app(void* p) {
-    UNUSED(p);
-    FuriMessageQueue* event_queue = furi_message_queue_alloc(32, sizeof(InputEvent));
-    furi_check(event_queue);
-
-    KeypadTestState state = {{false, false, false, false, false}, 0, 0, 0, 0, 0, NULL};
-    state.mutex = furi_mutex_alloc(FuriMutexTypeNormal);
-
-    if(!state.mutex) {
-        FURI_LOG_E(TAG, "cannot create mutex");
-        return 0;
-    }
-
-    ViewPort* view_port = view_port_alloc();
-
-    view_port_draw_callback_set(view_port, keypad_test_render_callback, &state);
-    view_port_input_callback_set(view_port, keypad_test_input_callback, event_queue);
-
-    // Open GUI and register view_port
-    Gui* gui = furi_record_open(RECORD_GUI);
-    gui_add_view_port(gui, view_port, GuiLayerFullscreen);
-
-    InputEvent event;
-    while(furi_message_queue_get(event_queue, &event, FuriWaitForever) == FuriStatusOk) {
-        furi_mutex_acquire(state.mutex, FuriWaitForever);
-        FURI_LOG_I(
-            TAG,
-            "key: %s type: %s",
-            input_get_key_name(event.key),
-            input_get_type_name(event.type));
-
-        if(event.key == InputKeyRight) {
-            if(event.type == InputTypePress) {
-                state.press[0] = true;
-            } else if(event.type == InputTypeRelease) {
-                state.press[0] = false;
-            } else if(event.type == InputTypeShort) {
-                ++state.right;
-            }
-        } else if(event.key == InputKeyLeft) {
-            if(event.type == InputTypePress) {
-                state.press[1] = true;
-            } else if(event.type == InputTypeRelease) {
-                state.press[1] = false;
-            } else if(event.type == InputTypeShort) {
-                ++state.left;
-            }
-        } else if(event.key == InputKeyUp) {
-            if(event.type == InputTypePress) {
-                state.press[2] = true;
-            } else if(event.type == InputTypeRelease) {
-                state.press[2] = false;
-            } else if(event.type == InputTypeShort) {
-                ++state.up;
-            }
-        } else if(event.key == InputKeyDown) {
-            if(event.type == InputTypePress) {
-                state.press[3] = true;
-            } else if(event.type == InputTypeRelease) {
-                state.press[3] = false;
-            } else if(event.type == InputTypeShort) {
-                ++state.down;
-            }
-        } else if(event.key == InputKeyOk) {
-            if(event.type == InputTypePress) {
-                state.press[4] = true;
-            } else if(event.type == InputTypeRelease) {
-                state.press[4] = false;
-            } else if(event.type == InputTypeShort) {
-                ++state.ok;
-            }
-        } else if(event.key == InputKeyBack) {
-            if(event.type == InputTypeLong) {
-                furi_mutex_release(state.mutex);
-                break;
-            } else if(event.type == InputTypeShort) {
-                keypad_test_reset_state(&state);
-            }
-        }
-
-        furi_mutex_release(state.mutex);
-        view_port_update(view_port);
-    }
-
-    // remove & free all stuff created by app
-    gui_remove_view_port(gui, view_port);
-    view_port_free(view_port);
-    furi_message_queue_free(event_queue);
-    furi_mutex_free(state.mutex);
-
-    furi_record_close(RECORD_GUI);
-
-    return 0;
-}

+ 0 - 16
applications/debug/lfrfid_debug/application.fam

@@ -1,16 +0,0 @@
-App(
-    appid="lfrfid_debug",
-    name="LF-RFID Debug",
-    apptype=FlipperAppType.DEBUG,
-    targets=["f7"],
-    entry_point="lfrfid_debug_app",
-    requires=[
-        "gui",
-    ],
-    provides=[
-        "lfrfid_debug",
-    ],
-    stack_size=1 * 1024,
-    order=100,
-    fap_category="Debug",
-)

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

@@ -1,81 +0,0 @@
-#include "lfrfid_debug_i.h"
-
-static bool lfrfid_debug_custom_event_callback(void* context, uint32_t event) {
-    furi_assert(context);
-    LfRfidDebug* app = context;
-    return scene_manager_handle_custom_event(app->scene_manager, event);
-}
-
-static bool lfrfid_debug_back_event_callback(void* context) {
-    furi_assert(context);
-    LfRfidDebug* app = context;
-    return scene_manager_handle_back_event(app->scene_manager);
-}
-
-static LfRfidDebug* lfrfid_debug_alloc() {
-    LfRfidDebug* app = malloc(sizeof(LfRfidDebug));
-
-    app->view_dispatcher = view_dispatcher_alloc();
-    app->scene_manager = scene_manager_alloc(&lfrfid_debug_scene_handlers, app);
-    view_dispatcher_enable_queue(app->view_dispatcher);
-    view_dispatcher_set_event_callback_context(app->view_dispatcher, app);
-    view_dispatcher_set_custom_event_callback(
-        app->view_dispatcher, lfrfid_debug_custom_event_callback);
-    view_dispatcher_set_navigation_event_callback(
-        app->view_dispatcher, lfrfid_debug_back_event_callback);
-
-    // Open GUI record
-    app->gui = furi_record_open(RECORD_GUI);
-    view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
-
-    // Submenu
-    app->submenu = submenu_alloc();
-    view_dispatcher_add_view(
-        app->view_dispatcher, LfRfidDebugViewSubmenu, submenu_get_view(app->submenu));
-
-    // Tune view
-    app->tune_view = lfrfid_debug_view_tune_alloc();
-    view_dispatcher_add_view(
-        app->view_dispatcher,
-        LfRfidDebugViewTune,
-        lfrfid_debug_view_tune_get_view(app->tune_view));
-
-    return app;
-}
-
-static void lfrfid_debug_free(LfRfidDebug* app) {
-    furi_assert(app);
-
-    // Submenu
-    view_dispatcher_remove_view(app->view_dispatcher, LfRfidDebugViewSubmenu);
-    submenu_free(app->submenu);
-
-    // Tune view
-    view_dispatcher_remove_view(app->view_dispatcher, LfRfidDebugViewTune);
-    lfrfid_debug_view_tune_free(app->tune_view);
-
-    // View Dispatcher
-    view_dispatcher_free(app->view_dispatcher);
-
-    // Scene Manager
-    scene_manager_free(app->scene_manager);
-
-    // GUI
-    furi_record_close(RECORD_GUI);
-    app->gui = NULL;
-
-    free(app);
-}
-
-int32_t lfrfid_debug_app(void* p) {
-    UNUSED(p);
-    LfRfidDebug* app = lfrfid_debug_alloc();
-
-    scene_manager_next_scene(app->scene_manager, LfRfidDebugSceneStart);
-
-    view_dispatcher_run(app->view_dispatcher);
-
-    lfrfid_debug_free(app);
-
-    return 0;
-}

+ 0 - 30
applications/debug/lfrfid_debug/lfrfid_debug_i.h

@@ -1,30 +0,0 @@
-#pragma once
-#include <furi.h>
-#include <furi_hal.h>
-
-#include <gui/gui.h>
-#include <gui/view.h>
-#include <gui/view_dispatcher.h>
-#include <gui/scene_manager.h>
-
-#include <gui/modules/submenu.h>
-
-#include "views/lfrfid_debug_view_tune.h"
-#include "scenes/lfrfid_debug_scene.h"
-
-typedef struct LfRfidDebug LfRfidDebug;
-
-struct LfRfidDebug {
-    Gui* gui;
-    ViewDispatcher* view_dispatcher;
-    SceneManager* scene_manager;
-
-    // Common Views
-    Submenu* submenu;
-    LfRfidTuneView* tune_view;
-};
-
-typedef enum {
-    LfRfidDebugViewSubmenu,
-    LfRfidDebugViewTune,
-} LfRfidDebugView;

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

@@ -1,44 +0,0 @@
-#include "../lfrfid_debug_i.h"
-
-typedef enum {
-    SubmenuIndexTune,
-} SubmenuIndex;
-
-static void lfrfid_debug_scene_start_submenu_callback(void* context, uint32_t index) {
-    LfRfidDebug* app = context;
-
-    view_dispatcher_send_custom_event(app->view_dispatcher, index);
-}
-
-void lfrfid_debug_scene_start_on_enter(void* context) {
-    LfRfidDebug* app = context;
-    Submenu* submenu = app->submenu;
-
-    submenu_add_item(
-        submenu, "Tune", SubmenuIndexTune, lfrfid_debug_scene_start_submenu_callback, app);
-
-    submenu_set_selected_item(
-        submenu, scene_manager_get_scene_state(app->scene_manager, LfRfidDebugSceneStart));
-
-    view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidDebugViewSubmenu);
-}
-
-bool lfrfid_debug_scene_start_on_event(void* context, SceneManagerEvent event) {
-    LfRfidDebug* app = context;
-    bool consumed = false;
-
-    if(event.type == SceneManagerEventTypeCustom) {
-        if(event.event == SubmenuIndexTune) {
-            scene_manager_next_scene(app->scene_manager, LfRfidDebugSceneTune);
-            consumed = true;
-        }
-    }
-
-    return consumed;
-}
-
-void lfrfid_debug_scene_start_on_exit(void* context) {
-    LfRfidDebug* app = context;
-
-    submenu_reset(app->submenu);
-}

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

@@ -1,48 +0,0 @@
-#include "../lfrfid_debug_i.h"
-#include <furi_hal.h>
-
-static void comparator_trigger_callback(bool level, void* comp_ctx) {
-    UNUSED(comp_ctx);
-    furi_hal_gpio_write(&gpio_ext_pa7, !level);
-}
-
-void lfrfid_debug_scene_tune_on_enter(void* context) {
-    LfRfidDebug* app = context;
-
-    furi_hal_gpio_init_simple(&gpio_ext_pa7, GpioModeOutputPushPull);
-
-    furi_hal_rfid_comp_set_callback(comparator_trigger_callback, app);
-    furi_hal_rfid_comp_start();
-
-    furi_hal_rfid_pins_read();
-    furi_hal_rfid_tim_read(125000, 0.5);
-    furi_hal_rfid_tim_read_start();
-
-    view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidDebugViewTune);
-}
-
-bool lfrfid_debug_scene_tune_on_event(void* context, SceneManagerEvent event) {
-    UNUSED(event);
-
-    LfRfidDebug* app = context;
-    bool consumed = false;
-
-    if(lfrfid_debug_view_tune_is_dirty(app->tune_view)) {
-        furi_hal_rfid_set_read_period(lfrfid_debug_view_tune_get_arr(app->tune_view));
-        furi_hal_rfid_set_read_pulse(lfrfid_debug_view_tune_get_ccr(app->tune_view));
-    }
-
-    return consumed;
-}
-
-void lfrfid_debug_scene_tune_on_exit(void* context) {
-    UNUSED(context);
-
-    furi_hal_rfid_comp_stop();
-    furi_hal_rfid_comp_set_callback(NULL, NULL);
-
-    furi_hal_gpio_init_simple(&gpio_ext_pa7, GpioModeAnalog);
-    furi_hal_rfid_tim_read_stop();
-    furi_hal_rfid_tim_reset();
-    furi_hal_rfid_pins_reset();
-}

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

@@ -1,30 +0,0 @@
-#include "lfrfid_debug_scene.h"
-
-// Generate scene on_enter handlers array
-#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_enter,
-void (*const lfrfid_debug_on_enter_handlers[])(void*) = {
-#include "lfrfid_debug_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Generate scene on_event handlers array
-#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_event,
-bool (*const lfrfid_debug_on_event_handlers[])(void* context, SceneManagerEvent event) = {
-#include "lfrfid_debug_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Generate scene on_exit handlers array
-#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_exit,
-void (*const lfrfid_debug_on_exit_handlers[])(void* context) = {
-#include "lfrfid_debug_scene_config.h"
-};
-#undef ADD_SCENE
-
-// Initialize scene handlers configuration structure
-const SceneManagerHandlers lfrfid_debug_scene_handlers = {
-    .on_enter_handlers = lfrfid_debug_on_enter_handlers,
-    .on_event_handlers = lfrfid_debug_on_event_handlers,
-    .on_exit_handlers = lfrfid_debug_on_exit_handlers,
-    .scene_num = LfRfidDebugSceneNum,
-};

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

@@ -1,29 +0,0 @@
-#pragma once
-
-#include <gui/scene_manager.h>
-
-// Generate scene id and total number
-#define ADD_SCENE(prefix, name, id) LfRfidDebugScene##id,
-typedef enum {
-#include "lfrfid_debug_scene_config.h"
-    LfRfidDebugSceneNum,
-} LfRfidDebugScene;
-#undef ADD_SCENE
-
-extern const SceneManagerHandlers lfrfid_debug_scene_handlers;
-
-// Generate scene on_enter handlers declaration
-#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_enter(void*);
-#include "lfrfid_debug_scene_config.h"
-#undef ADD_SCENE
-
-// Generate scene on_event handlers declaration
-#define ADD_SCENE(prefix, name, id) \
-    bool prefix##_scene_##name##_on_event(void* context, SceneManagerEvent event);
-#include "lfrfid_debug_scene_config.h"
-#undef ADD_SCENE
-
-// Generate scene on_exit handlers declaration
-#define ADD_SCENE(prefix, name, id) void prefix##_scene_##name##_on_exit(void* context);
-#include "lfrfid_debug_scene_config.h"
-#undef ADD_SCENE

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

@@ -1,2 +0,0 @@
-ADD_SCENE(lfrfid_debug, start, Start)
-ADD_SCENE(lfrfid_debug, tune, Tune)

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

@@ -1,234 +0,0 @@
-#include "lfrfid_debug_view_tune.h"
-#include <gui/elements.h>
-
-#define TEMP_STR_LEN 128
-
-struct LfRfidTuneView {
-    View* view;
-};
-
-typedef struct {
-    bool dirty;
-    bool fine;
-    uint32_t ARR;
-    uint32_t CCR;
-    int pos;
-} LfRfidTuneViewModel;
-
-static void lfrfid_debug_view_tune_draw_callback(Canvas* canvas, void* _model) {
-    LfRfidTuneViewModel* model = _model;
-    canvas_set_color(canvas, ColorBlack);
-
-    if(model->fine) {
-        canvas_draw_box(
-            canvas,
-            128 - canvas_string_width(canvas, "Fine") - 4,
-            0,
-            canvas_string_width(canvas, "Fine") + 4,
-            canvas_current_font_height(canvas) + 1);
-        canvas_set_color(canvas, ColorWhite);
-    }
-    canvas_draw_str_aligned(canvas, 128 - 2, 2, AlignRight, AlignTop, "Fine");
-    canvas_set_color(canvas, ColorBlack);
-
-    char buffer[TEMP_STR_LEN + 1];
-    double freq = ((float)SystemCoreClock / ((float)model->ARR + 1));
-    double duty = ((float)model->CCR + 1) / ((float)model->ARR + 1) * 100.0f;
-    snprintf(
-        buffer,
-        TEMP_STR_LEN,
-        "%sARR: %lu\n"
-        "freq = %.4f\n"
-        "%sCCR: %lu\n"
-        "duty = %.4f",
-        model->pos == 0 ? ">" : "",
-        model->ARR,
-        freq,
-        model->pos == 1 ? ">" : "",
-        model->CCR,
-        duty);
-    elements_multiline_text_aligned(canvas, 2, 2, AlignLeft, AlignTop, buffer);
-}
-
-static void lfrfid_debug_view_tune_button_up(LfRfidTuneView* tune_view) {
-    with_view_model(
-        tune_view->view,
-        LfRfidTuneViewModel * model,
-        {
-            if(model->pos > 0) model->pos--;
-        },
-        true);
-}
-
-static void lfrfid_debug_view_tune_button_down(LfRfidTuneView* tune_view) {
-    with_view_model(
-        tune_view->view,
-        LfRfidTuneViewModel * model,
-        {
-            if(model->pos < 1) model->pos++;
-        },
-        true);
-}
-
-static void lfrfid_debug_view_tune_button_left(LfRfidTuneView* tune_view) {
-    with_view_model(
-        tune_view->view,
-        LfRfidTuneViewModel * model,
-        {
-            if(model->pos == 0) {
-                if(model->fine) {
-                    model->ARR -= 1;
-                } else {
-                    model->ARR -= 10;
-                }
-            } else if(model->pos == 1) {
-                if(model->fine) {
-                    model->CCR -= 1;
-                } else {
-                    model->CCR -= 10;
-                }
-            }
-
-            model->dirty = true;
-        },
-        true);
-}
-
-static void lfrfid_debug_view_tune_button_right(LfRfidTuneView* tune_view) {
-    with_view_model(
-        tune_view->view,
-        LfRfidTuneViewModel * model,
-        {
-            if(model->pos == 0) {
-                if(model->fine) {
-                    model->ARR += 1;
-                } else {
-                    model->ARR += 10;
-                }
-            } else if(model->pos == 1) {
-                if(model->fine) {
-                    model->CCR += 1;
-                } else {
-                    model->CCR += 10;
-                }
-            }
-
-            model->dirty = true;
-        },
-        true);
-}
-
-static void lfrfid_debug_view_tune_button_ok(LfRfidTuneView* tune_view) {
-    with_view_model(
-        tune_view->view, LfRfidTuneViewModel * model, { model->fine = !model->fine; }, true);
-}
-
-static bool lfrfid_debug_view_tune_input_callback(InputEvent* event, void* context) {
-    LfRfidTuneView* tune_view = context;
-    bool consumed = false;
-
-    // Process key presses only
-    if(event->type == InputTypeShort || event->type == InputTypeRepeat) {
-        consumed = true;
-
-        switch(event->key) {
-        case InputKeyLeft:
-            lfrfid_debug_view_tune_button_left(tune_view);
-            break;
-        case InputKeyRight:
-            lfrfid_debug_view_tune_button_right(tune_view);
-            break;
-        case InputKeyUp:
-            lfrfid_debug_view_tune_button_up(tune_view);
-            break;
-        case InputKeyDown:
-            lfrfid_debug_view_tune_button_down(tune_view);
-            break;
-        case InputKeyOk:
-            lfrfid_debug_view_tune_button_ok(tune_view);
-            break;
-        default:
-            consumed = false;
-            break;
-        }
-    }
-
-    return consumed;
-}
-
-LfRfidTuneView* lfrfid_debug_view_tune_alloc() {
-    LfRfidTuneView* tune_view = malloc(sizeof(LfRfidTuneView));
-    tune_view->view = view_alloc();
-    view_set_context(tune_view->view, tune_view);
-    view_allocate_model(tune_view->view, ViewModelTypeLocking, sizeof(LfRfidTuneViewModel));
-
-    with_view_model(
-        tune_view->view,
-        LfRfidTuneViewModel * model,
-        {
-            model->dirty = true;
-            model->fine = false;
-            model->ARR = 511;
-            model->CCR = 255;
-            model->pos = 0;
-        },
-        true);
-
-    view_set_draw_callback(tune_view->view, lfrfid_debug_view_tune_draw_callback);
-    view_set_input_callback(tune_view->view, lfrfid_debug_view_tune_input_callback);
-
-    return tune_view;
-}
-
-void lfrfid_debug_view_tune_free(LfRfidTuneView* tune_view) {
-    view_free(tune_view->view);
-    free(tune_view);
-}
-
-View* lfrfid_debug_view_tune_get_view(LfRfidTuneView* tune_view) {
-    return tune_view->view;
-}
-
-void lfrfid_debug_view_tune_clean(LfRfidTuneView* tune_view) {
-    with_view_model(
-        tune_view->view,
-        LfRfidTuneViewModel * model,
-        {
-            model->dirty = true;
-            model->fine = false;
-            model->ARR = 511;
-            model->CCR = 255;
-            model->pos = 0;
-        },
-        true);
-}
-
-bool lfrfid_debug_view_tune_is_dirty(LfRfidTuneView* tune_view) {
-    bool result = false;
-    with_view_model(
-        tune_view->view,
-        LfRfidTuneViewModel * model,
-        {
-            result = model->dirty;
-            model->dirty = false;
-        },
-        false);
-
-    return result;
-}
-
-uint32_t lfrfid_debug_view_tune_get_arr(LfRfidTuneView* tune_view) {
-    uint32_t result = false;
-    with_view_model(
-        tune_view->view, LfRfidTuneViewModel * model, { result = model->ARR; }, false);
-
-    return result;
-}
-
-uint32_t lfrfid_debug_view_tune_get_ccr(LfRfidTuneView* tune_view) {
-    uint32_t result = false;
-    with_view_model(
-        tune_view->view, LfRfidTuneViewModel * model, { result = model->CCR; }, false);
-
-    return result;
-}

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

@@ -1,18 +0,0 @@
-#pragma once
-#include <gui/view.h>
-
-typedef struct LfRfidTuneView LfRfidTuneView;
-
-LfRfidTuneView* lfrfid_debug_view_tune_alloc();
-
-void lfrfid_debug_view_tune_free(LfRfidTuneView* tune_view);
-
-View* lfrfid_debug_view_tune_get_view(LfRfidTuneView* tune_view);
-
-void lfrfid_debug_view_tune_clean(LfRfidTuneView* tune_view);
-
-bool lfrfid_debug_view_tune_is_dirty(LfRfidTuneView* tune_view);
-
-uint32_t lfrfid_debug_view_tune_get_arr(LfRfidTuneView* tune_view);
-
-uint32_t lfrfid_debug_view_tune_get_ccr(LfRfidTuneView* tune_view);

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

@@ -1,11 +0,0 @@
-App(
-    appid="locale_test",
-    name="Locale Test",
-    apptype=FlipperAppType.DEBUG,
-    entry_point="locale_test_app",
-    cdefines=["APP_LOCALE"],
-    requires=["gui", "locale"],
-    stack_size=2 * 1024,
-    order=70,
-    fap_category="Debug",
-)

+ 0 - 102
applications/debug/locale_test/locale_test.c

@@ -1,102 +0,0 @@
-#include <furi.h>
-#include <gui/gui.h>
-#include <gui/elements.h>
-#include <gui/view_dispatcher.h>
-#include <gui/modules/dialog_ex.h>
-#include <locale/locale.h>
-
-typedef struct {
-    Gui* gui;
-    ViewDispatcher* view_dispatcher;
-    View* view;
-} LocaleTestApp;
-
-static void locale_test_view_draw_callback(Canvas* canvas, void* _model) {
-    UNUSED(_model);
-
-    // Prepare canvas
-    canvas_set_color(canvas, ColorBlack);
-    canvas_set_font(canvas, FontSecondary);
-
-    FuriString* tmp_string = furi_string_alloc();
-
-    float temp = 25.3f;
-    LocaleMeasurementUnits units = locale_get_measurement_unit();
-    if(units == LocaleMeasurementUnitsMetric) {
-        furi_string_printf(tmp_string, "Temp: %5.1fC", (double)temp);
-    } else {
-        temp = locale_celsius_to_fahrenheit(temp);
-        furi_string_printf(tmp_string, "Temp: %5.1fF", (double)temp);
-    }
-    canvas_draw_str(canvas, 0, 10, furi_string_get_cstr(tmp_string));
-
-    FuriHalRtcDateTime datetime;
-    furi_hal_rtc_get_datetime(&datetime);
-
-    locale_format_time(tmp_string, &datetime, locale_get_time_format(), false);
-    canvas_draw_str(canvas, 0, 25, furi_string_get_cstr(tmp_string));
-
-    locale_format_date(tmp_string, &datetime, locale_get_date_format(), "/");
-    canvas_draw_str(canvas, 0, 40, furi_string_get_cstr(tmp_string));
-
-    furi_string_free(tmp_string);
-}
-
-static bool locale_test_view_input_callback(InputEvent* event, void* context) {
-    UNUSED(event);
-    UNUSED(context);
-    return false;
-}
-
-static uint32_t locale_test_exit(void* context) {
-    UNUSED(context);
-    return VIEW_NONE;
-}
-
-static LocaleTestApp* locale_test_alloc() {
-    LocaleTestApp* app = malloc(sizeof(LocaleTestApp));
-
-    // Gui
-    app->gui = furi_record_open(RECORD_GUI);
-
-    // View dispatcher
-    app->view_dispatcher = view_dispatcher_alloc();
-    view_dispatcher_enable_queue(app->view_dispatcher);
-    view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
-
-    // Views
-    app->view = view_alloc();
-    view_set_draw_callback(app->view, locale_test_view_draw_callback);
-    view_set_input_callback(app->view, locale_test_view_input_callback);
-
-    view_set_previous_callback(app->view, locale_test_exit);
-    view_dispatcher_add_view(app->view_dispatcher, 0, app->view);
-    view_dispatcher_switch_to_view(app->view_dispatcher, 0);
-
-    return app;
-}
-
-static void locale_test_free(LocaleTestApp* app) {
-    furi_assert(app);
-
-    // Free views
-    view_dispatcher_remove_view(app->view_dispatcher, 0);
-
-    view_free(app->view);
-    view_dispatcher_free(app->view_dispatcher);
-
-    // Close gui record
-    furi_record_close(RECORD_GUI);
-    app->gui = NULL;
-
-    // Free rest
-    free(app);
-}
-
-int32_t locale_test_app(void* p) {
-    UNUSED(p);
-    LocaleTestApp* app = locale_test_alloc();
-    view_dispatcher_run(app->view_dispatcher);
-    locale_test_free(app);
-    return 0;
-}

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است