mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 15:48:35 -07:00
Merge remote-tracking branch 'upstream/dev' into shutdown_idle
This commit is contained in:
151
.clang-format
151
.clang-format
@@ -1,86 +1,191 @@
|
|||||||
|
---
|
||||||
|
Language: Cpp
|
||||||
AccessModifierOffset: -4
|
AccessModifierOffset: -4
|
||||||
AlignAfterOpenBracket: AlwaysBreak
|
AlignAfterOpenBracket: AlwaysBreak
|
||||||
AlignConsecutiveAssignments: false
|
AlignArrayOfStructures: None
|
||||||
AlignConsecutiveDeclarations: false
|
AlignConsecutiveMacros: None
|
||||||
|
AlignConsecutiveAssignments: None
|
||||||
|
AlignConsecutiveBitFields: None
|
||||||
|
AlignConsecutiveDeclarations: None
|
||||||
AlignEscapedNewlines: Left
|
AlignEscapedNewlines: Left
|
||||||
AlignOperands: true
|
AlignOperands: Align
|
||||||
AlignTrailingComments: false
|
AlignTrailingComments: false
|
||||||
|
AllowAllArgumentsOnNextLine: true
|
||||||
AllowAllParametersOfDeclarationOnNextLine: false
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
|
AllowShortEnumsOnASingleLine: true
|
||||||
AllowShortBlocksOnASingleLine: Never
|
AllowShortBlocksOnASingleLine: Never
|
||||||
AllowShortCaseLabelsOnASingleLine: false
|
AllowShortCaseLabelsOnASingleLine: false
|
||||||
AllowShortFunctionsOnASingleLine: None
|
AllowShortFunctionsOnASingleLine: None
|
||||||
AllowShortIfStatementsOnASingleLine: true
|
AllowShortLambdasOnASingleLine: All
|
||||||
|
AllowShortIfStatementsOnASingleLine: WithoutElse
|
||||||
AllowShortLoopsOnASingleLine: true
|
AllowShortLoopsOnASingleLine: true
|
||||||
AlwaysBreakAfterDefinitionReturnType: None
|
AlwaysBreakAfterDefinitionReturnType: None
|
||||||
AlwaysBreakAfterReturnType: None
|
AlwaysBreakAfterReturnType: None
|
||||||
AlwaysBreakBeforeMultilineStrings: false
|
AlwaysBreakBeforeMultilineStrings: false
|
||||||
AlwaysBreakTemplateDeclarations: false
|
AlwaysBreakTemplateDeclarations: Yes
|
||||||
|
AttributeMacros:
|
||||||
|
- __capability
|
||||||
BinPackArguments: false
|
BinPackArguments: false
|
||||||
BinPackParameters: false
|
BinPackParameters: false
|
||||||
|
BraceWrapping:
|
||||||
|
AfterCaseLabel: false
|
||||||
|
AfterClass: false
|
||||||
|
AfterControlStatement: Never
|
||||||
|
AfterEnum: false
|
||||||
|
AfterFunction: false
|
||||||
|
AfterNamespace: false
|
||||||
|
AfterObjCDeclaration: false
|
||||||
|
AfterStruct: false
|
||||||
|
AfterUnion: false
|
||||||
|
AfterExternBlock: false
|
||||||
|
BeforeCatch: false
|
||||||
|
BeforeElse: false
|
||||||
|
BeforeLambdaBody: false
|
||||||
|
BeforeWhile: false
|
||||||
|
IndentBraces: false
|
||||||
|
SplitEmptyFunction: true
|
||||||
|
SplitEmptyRecord: true
|
||||||
|
SplitEmptyNamespace: true
|
||||||
BreakBeforeBinaryOperators: None
|
BreakBeforeBinaryOperators: None
|
||||||
|
BreakBeforeConceptDeclarations: true
|
||||||
BreakBeforeBraces: Attach
|
BreakBeforeBraces: Attach
|
||||||
|
BreakBeforeInheritanceComma: false
|
||||||
|
BreakInheritanceList: BeforeColon
|
||||||
BreakBeforeTernaryOperators: false
|
BreakBeforeTernaryOperators: false
|
||||||
|
BreakConstructorInitializersBeforeComma: false
|
||||||
BreakConstructorInitializers: BeforeComma
|
BreakConstructorInitializers: BeforeComma
|
||||||
|
BreakAfterJavaFieldAnnotations: false
|
||||||
BreakStringLiterals: false
|
BreakStringLiterals: false
|
||||||
ColumnLimit: 99
|
ColumnLimit: 99
|
||||||
|
CommentPragmas: '^ IWYU pragma:'
|
||||||
|
QualifierAlignment: Leave
|
||||||
CompactNamespaces: false
|
CompactNamespaces: false
|
||||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
|
||||||
ConstructorInitializerIndentWidth: 4
|
ConstructorInitializerIndentWidth: 4
|
||||||
ContinuationIndentWidth: 4
|
ContinuationIndentWidth: 4
|
||||||
Cpp11BracedListStyle: true
|
Cpp11BracedListStyle: true
|
||||||
|
DeriveLineEnding: true
|
||||||
DerivePointerAlignment: false
|
DerivePointerAlignment: false
|
||||||
DisableFormat: false
|
DisableFormat: false
|
||||||
|
EmptyLineAfterAccessModifier: Never
|
||||||
|
EmptyLineBeforeAccessModifier: LogicalBlock
|
||||||
ExperimentalAutoDetectBinPacking: false
|
ExperimentalAutoDetectBinPacking: false
|
||||||
|
PackConstructorInitializers: BinPack
|
||||||
|
BasedOnStyle: ''
|
||||||
|
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||||
|
AllowAllConstructorInitializersOnNextLine: true
|
||||||
FixNamespaceComments: false
|
FixNamespaceComments: false
|
||||||
|
ForEachMacros:
|
||||||
IncludeBlocks: Preserve
|
- foreach
|
||||||
|
- Q_FOREACH
|
||||||
|
- BOOST_FOREACH
|
||||||
|
IfMacros:
|
||||||
|
- KJ_IF_MAYBE
|
||||||
|
IncludeBlocks: Preserve
|
||||||
IncludeCategories:
|
IncludeCategories:
|
||||||
- Regex: '.*'
|
- Regex: '.*'
|
||||||
Priority: 1
|
Priority: 1
|
||||||
|
SortPriority: 0
|
||||||
|
CaseSensitive: false
|
||||||
|
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
||||||
|
Priority: 3
|
||||||
|
SortPriority: 0
|
||||||
|
CaseSensitive: false
|
||||||
|
- Regex: '.*'
|
||||||
|
Priority: 1
|
||||||
|
SortPriority: 0
|
||||||
|
CaseSensitive: false
|
||||||
IncludeIsMainRegex: '(Test)?$'
|
IncludeIsMainRegex: '(Test)?$'
|
||||||
|
IncludeIsMainSourceRegex: ''
|
||||||
|
IndentAccessModifiers: false
|
||||||
IndentCaseLabels: false
|
IndentCaseLabels: false
|
||||||
|
IndentCaseBlocks: false
|
||||||
|
IndentGotoLabels: true
|
||||||
IndentPPDirectives: None
|
IndentPPDirectives: None
|
||||||
IndentWidth: 4
|
IndentExternBlock: AfterExternBlock
|
||||||
|
IndentRequires: false
|
||||||
|
IndentWidth: 4
|
||||||
IndentWrappedFunctionNames: true
|
IndentWrappedFunctionNames: true
|
||||||
|
InsertTrailingCommas: None
|
||||||
JavaScriptQuotes: Leave
|
JavaScriptQuotes: Leave
|
||||||
JavaScriptWrapImports: true
|
JavaScriptWrapImports: true
|
||||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||||
|
LambdaBodyIndentation: Signature
|
||||||
MacroBlockBegin: ''
|
MacroBlockBegin: ''
|
||||||
MacroBlockEnd: ''
|
MacroBlockEnd: ''
|
||||||
MaxEmptyLinesToKeep: 1
|
MaxEmptyLinesToKeep: 1
|
||||||
NamespaceIndentation: None
|
NamespaceIndentation: None
|
||||||
ObjCBinPackProtocolList: Auto
|
ObjCBinPackProtocolList: Auto
|
||||||
ObjCBlockIndentWidth: 4
|
ObjCBlockIndentWidth: 4
|
||||||
|
ObjCBreakBeforeNestedBlockParam: true
|
||||||
ObjCSpaceAfterProperty: true
|
ObjCSpaceAfterProperty: true
|
||||||
ObjCSpaceBeforeProtocolList: true
|
ObjCSpaceBeforeProtocolList: true
|
||||||
|
|
||||||
# Taken from git's rules
|
|
||||||
PenaltyBreakAssignment: 10
|
PenaltyBreakAssignment: 10
|
||||||
PenaltyBreakBeforeFirstCallParameter: 30
|
PenaltyBreakBeforeFirstCallParameter: 30
|
||||||
PenaltyBreakComment: 10
|
PenaltyBreakComment: 10
|
||||||
PenaltyBreakFirstLessLess: 0
|
PenaltyBreakFirstLessLess: 0
|
||||||
|
PenaltyBreakOpenParenthesis: 0
|
||||||
PenaltyBreakString: 10
|
PenaltyBreakString: 10
|
||||||
|
PenaltyBreakTemplateDeclaration: 10
|
||||||
PenaltyExcessCharacter: 100
|
PenaltyExcessCharacter: 100
|
||||||
PenaltyReturnTypeOnItsOwnLine: 60
|
PenaltyReturnTypeOnItsOwnLine: 60
|
||||||
|
PenaltyIndentedWhitespace: 0
|
||||||
PointerAlignment: Left
|
PointerAlignment: Left
|
||||||
ReflowComments: false
|
PPIndentWidth: -1
|
||||||
SortIncludes: false
|
ReferenceAlignment: Pointer
|
||||||
|
ReflowComments: false
|
||||||
|
RemoveBracesLLVM: false
|
||||||
|
SeparateDefinitionBlocks: Leave
|
||||||
|
ShortNamespaceLines: 1
|
||||||
|
SortIncludes: Never
|
||||||
|
SortJavaStaticImport: Before
|
||||||
SortUsingDeclarations: false
|
SortUsingDeclarations: false
|
||||||
SpaceAfterCStyleCast: false
|
SpaceAfterCStyleCast: false
|
||||||
|
SpaceAfterLogicalNot: false
|
||||||
SpaceAfterTemplateKeyword: true
|
SpaceAfterTemplateKeyword: true
|
||||||
SpaceBeforeAssignmentOperators: true
|
SpaceBeforeAssignmentOperators: true
|
||||||
|
SpaceBeforeCaseColon: false
|
||||||
|
SpaceBeforeCpp11BracedList: false
|
||||||
SpaceBeforeCtorInitializerColon: true
|
SpaceBeforeCtorInitializerColon: true
|
||||||
SpaceBeforeInheritanceColon: true
|
SpaceBeforeInheritanceColon: true
|
||||||
SpaceBeforeParens: Never
|
SpaceBeforeParens: Never
|
||||||
|
SpaceBeforeParensOptions:
|
||||||
|
AfterControlStatements: false
|
||||||
|
AfterForeachMacros: false
|
||||||
|
AfterFunctionDefinitionName: false
|
||||||
|
AfterFunctionDeclarationName: false
|
||||||
|
AfterIfMacros: false
|
||||||
|
AfterOverloadedOperator: false
|
||||||
|
BeforeNonEmptyParentheses: false
|
||||||
|
SpaceAroundPointerQualifiers: Default
|
||||||
SpaceBeforeRangeBasedForLoopColon: true
|
SpaceBeforeRangeBasedForLoopColon: true
|
||||||
|
SpaceInEmptyBlock: false
|
||||||
SpaceInEmptyParentheses: false
|
SpaceInEmptyParentheses: false
|
||||||
SpacesBeforeTrailingComments: 1
|
SpacesBeforeTrailingComments: 1
|
||||||
SpacesInAngles: false
|
SpacesInAngles: Never
|
||||||
|
SpacesInConditionalStatement: false
|
||||||
SpacesInContainerLiterals: false
|
SpacesInContainerLiterals: false
|
||||||
SpacesInCStyleCastParentheses: false
|
SpacesInCStyleCastParentheses: false
|
||||||
|
SpacesInLineCommentPrefix:
|
||||||
|
Minimum: 1
|
||||||
|
Maximum: -1
|
||||||
SpacesInParentheses: false
|
SpacesInParentheses: false
|
||||||
SpacesInSquareBrackets: false
|
SpacesInSquareBrackets: false
|
||||||
Standard: Cpp03
|
SpaceBeforeSquareBrackets: false
|
||||||
TabWidth: 4
|
BitFieldColonSpacing: Both
|
||||||
UseTab: Never
|
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
|
||||||
|
...
|
||||||
|
|
||||||
|
|||||||
102
.github/CODEOWNERS
vendored
102
.github/CODEOWNERS
vendored
@@ -2,82 +2,58 @@
|
|||||||
* @skotopes @DrZlo13 @hedger
|
* @skotopes @DrZlo13 @hedger
|
||||||
|
|
||||||
# Apps
|
# Apps
|
||||||
/applications/about/ @skotopes @DrZlo13 @hedger
|
/applications/debug/bt_debug_app/ @skotopes @DrZlo13 @hedger @gornekich
|
||||||
/applications/accessor/ @skotopes @DrZlo13 @hedger
|
/applications/debug/accessor/ @skotopes @DrZlo13 @hedger @nminaylov
|
||||||
/applications/archive/ @skotopes @DrZlo13 @hedger @nminaylov
|
/applications/debug/battery_test_app/ @skotopes @DrZlo13 @hedger @gornekich
|
||||||
/applications/bad_usb/ @skotopes @DrZlo13 @hedger @nminaylov
|
/applications/debug/bt_debug_app/ @skotopes @DrZlo13 @hedger @gornekich
|
||||||
/applications/bt/ @skotopes @DrZlo13 @hedger @gornekich
|
/applications/debug/file_browser_test/ @skotopes @DrZlo13 @hedger @nminaylov
|
||||||
/applications/cli/ @skotopes @DrZlo13 @hedger @nminaylov
|
/applications/debug/lfrfid_debug/ @skotopes @DrZlo13 @hedger @nminaylov
|
||||||
/applications/crypto/ @skotopes @DrZlo13 @hedger @nminaylov
|
/applications/debug/text_box_test/ @skotopes @DrZlo13 @hedger @nminaylov
|
||||||
/applications/debug_tools/ @skotopes @DrZlo13 @hedger
|
/applications/debug/uart_echo/ @skotopes @DrZlo13 @hedger @nminaylov
|
||||||
/applications/desktop/ @skotopes @DrZlo13 @hedger @nminaylov
|
/applications/debug/usb_mouse/ @skotopes @DrZlo13 @hedger @nminaylov
|
||||||
/applications/dialogs/ @skotopes @DrZlo13 @hedger
|
/applications/debug/usb_test/ @skotopes @DrZlo13 @hedger @nminaylov
|
||||||
/applications/dolphin/ @skotopes @DrZlo13 @hedger
|
|
||||||
/applications/gpio/ @skotopes @DrZlo13 @hedger @nminaylov
|
|
||||||
/applications/gui/ @skotopes @DrZlo13 @hedger
|
|
||||||
/applications/ibutton/ @skotopes @DrZlo13 @hedger @gsurkov
|
|
||||||
/applications/infrared/ @skotopes @DrZlo13 @hedger @gsurkov
|
|
||||||
/applications/input/ @skotopes @DrZlo13 @hedger
|
|
||||||
/applications/lfrfid/ @skotopes @DrZlo13 @hedger
|
|
||||||
/applications/lfrfid_debug/ @skotopes @DrZlo13 @hedger
|
|
||||||
/applications/loader/ @skotopes @DrZlo13 @hedger
|
|
||||||
/applications/music_player/ @skotopes @DrZlo13 @hedger
|
|
||||||
/applications/nfc/ @skotopes @DrZlo13 @hedger @gornekich
|
|
||||||
/applications/notification/ @skotopes @DrZlo13 @hedger
|
|
||||||
/applications/power/ @skotopes @DrZlo13 @hedger
|
|
||||||
/applications/rpc/ @skotopes @DrZlo13 @hedger @nminaylov
|
|
||||||
/applications/snake_game/ @skotopes @DrZlo13 @hedger
|
|
||||||
/applications/storage/ @skotopes @DrZlo13 @hedger
|
|
||||||
/applications/storage_settings/ @skotopes @DrZlo13 @hedger
|
|
||||||
/applications/subghz/ @skotopes @DrZlo13 @hedger @Skorpionm
|
|
||||||
/applications/system/ @skotopes @DrZlo13 @hedger
|
|
||||||
/applications/u2f/ @skotopes @DrZlo13 @hedger @nminaylov
|
|
||||||
/applications/unit_tests/ @skotopes @DrZlo13 @hedger
|
|
||||||
/applications/updater/ @skotopes @DrZlo13 @hedger
|
|
||||||
|
|
||||||
# Assets
|
/applications/main/archive/ @skotopes @DrZlo13 @hedger @nminaylov
|
||||||
/assets/ @skotopes @DrZlo13 @hedger
|
/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
|
||||||
|
/applications/main/subghz/ @skotopes @DrZlo13 @hedger @Skorpionm
|
||||||
|
/applications/main/u2f/ @skotopes @DrZlo13 @hedger @nminaylov
|
||||||
|
|
||||||
# Furi Core
|
/applications/plugins/bt_hid_app/ @skotopes @DrZlo13 @hedger @gornekich
|
||||||
/furi/ @skotopes @DrZlo13 @hedger
|
/applications/plugins/picopass/ @skotopes @DrZlo13 @hedger @gornekich
|
||||||
|
|
||||||
# Debug tools and plugins
|
/applications/services/bt/ @skotopes @DrZlo13 @hedger @gornekich
|
||||||
/debug/ @skotopes @DrZlo13 @hedger
|
/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
|
||||||
|
|
||||||
# Documentation
|
# Documentation
|
||||||
/documentation/ @skotopes @DrZlo13 @hedger @drunkbatya
|
/documentation/ @skotopes @DrZlo13 @hedger @drunkbatya
|
||||||
|
/scripts/toolchain/ @skotopes @DrZlo13 @hedger @drunkbatya
|
||||||
# Firmware targets
|
|
||||||
/firmware/ @skotopes @DrZlo13 @hedger
|
|
||||||
|
|
||||||
# Lib
|
# Lib
|
||||||
/lib/FreeRTOS-Kernel/ @skotopes @DrZlo13 @hedger
|
|
||||||
/lib/FreeRTOS-glue/ @skotopes @DrZlo13 @hedger
|
|
||||||
/lib/ST25RFAL002/ @skotopes @DrZlo13 @hedger @gornekich
|
/lib/ST25RFAL002/ @skotopes @DrZlo13 @hedger @gornekich
|
||||||
/lib/STM32CubeWB/ @skotopes @DrZlo13 @hedger @gornekich
|
/lib/STM32CubeWB/ @skotopes @DrZlo13 @hedger @gornekich
|
||||||
/lib/app-scened-template/ @skotopes @DrZlo13 @hedger
|
|
||||||
/lib/callback-connector/ @skotopes @DrZlo13 @hedger
|
|
||||||
/lib/digital_signal/ @skotopes @DrZlo13 @hedger @gornekich
|
/lib/digital_signal/ @skotopes @DrZlo13 @hedger @gornekich
|
||||||
/lib/drivers/ @skotopes @DrZlo13 @hedger
|
|
||||||
/lib/fatfs/ @skotopes @DrZlo13 @hedger
|
|
||||||
/lib/flipper_format/ @skotopes @DrZlo13 @hedger
|
|
||||||
/lib/fnv1a-hash/ @skotopes @DrZlo13 @hedger
|
|
||||||
/lib/heatshrink/ @skotopes @DrZlo13 @hedger
|
|
||||||
/lib/infrared/ @skotopes @DrZlo13 @hedger @gsurkov
|
/lib/infrared/ @skotopes @DrZlo13 @hedger @gsurkov
|
||||||
|
/lib/lfrfid/ @skotopes @DrZlo13 @hedger @nminaylov
|
||||||
/lib/libusb_stm32/ @skotopes @DrZlo13 @hedger @nminaylov
|
/lib/libusb_stm32/ @skotopes @DrZlo13 @hedger @nminaylov
|
||||||
/lib/littlefs/ @skotopes @DrZlo13 @hedger
|
/lib/mbedtls/ @skotopes @DrZlo13 @hedger @nminaylov
|
||||||
/lib/lfs_config.h @skotopes @DrZlo13 @hedger
|
|
||||||
/lib/micro-ecc/ @skotopes @DrZlo13 @hedger @nminaylov
|
/lib/micro-ecc/ @skotopes @DrZlo13 @hedger @nminaylov
|
||||||
/lib/microtar/ @skotopes @DrZlo13 @hedger
|
/lib/nanopb/ @skotopes @DrZlo13 @hedger @nminaylov
|
||||||
/lib/mlib/ @skotopes @DrZlo13 @hedger
|
|
||||||
/lib/nanopb/ @skotopes @DrZlo13 @hedger
|
|
||||||
/lib/nfc/ @skotopes @DrZlo13 @hedger @gornekich
|
/lib/nfc/ @skotopes @DrZlo13 @hedger @gornekich
|
||||||
/lib/one_wire/ @skotopes @DrZlo13 @hedger
|
/lib/one_wire/ @skotopes @DrZlo13 @hedger @gsurkov
|
||||||
/lib/qrcode/ @skotopes @DrZlo13 @hedger
|
|
||||||
/lib/subghz/ @skotopes @DrZlo13 @hedger @Skorpionm
|
/lib/subghz/ @skotopes @DrZlo13 @hedger @Skorpionm
|
||||||
/lib/toolbox/ @skotopes @DrZlo13 @hedger
|
|
||||||
/lib/u8g2/ @skotopes @DrZlo13 @hedger
|
|
||||||
/lib/update_util/ @skotopes @DrZlo13 @hedger
|
|
||||||
|
|
||||||
# Helper scripts
|
|
||||||
/scripts/ @skotopes @DrZlo13 @hedger
|
|
||||||
|
|||||||
52
.github/workflows/amap_analyse.yml
vendored
52
.github/workflows/amap_analyse.yml
vendored
@@ -14,6 +14,7 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
amap_analyse:
|
amap_analyse:
|
||||||
|
if: ${{ !github.event.pull_request.head.repo.fork }}
|
||||||
runs-on: [self-hosted,FlipperZeroMacShell]
|
runs-on: [self-hosted,FlipperZeroMacShell]
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
steps:
|
steps:
|
||||||
@@ -34,8 +35,7 @@ jobs:
|
|||||||
- name: 'Decontaminate previous build leftovers'
|
- name: 'Decontaminate previous build leftovers'
|
||||||
run: |
|
run: |
|
||||||
if [ -d .git ]; then
|
if [ -d .git ]; then
|
||||||
git submodule status \
|
git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
|
||||||
|| git checkout `git rev-list --max-parents=0 HEAD | tail -n 1`
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 'Checkout code'
|
- name: 'Checkout code'
|
||||||
@@ -44,32 +44,16 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
- name: 'Generate prefixes by commit'
|
- name: 'Get commit details'
|
||||||
id: names
|
|
||||||
run: |
|
run: |
|
||||||
REF="${{github.ref}}"
|
|
||||||
COMMIT_HASH="$(git rev-parse HEAD)"
|
|
||||||
SHA="$(git rev-parse --short HEAD)"
|
|
||||||
COMMIT_MSG="${{github.event.head_commit.message}}"
|
|
||||||
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
|
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
|
||||||
REF="${{github.head_ref}}"
|
TYPE="pull"
|
||||||
COMMIT_HASH="$(git log -1 --pretty=oneline | awk '{print $1}')"
|
elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
|
||||||
SHA="$(cut -c -8 <<< "$COMMIT_HASH")"
|
TYPE="tag"
|
||||||
COMMIT_MSG="$(git log -1 --pretty=format:"%s")"
|
else
|
||||||
PULL_ID="${{github.event.pull_request.number}}"
|
TYPE="other"
|
||||||
PULL_NAME="${{github.event.pull_request.title}}"
|
|
||||||
fi
|
fi
|
||||||
BRANCH_NAME=${REF#refs/*/}
|
python3 scripts/get_env.py "--event_file=${{ github.event_path }}" "--type=$TYPE"
|
||||||
SUFFIX=${BRANCH_NAME//\//_}-$(date +'%d%m%Y')-${SHA}
|
|
||||||
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
|
|
||||||
SUFFIX=${BRANCH_NAME//\//_}
|
|
||||||
fi
|
|
||||||
echo "::set-output name=commit-hash::${COMMIT_HASH}"
|
|
||||||
echo "::set-output name=commit-msg::${COMMIT_MSG}"
|
|
||||||
echo "::set-output name=pull-id::${PULL_ID}"
|
|
||||||
echo "::set-output name=pull-name::${PULL_NAME}"
|
|
||||||
echo "::set-output name=branch-name::${BRANCH_NAME}"
|
|
||||||
echo "::set-output name=suffix::${SUFFIX}"
|
|
||||||
|
|
||||||
- name: 'Make artifacts directory'
|
- name: 'Make artifacts directory'
|
||||||
run: |
|
run: |
|
||||||
@@ -77,19 +61,18 @@ jobs:
|
|||||||
mkdir artifacts
|
mkdir artifacts
|
||||||
|
|
||||||
- name: 'Download build artifacts'
|
- name: 'Download build artifacts'
|
||||||
if: ${{ !github.event.pull_request.head.repo.fork }}
|
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.RSYNC_DEPLOY_KEY }}" > deploy_key;
|
echo "${{ secrets.RSYNC_DEPLOY_KEY }}" > deploy_key;
|
||||||
chmod 600 ./deploy_key;
|
chmod 600 ./deploy_key;
|
||||||
rsync -avzP \
|
rsync -avzP \
|
||||||
-e 'ssh -p ${{ secrets.RSYNC_DEPLOY_PORT }} -i ./deploy_key' \
|
-e 'ssh -p ${{ secrets.RSYNC_DEPLOY_PORT }} -i ./deploy_key' \
|
||||||
${{ secrets.RSYNC_DEPLOY_USER }}@${{ secrets.RSYNC_DEPLOY_HOST }}:"${{ secrets.RSYNC_DEPLOY_BASE_PATH }}${{steps.names.outputs.branch-name}}/" artifacts/;
|
${{ secrets.RSYNC_DEPLOY_USER }}@${{ secrets.RSYNC_DEPLOY_HOST }}:"${{ secrets.RSYNC_DEPLOY_BASE_PATH }}${BRANCH_NAME}/" artifacts/;
|
||||||
rm ./deploy_key;
|
rm ./deploy_key;
|
||||||
|
|
||||||
- name: 'Make .map file analyse'
|
- name: 'Make .map file analyze'
|
||||||
run: |
|
run: |
|
||||||
cd artifacts/
|
cd artifacts/
|
||||||
/Applications/amap/Contents/MacOS/amap -f flipper-z-f7-firmware-${{steps.names.outputs.suffix}}.elf.map
|
/Applications/amap/Contents/MacOS/amap -f "flipper-z-f7-firmware-${SUFFIX}.elf.map"
|
||||||
|
|
||||||
- name: 'Upload report to DB'
|
- name: 'Upload report to DB'
|
||||||
run: |
|
run: |
|
||||||
@@ -98,21 +81,14 @@ jobs:
|
|||||||
{
|
{
|
||||||
SECTION="$1";
|
SECTION="$1";
|
||||||
arm-none-eabi-size \
|
arm-none-eabi-size \
|
||||||
-A artifacts/flipper-z-f7-firmware-${{steps.names.outputs.suffix}}.elf \
|
-A artifacts/flipper-z-f7-firmware-$SUFFIX.elf \
|
||||||
| grep "^$SECTION" | awk '{print $2}'
|
| grep "^$SECTION" | awk '{print $2}'
|
||||||
}
|
}
|
||||||
export COMMIT_HASH="${{steps.names.outputs.commit-hash}}"
|
|
||||||
export COMMIT_MSG="${{steps.names.outputs.commit-msg}}"
|
|
||||||
export BRANCH_NAME="${{steps.names.outputs.branch-name}}"
|
|
||||||
export BSS_SIZE="$(get_size ".bss")"
|
export BSS_SIZE="$(get_size ".bss")"
|
||||||
export TEXT_SIZE="$(get_size ".text")"
|
export TEXT_SIZE="$(get_size ".text")"
|
||||||
export RODATA_SIZE="$(get_size ".rodata")"
|
export RODATA_SIZE="$(get_size ".rodata")"
|
||||||
export DATA_SIZE="$(get_size ".data")"
|
export DATA_SIZE="$(get_size ".data")"
|
||||||
export FREE_FLASH_SIZE="$(get_size ".free_flash")"
|
export FREE_FLASH_SIZE="$(get_size ".free_flash")"
|
||||||
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
|
|
||||||
export PULL_ID="${{steps.names.outputs.pull-id}}"
|
|
||||||
export PULL_NAME="${{steps.names.outputs.pull-name}}"
|
|
||||||
fi
|
|
||||||
python3 -m pip install mariadb
|
python3 -m pip install mariadb
|
||||||
python3 scripts/amap_mariadb_insert.py \
|
python3 scripts/amap_mariadb_insert.py \
|
||||||
${{ secrets.AMAP_MARIADB_USER }} \
|
${{ secrets.AMAP_MARIADB_USER }} \
|
||||||
@@ -120,4 +96,4 @@ jobs:
|
|||||||
${{ secrets.AMAP_MARIADB_HOST }} \
|
${{ secrets.AMAP_MARIADB_HOST }} \
|
||||||
${{ secrets.AMAP_MARIADB_PORT }} \
|
${{ secrets.AMAP_MARIADB_PORT }} \
|
||||||
${{ secrets.AMAP_MARIADB_DATABASE }} \
|
${{ secrets.AMAP_MARIADB_DATABASE }} \
|
||||||
artifacts/flipper-z-f7-firmware-${{steps.names.outputs.suffix}}.elf.map.all
|
artifacts/flipper-z-f7-firmware-$SUFFIX.elf.map.all
|
||||||
|
|||||||
110
.github/workflows/build.yml
vendored
110
.github/workflows/build.yml
vendored
@@ -19,10 +19,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: 'Decontaminate previous build leftovers'
|
- name: 'Decontaminate previous build leftovers'
|
||||||
run: |
|
run: |
|
||||||
if [ -d .git ]
|
if [ -d .git ]; then
|
||||||
then
|
git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
|
||||||
git submodule status \
|
|
||||||
|| git checkout `git rev-list --max-parents=0 HEAD | tail -n 1`
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 'Checkout code'
|
- name: 'Checkout code'
|
||||||
@@ -33,51 +31,46 @@ jobs:
|
|||||||
|
|
||||||
- name: 'Make artifacts directory'
|
- name: 'Make artifacts directory'
|
||||||
run: |
|
run: |
|
||||||
test -d artifacts && rm -rf artifacts || true
|
rm -rf artifacts
|
||||||
mkdir artifacts
|
mkdir artifacts
|
||||||
|
|
||||||
- name: 'Generate suffix and folder name'
|
- 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"
|
||||||
|
|
||||||
|
- name: 'Generate suffixes for comment'
|
||||||
id: names
|
id: names
|
||||||
run: |
|
run: |
|
||||||
REF=${{ github.ref }}
|
echo "::set-output name=branch_name::${BRANCH_NAME}"
|
||||||
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
|
echo "::set-output name=commit_sha::${COMMIT_SHA}"
|
||||||
REF=${{ github.head_ref }}
|
echo "::set-output name=default_target::${DEFAULT_TARGET}"
|
||||||
fi
|
|
||||||
BRANCH_OR_TAG=${REF#refs/*/}
|
|
||||||
SHA=$(git rev-parse --short HEAD)
|
|
||||||
|
|
||||||
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
|
|
||||||
SUFFIX=${BRANCH_OR_TAG//\//_}
|
|
||||||
else
|
|
||||||
SUFFIX=${BRANCH_OR_TAG//\//_}-$(date +'%d%m%Y')-${SHA}
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "WORKFLOW_BRANCH_OR_TAG=${BRANCH_OR_TAG}" >> $GITHUB_ENV
|
|
||||||
echo "DIST_SUFFIX=${SUFFIX}" >> $GITHUB_ENV
|
|
||||||
echo "::set-output name=artifacts-path::${BRANCH_OR_TAG}"
|
|
||||||
echo "::set-output name=suffix::${SUFFIX}"
|
echo "::set-output name=suffix::${SUFFIX}"
|
||||||
echo "::set-output name=short-hash::${SHA}"
|
|
||||||
echo "::set-output name=default-target::${DEFAULT_TARGET}"
|
|
||||||
|
|
||||||
- name: 'Bundle scripts'
|
- name: 'Bundle scripts'
|
||||||
if: ${{ !github.event.pull_request.head.repo.fork }}
|
if: ${{ !github.event.pull_request.head.repo.fork }}
|
||||||
run: |
|
run: |
|
||||||
tar czpf artifacts/flipper-z-any-scripts-${{steps.names.outputs.suffix}}.tgz scripts
|
tar czpf artifacts/flipper-z-any-scripts-${SUFFIX}.tgz scripts
|
||||||
|
|
||||||
- name: 'Build the firmware'
|
- name: 'Build the firmware'
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
for TARGET in ${TARGETS}
|
for TARGET in ${TARGETS}; do
|
||||||
do
|
FBT_TOOLCHAIN_PATH=/opt ./fbt TARGET_HW="$(echo "${TARGET}" | sed 's/f//')" \
|
||||||
FBT_TOOLCHAIN_PATH=/opt ./fbt TARGET_HW=`echo ${TARGET} | sed 's/f//'` updater_package ${{ startsWith(github.ref, 'refs/tags') && 'DEBUG=0 COMPACT=1' || '' }}
|
updater_package ${{ startsWith(github.ref, 'refs/tags') && 'DEBUG=0 COMPACT=1' || '' }}
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: 'Move upload files'
|
- name: 'Move upload files'
|
||||||
if: ${{ !github.event.pull_request.head.repo.fork }}
|
if: ${{ !github.event.pull_request.head.repo.fork }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
for TARGET in ${TARGETS}
|
for TARGET in ${TARGETS}; do
|
||||||
do
|
|
||||||
mv dist/${TARGET}-*/* artifacts/
|
mv dist/${TARGET}-*/* artifacts/
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -85,32 +78,31 @@ jobs:
|
|||||||
if: ${{ !github.event.pull_request.head.repo.fork }}
|
if: ${{ !github.event.pull_request.head.repo.fork }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
for UPDATEBUNDLE in artifacts/*/
|
for UPDATEBUNDLE in artifacts/*/; do
|
||||||
do
|
BUNDLE_NAME="$(echo "$UPDATEBUNDLE" | cut -d'/' -f2)"
|
||||||
BUNDLE_NAME=`echo $UPDATEBUNDLE | cut -d'/' -f2`
|
echo Packaging "${BUNDLE_NAME}"
|
||||||
echo Packaging ${BUNDLE_NAME}
|
tar czpf "artifacts/flipper-z-${BUNDLE_NAME}.tgz" -C artifacts "${BUNDLE_NAME}"
|
||||||
tar czpf artifacts/flipper-z-${BUNDLE_NAME}.tgz -C artifacts ${BUNDLE_NAME}
|
rm -rf "artifacts/${BUNDLE_NAME}"
|
||||||
rm -rf artifacts/${BUNDLE_NAME}
|
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: "Check for uncommited changes"
|
- name: "Check for uncommitted changes"
|
||||||
run: |
|
run: |
|
||||||
git diff --exit-code
|
git diff --exit-code
|
||||||
|
|
||||||
- name: 'Bundle resources'
|
- name: 'Bundle resources'
|
||||||
if: ${{ !github.event.pull_request.head.repo.fork }}
|
if: ${{ !github.event.pull_request.head.repo.fork }}
|
||||||
run: |
|
run: |
|
||||||
tar czpf artifacts/flipper-z-any-resources-${{steps.names.outputs.suffix}}.tgz -C assets resources
|
tar czpf "artifacts/flipper-z-any-resources-${SUFFIX}.tgz" -C assets resources
|
||||||
|
|
||||||
- name: 'Bundle core2 firmware'
|
- name: 'Bundle core2 firmware'
|
||||||
if: ${{ !github.event.pull_request.head.repo.fork }}
|
if: ${{ !github.event.pull_request.head.repo.fork }}
|
||||||
run: |
|
run: |
|
||||||
FBT_TOOLCHAIN_PATH=/opt ./fbt copro_dist
|
FBT_TOOLCHAIN_PATH=/opt ./fbt copro_dist
|
||||||
tar czpf artifacts/flipper-z-any-core2_firmware-${{steps.names.outputs.suffix}}.tgz -C assets core2_firmware
|
tar czpf "artifacts/flipper-z-any-core2_firmware-${SUFFIX}.tgz" -C assets core2_firmware
|
||||||
|
|
||||||
- name: 'Copy .map file'
|
- name: 'Copy .map file'
|
||||||
run: |
|
run: |
|
||||||
cp build/f7-firmware-*/firmware.elf.map artifacts/flipper-z-f7-firmware-${{steps.names.outputs.suffix}}.elf.map
|
cp build/f7-firmware-*/firmware.elf.map "artifacts/flipper-z-f7-firmware-${SUFFIX}.elf.map"
|
||||||
|
|
||||||
- name: 'Upload artifacts to update server'
|
- name: 'Upload artifacts to update server'
|
||||||
if: ${{ !github.event.pull_request.head.repo.fork }}
|
if: ${{ !github.event.pull_request.head.repo.fork }}
|
||||||
@@ -119,7 +111,7 @@ jobs:
|
|||||||
chmod 600 ./deploy_key;
|
chmod 600 ./deploy_key;
|
||||||
rsync -avzP --delete --mkpath \
|
rsync -avzP --delete --mkpath \
|
||||||
-e 'ssh -p ${{ secrets.RSYNC_DEPLOY_PORT }} -i ./deploy_key' \
|
-e 'ssh -p ${{ secrets.RSYNC_DEPLOY_PORT }} -i ./deploy_key' \
|
||||||
artifacts/ ${{ secrets.RSYNC_DEPLOY_USER }}@${{ secrets.RSYNC_DEPLOY_HOST }}:"${{ secrets.RSYNC_DEPLOY_BASE_PATH }}${{steps.names.outputs.artifacts-path}}/";
|
artifacts/ ${{ secrets.RSYNC_DEPLOY_USER }}@${{ secrets.RSYNC_DEPLOY_HOST }}:"${{ secrets.RSYNC_DEPLOY_BASE_PATH }}${BRANCH_NAME}/";
|
||||||
rm ./deploy_key;
|
rm ./deploy_key;
|
||||||
|
|
||||||
- name: 'Trigger update server reindex'
|
- name: 'Trigger update server reindex'
|
||||||
@@ -142,10 +134,10 @@ jobs:
|
|||||||
comment-id: ${{ steps.fc.outputs.comment-id }}
|
comment-id: ${{ steps.fc.outputs.comment-id }}
|
||||||
issue-number: ${{ github.event.pull_request.number }}
|
issue-number: ${{ github.event.pull_request.number }}
|
||||||
body: |
|
body: |
|
||||||
**Compiled firmware for commit `${{steps.names.outputs.short-hash}}`:**
|
**Compiled firmware for commit `${{steps.names.outputs.commit_sha}}`:**
|
||||||
- [📦 Update package](https://update.flipperzero.one/builds/firmware/${{steps.names.outputs.artifacts-path}}/flipper-z-${{steps.names.outputs.default-target}}-update-${{steps.names.outputs.suffix}}.tgz)
|
- [📦 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.artifacts-path}}/flipper-z-${{steps.names.outputs.default-target}}-full-${{steps.names.outputs.suffix}}.dfu)
|
- [📥 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 updater](https://my.flipp.dev/?url=https://update.flipperzero.one/builds/firmware/${{steps.names.outputs.artifacts-path}}/flipper-z-${{steps.names.outputs.default-target}}-update-${{steps.names.outputs.suffix}}.tgz&channel=${{steps.names.outputs.artifacts-path}}&version=${{steps.names.outputs.short-hash}})
|
- [☁️ Web updater](https://my.flipp.dev/?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
|
edit-mode: replace
|
||||||
|
|
||||||
compact:
|
compact:
|
||||||
@@ -157,7 +149,7 @@ jobs:
|
|||||||
if [ -d .git ]
|
if [ -d .git ]
|
||||||
then
|
then
|
||||||
git submodule status \
|
git submodule status \
|
||||||
|| git checkout `git rev-list --max-parents=0 HEAD | tail -n 1`
|
|| git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 'Checkout code'
|
- name: 'Checkout code'
|
||||||
@@ -167,29 +159,21 @@ jobs:
|
|||||||
submodules: true
|
submodules: true
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
- name: 'Generate suffix and folder name'
|
- name: 'Get commit details'
|
||||||
id: names
|
|
||||||
run: |
|
run: |
|
||||||
REF=${{ github.ref }}
|
|
||||||
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
|
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
|
||||||
REF=${{ github.head_ref }}
|
TYPE="pull"
|
||||||
fi
|
elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
|
||||||
BRANCH_OR_TAG=${REF#refs/*/}
|
TYPE="tag"
|
||||||
SHA=$(git rev-parse --short HEAD)
|
|
||||||
|
|
||||||
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
|
|
||||||
SUFFIX=${BRANCH_OR_TAG//\//_}
|
|
||||||
else
|
else
|
||||||
SUFFIX=${BRANCH_OR_TAG//\//_}-$(date +'%d%m%Y')-${SHA}
|
TYPE="other"
|
||||||
fi
|
fi
|
||||||
|
python3 scripts/get_env.py "--event_file=${{ github.event_path }}" "--type=$TYPE"
|
||||||
echo "WORKFLOW_BRANCH_OR_TAG=${BRANCH_OR_TAG}" >> $GITHUB_ENV
|
|
||||||
echo "DIST_SUFFIX=${SUFFIX}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: 'Build the firmware'
|
- name: 'Build the firmware'
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
for TARGET in ${TARGETS}
|
for TARGET in ${TARGETS}; do
|
||||||
do
|
FBT_TOOLCHAIN_PATH=/opt ./fbt TARGET_HW="$(echo "${TARGET}" | sed 's/f//')" \
|
||||||
FBT_TOOLCHAIN_PATH=/opt ./fbt TARGET_HW=`echo ${TARGET} | sed 's/f//'` updater_package DEBUG=0 COMPACT=1
|
updater_package DEBUG=0 COMPACT=1
|
||||||
done
|
done
|
||||||
|
|||||||
6
.github/workflows/check_submodules.yml
vendored
6
.github/workflows/check_submodules.yml
vendored
@@ -15,10 +15,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: 'Decontaminate previous build leftovers'
|
- name: 'Decontaminate previous build leftovers'
|
||||||
run: |
|
run: |
|
||||||
if [ -d .git ]
|
if [ -d .git ]; then
|
||||||
then
|
git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
|
||||||
git submodule status \
|
|
||||||
|| git checkout `git rev-list --max-parents=0 HEAD | tail -n 1`
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 'Checkout code'
|
- name: 'Checkout code'
|
||||||
|
|||||||
6
.github/workflows/lint_c.yml
vendored
6
.github/workflows/lint_c.yml
vendored
@@ -18,10 +18,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: 'Decontaminate previous build leftovers'
|
- name: 'Decontaminate previous build leftovers'
|
||||||
run: |
|
run: |
|
||||||
if [ -d .git ]
|
if [ -d .git ]; then
|
||||||
then
|
git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
|
||||||
git submodule status \
|
|
||||||
|| git checkout `git rev-list --max-parents=0 HEAD | tail -n 1`
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 'Checkout code'
|
- name: 'Checkout code'
|
||||||
|
|||||||
6
.github/workflows/lint_python.yml
vendored
6
.github/workflows/lint_python.yml
vendored
@@ -15,10 +15,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: 'Decontaminate previous build leftovers'
|
- name: 'Decontaminate previous build leftovers'
|
||||||
run: |
|
run: |
|
||||||
if [ -d .git ]
|
if [ -d .git ]; then
|
||||||
then
|
git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
|
||||||
git submodule status \
|
|
||||||
|| git checkout `git rev-list --max-parents=0 HEAD | tail -n 1`
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 'Checkout code'
|
- name: 'Checkout code'
|
||||||
|
|||||||
50
.github/workflows/pvs_studio.yml
vendored
50
.github/workflows/pvs_studio.yml
vendored
@@ -15,14 +15,13 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
analyse_c_cpp:
|
analyse_c_cpp:
|
||||||
|
if: ${{ !github.event.pull_request.head.repo.fork }}
|
||||||
runs-on: [self-hosted, FlipperZeroShell]
|
runs-on: [self-hosted, FlipperZeroShell]
|
||||||
steps:
|
steps:
|
||||||
- name: 'Decontaminate previous build leftovers'
|
- name: 'Decontaminate previous build leftovers'
|
||||||
run: |
|
run: |
|
||||||
if [ -d .git ]
|
if [ -d .git ]; then
|
||||||
then
|
git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
|
||||||
git submodule status \
|
|
||||||
|| git checkout `git rev-list --max-parents=0 HEAD | tail -n 1`
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 'Checkout code'
|
- name: 'Checkout code'
|
||||||
@@ -31,28 +30,25 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
- name: 'Generate suffix and folder name'
|
- 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"
|
||||||
|
|
||||||
|
- name: 'Generate suffixes for comment'
|
||||||
|
if: ${{ !github.event.pull_request.head.repo.fork && github.event.pull_request }}
|
||||||
id: names
|
id: names
|
||||||
run: |
|
run: |
|
||||||
REF=${{ github.ref }}
|
echo "::set-output name=branch_name::${BRANCH_NAME}"
|
||||||
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
|
echo "::set-output name=commit_sha::${COMMIT_SHA}"
|
||||||
REF=${{ github.head_ref }}
|
echo "::set-output name=default_target::${DEFAULT_TARGET}"
|
||||||
fi
|
|
||||||
BRANCH_OR_TAG=${REF#refs/*/}
|
|
||||||
SHA=$(git rev-parse --short HEAD)
|
|
||||||
|
|
||||||
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
|
|
||||||
SUFFIX=${BRANCH_OR_TAG//\//_}
|
|
||||||
else
|
|
||||||
SUFFIX=${BRANCH_OR_TAG//\//_}-$(date +'%d%m%Y')-${SHA}
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "WORKFLOW_BRANCH_OR_TAG=${BRANCH_OR_TAG}" >> $GITHUB_ENV
|
|
||||||
echo "DIST_SUFFIX=${SUFFIX}" >> $GITHUB_ENV
|
|
||||||
echo "::set-output name=artifacts-path::${BRANCH_OR_TAG}"
|
|
||||||
echo "::set-output name=suffix::${SUFFIX}"
|
echo "::set-output name=suffix::${SUFFIX}"
|
||||||
echo "::set-output name=short-hash::${SHA}"
|
|
||||||
echo "::set-output name=default-target::${DEFAULT_TARGET}"
|
|
||||||
|
|
||||||
- name: 'Make reports directory'
|
- name: 'Make reports directory'
|
||||||
run: |
|
run: |
|
||||||
@@ -74,7 +70,7 @@ jobs:
|
|||||||
-o PVS-Studio.log
|
-o PVS-Studio.log
|
||||||
|
|
||||||
- name: 'Convert PVS-Studio output to html page'
|
- name: 'Convert PVS-Studio output to html page'
|
||||||
run: plog-converter -a GA:1,2,3 -t fullhtml PVS-Studio.log -o reports/${{steps.names.outputs.default-target}}-${{steps.names.outputs.suffix}}
|
run: plog-converter -a GA:1,2,3 -t fullhtml PVS-Studio.log -o reports/${DEFAULT_TARGET}-${SUFFIX}
|
||||||
|
|
||||||
- name: 'Upload artifacts to update server'
|
- name: 'Upload artifacts to update server'
|
||||||
if: ${{ !github.event.pull_request.head.repo.fork }}
|
if: ${{ !github.event.pull_request.head.repo.fork }}
|
||||||
@@ -83,7 +79,7 @@ jobs:
|
|||||||
chmod 600 ./deploy_key;
|
chmod 600 ./deploy_key;
|
||||||
rsync -avrzP --mkpath \
|
rsync -avrzP --mkpath \
|
||||||
-e 'ssh -p ${{ secrets.RSYNC_DEPLOY_PORT }} -i ./deploy_key' \
|
-e 'ssh -p ${{ secrets.RSYNC_DEPLOY_PORT }} -i ./deploy_key' \
|
||||||
reports/ ${{ secrets.RSYNC_DEPLOY_USER }}@${{ secrets.RSYNC_DEPLOY_HOST }}:/home/data/firmware-pvs-studio-report/"${{steps.names.outputs.artifacts-path}}/";
|
reports/ ${{ secrets.RSYNC_DEPLOY_USER }}@${{ secrets.RSYNC_DEPLOY_HOST }}:/home/data/firmware-pvs-studio-report/"${BRANCH_NAME}/";
|
||||||
rm ./deploy_key;
|
rm ./deploy_key;
|
||||||
|
|
||||||
- name: 'Find Previous Comment'
|
- name: 'Find Previous Comment'
|
||||||
@@ -102,6 +98,6 @@ jobs:
|
|||||||
comment-id: ${{ steps.fc.outputs.comment-id }}
|
comment-id: ${{ steps.fc.outputs.comment-id }}
|
||||||
issue-number: ${{ github.event.pull_request.number }}
|
issue-number: ${{ github.event.pull_request.number }}
|
||||||
body: |
|
body: |
|
||||||
**PVS-Studio report for commit `${{steps.names.outputs.short-hash}}`:**
|
**PVS-Studio report for commit `${{steps.names.outputs.commit_sha}}`:**
|
||||||
- [Report](https://update.flipperzero.one/builds/firmware-pvs-studio-report/${{steps.names.outputs.artifacts-path}}/${{steps.names.outputs.default-target}}-${{steps.names.outputs.suffix}}/index.html)
|
- [Report](https://update.flipperzero.one/builds/firmware-pvs-studio-report/${{steps.names.outputs.branch_name}}/${{steps.names.outputs.default_target}}-${{steps.names.outputs.suffix}}/index.html)
|
||||||
edit-mode: replace
|
edit-mode: replace
|
||||||
|
|||||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -28,3 +28,6 @@
|
|||||||
[submodule "lib/mbedtls"]
|
[submodule "lib/mbedtls"]
|
||||||
path = lib/mbedtls
|
path = lib/mbedtls
|
||||||
url = https://github.com/Mbed-TLS/mbedtls.git
|
url = https://github.com/Mbed-TLS/mbedtls.git
|
||||||
|
[submodule "lib/cxxheaderparser"]
|
||||||
|
path = lib/cxxheaderparser
|
||||||
|
url = https://github.com/robotpy/cxxheaderparser.git
|
||||||
|
|||||||
13
.vscode/example/launch.json
vendored
13
.vscode/example/launch.json
vendored
@@ -31,7 +31,10 @@
|
|||||||
],
|
],
|
||||||
"postAttachCommands": [
|
"postAttachCommands": [
|
||||||
// "attach 1",
|
// "attach 1",
|
||||||
"compare-sections",
|
// "compare-sections",
|
||||||
|
"source debug/flipperapps.py",
|
||||||
|
// "source debug/FreeRTOS/FreeRTOS.py",
|
||||||
|
// "svd_load debug/STM32WB55_CM4.svd"
|
||||||
]
|
]
|
||||||
// "showDevDebugOutput": "raw",
|
// "showDevDebugOutput": "raw",
|
||||||
},
|
},
|
||||||
@@ -50,7 +53,8 @@
|
|||||||
"attach 1",
|
"attach 1",
|
||||||
"set confirm off",
|
"set confirm off",
|
||||||
"set mem inaccessible-by-default off",
|
"set mem inaccessible-by-default off",
|
||||||
"compare-sections",
|
"source debug/flipperapps.py",
|
||||||
|
// "compare-sections",
|
||||||
]
|
]
|
||||||
// "showDevDebugOutput": "raw",
|
// "showDevDebugOutput": "raw",
|
||||||
},
|
},
|
||||||
@@ -65,6 +69,9 @@
|
|||||||
"device": "STM32WB55RG",
|
"device": "STM32WB55RG",
|
||||||
"svdFile": "./debug/STM32WB55_CM4.svd",
|
"svdFile": "./debug/STM32WB55_CM4.svd",
|
||||||
"rtos": "FreeRTOS",
|
"rtos": "FreeRTOS",
|
||||||
|
"postAttachCommands": [
|
||||||
|
"source debug/flipperapps.py",
|
||||||
|
]
|
||||||
// "showDevDebugOutput": "raw",
|
// "showDevDebugOutput": "raw",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -73,7 +80,7 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "./lib/scons/scripts/scons.py",
|
"program": "./lib/scons/scripts/scons.py",
|
||||||
"args": [
|
"args": [
|
||||||
"sdk"
|
"plugin_dist"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
3
.vscode/example/settings.json
vendored
3
.vscode/example/settings.json
vendored
@@ -12,6 +12,9 @@
|
|||||||
"cortex-debug.openocdPath.windows": "${workspaceFolder}/toolchain/i686-windows/openocd/bin/openocd.exe",
|
"cortex-debug.openocdPath.windows": "${workspaceFolder}/toolchain/i686-windows/openocd/bin/openocd.exe",
|
||||||
"cortex-debug.openocdPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/openocd/bin/openocd",
|
"cortex-debug.openocdPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/openocd/bin/openocd",
|
||||||
"cortex-debug.openocdPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/openocd/bin/openocd",
|
"cortex-debug.openocdPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/openocd/bin/openocd",
|
||||||
|
"cortex-debug.gdbPath.windows": "${workspaceFolder}/toolchain/i686-windows/bin/arm-none-eabi-gdb-py.bat",
|
||||||
|
"cortex-debug.gdbPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/bin/arm-none-eabi-gdb-py",
|
||||||
|
"cortex-debug.gdbPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/bin/arm-none-eabi-gdb-py",
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
"*.scons": "python",
|
"*.scons": "python",
|
||||||
|
|||||||
30
.vscode/example/tasks.json
vendored
30
.vscode/example/tasks.json
vendored
@@ -93,11 +93,41 @@
|
|||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "./fbt FIRMWARE_APP_SET=unit_tests FORCE=1 flash_usb"
|
"command": "./fbt FIRMWARE_APP_SET=unit_tests FORCE=1 flash_usb"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "[Debug] Flash (USB, with resources)",
|
||||||
|
"group": "build",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "./fbt FORCE=1 flash_usb_full"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "[Release] Flash (USB, with resources)",
|
"label": "[Release] Flash (USB, with resources)",
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "./fbt COMPACT=1 DEBUG=0 FORCE=1 flash_usb_full"
|
"command": "./fbt COMPACT=1 DEBUG=0 FORCE=1 flash_usb_full"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "[Debug] Build FAPs",
|
||||||
|
"group": "build",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "./fbt plugin_dist"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "[Release] Build FAPs",
|
||||||
|
"group": "build",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "./fbt COMPACT=1 DEBUG=0 plugin_dist"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "[Debug] Launch App on Flipper",
|
||||||
|
"group": "build",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "./fbt launch_app APPSRC=${relativeFileDirname}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "[Release] Launch App on Flipper",
|
||||||
|
"group": "build",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "./fbt COMPACT=1 DEBUG=0 launch_app APPSRC=${relativeFileDirname}"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
18
ReadMe.md
18
ReadMe.md
@@ -14,6 +14,10 @@ You should clone with
|
|||||||
$ git clone --recursive https://github.com/flipperdevices/flipperzero-firmware.git
|
$ git clone --recursive https://github.com/flipperdevices/flipperzero-firmware.git
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Read the Docs
|
||||||
|
|
||||||
|
Check out details on [how to build firmware](documentation/fbt.md), [write applications](documentation/AppsOnSDCard.md), [un-brick your device](documentation/KeyCombo.md) and more in `documentation` folder.
|
||||||
|
|
||||||
# Update firmware
|
# Update firmware
|
||||||
|
|
||||||
[Get Latest Firmware from Update Server](https://update.flipperzero.one/)
|
[Get Latest Firmware from Update Server](https://update.flipperzero.one/)
|
||||||
@@ -74,19 +78,7 @@ brew bundle --verbose
|
|||||||
|
|
||||||
## Linux Prerequisites
|
## Linux Prerequisites
|
||||||
|
|
||||||
### gcc-arm-none-eabi
|
The FBT tool handles everything, only `git` is required.
|
||||||
|
|
||||||
```sh
|
|
||||||
toolchain="gcc-arm-none-eabi-10.3-2021.10"
|
|
||||||
toolchain_package="$toolchain-$(uname -m)-linux"
|
|
||||||
|
|
||||||
wget -P /opt "https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/$toolchain_package.tar.bz2"
|
|
||||||
|
|
||||||
tar xjf /opt/$toolchain_package.tar.bz2 -C /opt
|
|
||||||
rm /opt/$toolchain_package.tar.bz2
|
|
||||||
|
|
||||||
for file in /opt/$toolchain/bin/* ; do ln -s "${file}" "/usr/bin/$(basename ${file})" ; done
|
|
||||||
```
|
|
||||||
|
|
||||||
### Optional dependencies
|
### Optional dependencies
|
||||||
|
|
||||||
|
|||||||
32
SConstruct
32
SConstruct
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Main Fipper Build System entry point
|
# Main Flipper Build System entry point
|
||||||
#
|
#
|
||||||
# This file is evaluated by scons (the build system) every time fbt is invoked.
|
# This file is evaluated by scons (the build system) every time fbt is invoked.
|
||||||
# Scons constructs all referenced environments & their targets' dependency
|
# Scons constructs all referenced environments & their targets' dependency
|
||||||
@@ -9,13 +9,14 @@
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
DefaultEnvironment(tools=[])
|
||||||
|
|
||||||
EnsurePythonVersion(3, 8)
|
EnsurePythonVersion(3, 8)
|
||||||
|
|
||||||
DefaultEnvironment(tools=[])
|
|
||||||
# Progress(["OwO\r", "owo\r", "uwu\r", "owo\r"], interval=15)
|
# Progress(["OwO\r", "owo\r", "uwu\r", "owo\r"], interval=15)
|
||||||
|
|
||||||
|
|
||||||
# This environment is created only for loading options & validating file/dir existance
|
# This environment is created only for loading options & validating file/dir existence
|
||||||
fbt_variables = SConscript("site_scons/commandline.scons")
|
fbt_variables = SConscript("site_scons/commandline.scons")
|
||||||
cmd_environment = Environment(tools=[], variables=fbt_variables)
|
cmd_environment = Environment(tools=[], variables=fbt_variables)
|
||||||
Help(fbt_variables.GenerateHelpText(cmd_environment))
|
Help(fbt_variables.GenerateHelpText(cmd_environment))
|
||||||
@@ -58,6 +59,8 @@ distenv = coreenv.Clone(
|
|||||||
"-ex",
|
"-ex",
|
||||||
"source debug/FreeRTOS/FreeRTOS.py",
|
"source debug/FreeRTOS/FreeRTOS.py",
|
||||||
"-ex",
|
"-ex",
|
||||||
|
"source debug/flipperapps.py",
|
||||||
|
"-ex",
|
||||||
"source debug/PyCortexMDebug/PyCortexMDebug.py",
|
"source debug/PyCortexMDebug/PyCortexMDebug.py",
|
||||||
"-ex",
|
"-ex",
|
||||||
"svd_load ${SVD_FILE}",
|
"svd_load ${SVD_FILE}",
|
||||||
@@ -160,6 +163,28 @@ if GetOption("fullenv") or any(
|
|||||||
basic_dist = distenv.DistCommand("fw_dist", distenv["DIST_DEPENDS"])
|
basic_dist = distenv.DistCommand("fw_dist", distenv["DIST_DEPENDS"])
|
||||||
distenv.Default(basic_dist)
|
distenv.Default(basic_dist)
|
||||||
|
|
||||||
|
dist_dir = distenv.GetProjetDirName()
|
||||||
|
plugin_dist = [
|
||||||
|
distenv.Install(
|
||||||
|
f"#/dist/{dist_dir}/apps/debug_elf",
|
||||||
|
firmware_env["FW_EXTAPPS"]["debug"].values(),
|
||||||
|
),
|
||||||
|
*(
|
||||||
|
distenv.Install(f"#/dist/{dist_dir}/apps/{dist_entry[0]}", dist_entry[1])
|
||||||
|
for dist_entry in firmware_env["FW_EXTAPPS"]["dist"].values()
|
||||||
|
),
|
||||||
|
]
|
||||||
|
Depends(plugin_dist, firmware_env["FW_EXTAPPS"]["validators"].values())
|
||||||
|
Alias("plugin_dist", plugin_dist)
|
||||||
|
# distenv.Default(plugin_dist)
|
||||||
|
|
||||||
|
plugin_resources_dist = list(
|
||||||
|
distenv.Install(f"#/assets/resources/apps/{dist_entry[0]}", dist_entry[1])
|
||||||
|
for dist_entry in firmware_env["FW_EXTAPPS"]["dist"].values()
|
||||||
|
)
|
||||||
|
distenv.Depends(firmware_env["FW_RESOURCES"], plugin_resources_dist)
|
||||||
|
|
||||||
|
|
||||||
# Target for bundling core2 package for qFlipper
|
# Target for bundling core2 package for qFlipper
|
||||||
copro_dist = distenv.CoproBuilder(
|
copro_dist = distenv.CoproBuilder(
|
||||||
distenv.Dir("assets/core2_firmware"),
|
distenv.Dir("assets/core2_firmware"),
|
||||||
@@ -240,7 +265,6 @@ firmware_env.Append(
|
|||||||
"site_scons",
|
"site_scons",
|
||||||
"scripts",
|
"scripts",
|
||||||
# Extra files
|
# Extra files
|
||||||
"applications/extapps.scons",
|
|
||||||
"SConstruct",
|
"SConstruct",
|
||||||
"firmware.scons",
|
"firmware.scons",
|
||||||
"fbt_options.py",
|
"fbt_options.py",
|
||||||
|
|||||||
@@ -1,38 +1,89 @@
|
|||||||
# Structure
|
# Structure
|
||||||
|
|
||||||
- `about` - Small About application that shows flipper info
|
## debug
|
||||||
|
|
||||||
|
Applications for factory testing the Flipper.
|
||||||
|
|
||||||
- `accessor` - Wiegand server
|
- `accessor` - Wiegand server
|
||||||
|
- `battery_test_app` - Battery debug app
|
||||||
|
- `blink_test` - LED blinker
|
||||||
|
- `bt_debug_app` - BT test app. Requires full BT stack installed
|
||||||
|
- `display_test` - Various display tests & tweaks
|
||||||
|
- `file_browser_test` - Test UI for file picker
|
||||||
|
- `keypad_test` - Keypad test
|
||||||
|
- `lfrfid_debug` - LF RFID debug tool
|
||||||
|
- `text_box_test` - UI tests
|
||||||
|
- `uart_echo` - UART mode test
|
||||||
|
- `unit_tests` - Unit tests
|
||||||
|
- `usb_mouse` - USB HID test
|
||||||
|
- `usb_test` - Other USB tests
|
||||||
|
- `vibro_test` - Vibro test
|
||||||
|
|
||||||
|
|
||||||
|
## main
|
||||||
|
|
||||||
|
Applications for main Flipper menu.
|
||||||
|
|
||||||
- `archive` - Archive and file manager
|
- `archive` - Archive and file manager
|
||||||
- `bad_usb` - Bad USB application
|
- `bad_usb` - Bad USB application
|
||||||
|
- `fap_loader` - External applications loader
|
||||||
|
- `gpio` - GPIO application: includes USART bridge and GPIO control
|
||||||
|
- `ibutton` - iButton application, onewire keys and more
|
||||||
|
- `infrared` - Infrared application, controls your IR devices
|
||||||
|
- `lfrfid` - LF RFID application
|
||||||
|
- `nfc` - NFC application, HF rfid, EMV and etc
|
||||||
|
- `subghz` - SubGhz application, 433 fobs and etc
|
||||||
|
- `u2f` - U2F Application
|
||||||
|
|
||||||
|
|
||||||
|
## plugins
|
||||||
|
|
||||||
|
Extra apps for Plugins & App Loader menus.
|
||||||
|
|
||||||
|
- `bt_hid_app` - BT Remote controller
|
||||||
|
- `music_player` - Music player app (demo)
|
||||||
|
- `picopass` - Picopass tool
|
||||||
|
- `snake_game` - Snake game application
|
||||||
|
|
||||||
|
|
||||||
|
## services
|
||||||
|
|
||||||
|
Background services providing system APIs to applications.
|
||||||
|
|
||||||
|
- `applications.h` - Firmware application list header
|
||||||
|
|
||||||
- `bt` - BLE service and application
|
- `bt` - BLE service and application
|
||||||
- `cli` - Console service and API
|
- `cli` - Console service and API
|
||||||
- `crypto` - Crypto cli tools
|
- `crypto` - Crypto cli tools
|
||||||
- `debug_tools` - Different tools that we use for debug
|
|
||||||
- `desktop` - Desktop service
|
- `desktop` - Desktop service
|
||||||
- `dialogs` - Dialogs service: GUI Dialogs for your app
|
- `dialogs` - Dialogs service: GUI Dialogs for your app
|
||||||
- `dolphin` - Dolphin service and supplementary apps
|
- `dolphin` - Dolphin service and supplementary apps
|
||||||
- `gpio` - GPIO application: includes USART bridge and GPIO control
|
|
||||||
- `gui` - GUI service and API
|
- `gui` - GUI service and API
|
||||||
- `ibutton` - iButton application, onewire keys and more
|
|
||||||
- `input` - Input service
|
- `input` - Input service
|
||||||
- `infrared` - Infrared application, controls your IR devices
|
|
||||||
- `lfrfid` - LF RFID application
|
|
||||||
- `lfrfid_debug` - LF RFID debug tool
|
|
||||||
- `loader` - Application loader service
|
- `loader` - Application loader service
|
||||||
- `music_player` - Music player app (demo)
|
|
||||||
- `nfc` - NFC application, HF rfid, EMV and etc
|
|
||||||
- `notification` - Notification service
|
- `notification` - Notification service
|
||||||
- `power` - Power service
|
- `power` - Power service
|
||||||
- `power_observer` - Power debug tool
|
|
||||||
- `rpc` - RPC service and API
|
- `rpc` - RPC service and API
|
||||||
- `scened_app_example` - C++ application example
|
|
||||||
- `snake_game` - Snake game application
|
|
||||||
- `storage` - Storage service, internal + sdcard
|
- `storage` - Storage service, internal + sdcard
|
||||||
- `storage_settings` - Storage settings app
|
|
||||||
- `subghz` - SubGhz application, 433 fobs and etc
|
|
||||||
- `system` - System settings, tools and API
|
|
||||||
- `tests` - Unit tests and etc
|
|
||||||
- `u2f` - U2F Application
|
|
||||||
- `updater` - Update service & application
|
|
||||||
|
|
||||||
- `application.h` - Firmware application list header
|
|
||||||
|
## 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
|
||||||
|
|||||||
@@ -1,66 +0,0 @@
|
|||||||
App(
|
|
||||||
appid="bt",
|
|
||||||
name="BtSrv",
|
|
||||||
apptype=FlipperAppType.SERVICE,
|
|
||||||
entry_point="bt_srv",
|
|
||||||
cdefines=["SRV_BT"],
|
|
||||||
requires=[
|
|
||||||
"cli",
|
|
||||||
"dialogs",
|
|
||||||
],
|
|
||||||
provides=[
|
|
||||||
"bt_start",
|
|
||||||
"bt_settings",
|
|
||||||
"bt_debug",
|
|
||||||
],
|
|
||||||
stack_size=1 * 1024,
|
|
||||||
order=20,
|
|
||||||
)
|
|
||||||
|
|
||||||
App(
|
|
||||||
appid="bt_start",
|
|
||||||
apptype=FlipperAppType.STARTUP,
|
|
||||||
entry_point="bt_on_system_start",
|
|
||||||
order=70,
|
|
||||||
)
|
|
||||||
|
|
||||||
App(
|
|
||||||
appid="bt_settings",
|
|
||||||
name="Bluetooth",
|
|
||||||
apptype=FlipperAppType.SETTINGS,
|
|
||||||
entry_point="bt_settings_app",
|
|
||||||
stack_size=1 * 1024,
|
|
||||||
requires=[
|
|
||||||
"bt",
|
|
||||||
"gui",
|
|
||||||
],
|
|
||||||
order=10,
|
|
||||||
)
|
|
||||||
|
|
||||||
App(
|
|
||||||
appid="bt_debug",
|
|
||||||
name="Bluetooth Debug",
|
|
||||||
apptype=FlipperAppType.DEBUG,
|
|
||||||
entry_point="bt_debug_app",
|
|
||||||
stack_size=1 * 1024,
|
|
||||||
requires=[
|
|
||||||
"bt",
|
|
||||||
"gui",
|
|
||||||
"dialogs",
|
|
||||||
],
|
|
||||||
order=110,
|
|
||||||
)
|
|
||||||
|
|
||||||
App(
|
|
||||||
appid="bt_hid",
|
|
||||||
name="Bluetooth Remote",
|
|
||||||
apptype=FlipperAppType.PLUGIN,
|
|
||||||
entry_point="bt_hid_app",
|
|
||||||
stack_size=1 * 1024,
|
|
||||||
cdefines=["APP_BLE_HID"],
|
|
||||||
requires=[
|
|
||||||
"bt",
|
|
||||||
"gui",
|
|
||||||
],
|
|
||||||
order=10,
|
|
||||||
)
|
|
||||||
@@ -7,4 +7,5 @@ App(
|
|||||||
requires=["gui"],
|
requires=["gui"],
|
||||||
stack_size=4 * 1024,
|
stack_size=4 * 1024,
|
||||||
order=40,
|
order=40,
|
||||||
|
fap_category="Debug",
|
||||||
)
|
)
|
||||||
16
applications/debug/application.fam
Normal file
16
applications/debug/application.fam
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
App(
|
||||||
|
appid="debug_apps",
|
||||||
|
name="Basic debug apps bundle",
|
||||||
|
apptype=FlipperAppType.METAPACKAGE,
|
||||||
|
provides=[
|
||||||
|
"blink_test",
|
||||||
|
"vibro_test",
|
||||||
|
"keypad_test",
|
||||||
|
"usb_test",
|
||||||
|
"usb_mouse",
|
||||||
|
"uart_echo",
|
||||||
|
"display_test",
|
||||||
|
"text_box_test",
|
||||||
|
"file_browser_test",
|
||||||
|
],
|
||||||
|
)
|
||||||
14
applications/debug/battery_test_app/application.fam
Normal file
14
applications/debug/battery_test_app/application.fam
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
App(
|
||||||
|
appid="battery_test",
|
||||||
|
name="Battery Test",
|
||||||
|
apptype=FlipperAppType.DEBUG,
|
||||||
|
entry_point="battery_test_app",
|
||||||
|
cdefines=["APP_BATTERY_TEST"],
|
||||||
|
requires=[
|
||||||
|
"gui",
|
||||||
|
"power",
|
||||||
|
],
|
||||||
|
stack_size=1 * 1024,
|
||||||
|
order=130,
|
||||||
|
fap_category="Debug",
|
||||||
|
)
|
||||||
10
applications/power/battery_test_app/battery_test_app.c → applications/debug/battery_test_app/battery_test_app.c
Executable file → Normal file
10
applications/power/battery_test_app/battery_test_app.c → applications/debug/battery_test_app/battery_test_app.c
Executable file → Normal file
@@ -27,7 +27,7 @@ static void battery_test_battery_info_update_model(void* context) {
|
|||||||
.charge = app->info.charge,
|
.charge = app->info.charge,
|
||||||
.health = app->info.health,
|
.health = app->info.health,
|
||||||
};
|
};
|
||||||
battery_info_set_data(app->batery_info, &battery_info_data);
|
battery_info_set_data(app->battery_info, &battery_info_data);
|
||||||
notification_message(app->notifications, &sequence_display_backlight_on);
|
notification_message(app->notifications, &sequence_display_backlight_on);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,13 +48,13 @@ BatteryTestApp* battery_test_alloc() {
|
|||||||
view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
|
view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
|
||||||
|
|
||||||
// Views
|
// Views
|
||||||
app->batery_info = battery_info_alloc();
|
app->battery_info = battery_info_alloc();
|
||||||
view_set_previous_callback(
|
view_set_previous_callback(
|
||||||
battery_info_get_view(app->batery_info), battery_test_exit_confirm_view);
|
battery_info_get_view(app->battery_info), battery_test_exit_confirm_view);
|
||||||
view_dispatcher_add_view(
|
view_dispatcher_add_view(
|
||||||
app->view_dispatcher,
|
app->view_dispatcher,
|
||||||
BatteryTestAppViewBatteryInfo,
|
BatteryTestAppViewBatteryInfo,
|
||||||
battery_info_get_view(app->batery_info));
|
battery_info_get_view(app->battery_info));
|
||||||
|
|
||||||
app->dialog = dialog_ex_alloc();
|
app->dialog = dialog_ex_alloc();
|
||||||
dialog_ex_set_header(app->dialog, "Close Battery Test?", 64, 12, AlignCenter, AlignTop);
|
dialog_ex_set_header(app->dialog, "Close Battery Test?", 64, 12, AlignCenter, AlignTop);
|
||||||
@@ -76,7 +76,7 @@ void battery_test_free(BatteryTestApp* app) {
|
|||||||
|
|
||||||
// Views
|
// Views
|
||||||
view_dispatcher_remove_view(app->view_dispatcher, BatteryTestAppViewBatteryInfo);
|
view_dispatcher_remove_view(app->view_dispatcher, BatteryTestAppViewBatteryInfo);
|
||||||
battery_info_free(app->batery_info);
|
battery_info_free(app->battery_info);
|
||||||
view_dispatcher_remove_view(app->view_dispatcher, BatteryTestAppViewExitDialog);
|
view_dispatcher_remove_view(app->view_dispatcher, BatteryTestAppViewExitDialog);
|
||||||
dialog_ex_free(app->dialog);
|
dialog_ex_free(app->dialog);
|
||||||
// View dispatcher
|
// View dispatcher
|
||||||
@@ -6,14 +6,15 @@
|
|||||||
#include <notification/notification.h>
|
#include <notification/notification.h>
|
||||||
|
|
||||||
#include <gui/modules/dialog_ex.h>
|
#include <gui/modules/dialog_ex.h>
|
||||||
#include <power/power_settings_app/views/battery_info.h>
|
// FIXME
|
||||||
|
#include "../settings/power_settings_app/views/battery_info.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Power* power;
|
Power* power;
|
||||||
Gui* gui;
|
Gui* gui;
|
||||||
NotificationApp* notifications;
|
NotificationApp* notifications;
|
||||||
ViewDispatcher* view_dispatcher;
|
ViewDispatcher* view_dispatcher;
|
||||||
BatteryInfo* batery_info;
|
BatteryInfo* battery_info;
|
||||||
DialogEx* dialog;
|
DialogEx* dialog;
|
||||||
PowerInfo info;
|
PowerInfo info;
|
||||||
} BatteryTestApp;
|
} BatteryTestApp;
|
||||||
11
applications/debug/blink_test/application.fam
Normal file
11
applications/debug/blink_test/application.fam
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
App(
|
||||||
|
appid="blink_test",
|
||||||
|
name="Blink Test",
|
||||||
|
apptype=FlipperAppType.DEBUG,
|
||||||
|
entry_point="blink_test_app",
|
||||||
|
cdefines=["APP_BLINK"],
|
||||||
|
requires=["gui"],
|
||||||
|
stack_size=1 * 1024,
|
||||||
|
order=10,
|
||||||
|
fap_category="Debug",
|
||||||
|
)
|
||||||
18
applications/debug/bt_debug_app/application.fam
Normal file
18
applications/debug/bt_debug_app/application.fam
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
App(
|
||||||
|
appid="bt_debug",
|
||||||
|
name="Bluetooth Debug",
|
||||||
|
apptype=FlipperAppType.DEBUG,
|
||||||
|
entry_point="bt_debug_app",
|
||||||
|
cdefines=["SRV_BT"],
|
||||||
|
requires=[
|
||||||
|
"bt",
|
||||||
|
"gui",
|
||||||
|
"dialogs",
|
||||||
|
],
|
||||||
|
provides=[
|
||||||
|
"bt_debug",
|
||||||
|
],
|
||||||
|
stack_size=1 * 1024,
|
||||||
|
order=110,
|
||||||
|
fap_category="Debug",
|
||||||
|
)
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <gui/modules/submenu.h>
|
#include <gui/modules/submenu.h>
|
||||||
#include "views/bt_carrier_test.h"
|
#include "views/bt_carrier_test.h"
|
||||||
#include "views/bt_packet_test.h"
|
#include "views/bt_packet_test.h"
|
||||||
#include "../bt_settings.h"
|
#include <bt/bt_settings.h>
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
BtSettings settings;
|
BtSettings settings;
|
||||||
0
applications/bt/bt_debug_app/views/bt_carrier_test.c → applications/debug/bt_debug_app/views/bt_carrier_test.c
Executable file → Normal file
0
applications/bt/bt_debug_app/views/bt_carrier_test.c → applications/debug/bt_debug_app/views/bt_carrier_test.c
Executable file → Normal file
0
applications/bt/bt_debug_app/views/bt_test.c → applications/debug/bt_debug_app/views/bt_test.c
Executable file → Normal file
0
applications/bt/bt_debug_app/views/bt_test.c → applications/debug/bt_debug_app/views/bt_test.c
Executable file → Normal file
0
applications/bt/bt_debug_app/views/bt_test.h → applications/debug/bt_debug_app/views/bt_test.h
Executable file → Normal file
0
applications/bt/bt_debug_app/views/bt_test.h → applications/debug/bt_debug_app/views/bt_test.h
Executable file → Normal file
11
applications/debug/display_test/application.fam
Normal file
11
applications/debug/display_test/application.fam
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
App(
|
||||||
|
appid="display_test",
|
||||||
|
name="Display Test",
|
||||||
|
apptype=FlipperAppType.DEBUG,
|
||||||
|
entry_point="display_test_app",
|
||||||
|
cdefines=["APP_DISPLAY_TEST"],
|
||||||
|
requires=["gui"],
|
||||||
|
stack_size=1 * 1024,
|
||||||
|
order=120,
|
||||||
|
fap_category="Debug",
|
||||||
|
)
|
||||||
11
applications/debug/file_browser_test/application.fam
Normal file
11
applications/debug/file_browser_test/application.fam
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
App(
|
||||||
|
appid="file_browser_test",
|
||||||
|
name="File Browser Test",
|
||||||
|
apptype=FlipperAppType.DEBUG,
|
||||||
|
entry_point="file_browser_app",
|
||||||
|
cdefines=["APP_FILE_BROWSER_TEST"],
|
||||||
|
requires=["gui"],
|
||||||
|
stack_size=2 * 1024,
|
||||||
|
order=150,
|
||||||
|
fap_category="Debug",
|
||||||
|
)
|
||||||
11
applications/debug/keypad_test/application.fam
Normal file
11
applications/debug/keypad_test/application.fam
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
App(
|
||||||
|
appid="keypad_test",
|
||||||
|
name="Keypad Test",
|
||||||
|
apptype=FlipperAppType.DEBUG,
|
||||||
|
entry_point="keypad_test_app",
|
||||||
|
cdefines=["APP_KEYPAD_TEST"],
|
||||||
|
requires=["gui"],
|
||||||
|
stack_size=1 * 1024,
|
||||||
|
order=30,
|
||||||
|
fap_category="Debug",
|
||||||
|
)
|
||||||
@@ -5,8 +5,11 @@ App(
|
|||||||
entry_point="lfrfid_debug_app",
|
entry_point="lfrfid_debug_app",
|
||||||
requires=[
|
requires=[
|
||||||
"gui",
|
"gui",
|
||||||
"lfrfid",
|
],
|
||||||
|
provides=[
|
||||||
|
"lfrfid_debug",
|
||||||
],
|
],
|
||||||
stack_size=1 * 1024,
|
stack_size=1 * 1024,
|
||||||
order=100,
|
order=100,
|
||||||
|
fap_category="Debug",
|
||||||
)
|
)
|
||||||
81
applications/debug/lfrfid_debug/lfrfid_debug.c
Normal file
81
applications/debug/lfrfid_debug/lfrfid_debug.c
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
#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;
|
||||||
|
}
|
||||||
30
applications/debug/lfrfid_debug/lfrfid_debug_i.h
Normal file
30
applications/debug/lfrfid_debug/lfrfid_debug_i.h
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
#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,0 +1,44 @@
|
|||||||
|
#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);
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "lfrfid_debug_app_scene_tune.h"
|
#include "../lfrfid_debug_i.h"
|
||||||
#include <furi_hal.h>
|
#include <furi_hal.h>
|
||||||
|
|
||||||
static void comparator_trigger_callback(bool level, void* comp_ctx) {
|
static void comparator_trigger_callback(bool level, void* comp_ctx) {
|
||||||
@@ -6,32 +6,38 @@ static void comparator_trigger_callback(bool level, void* comp_ctx) {
|
|||||||
furi_hal_gpio_write(&gpio_ext_pa7, !level);
|
furi_hal_gpio_write(&gpio_ext_pa7, !level);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LfRfidDebugAppSceneTune::on_enter(LfRfidDebugApp* app, bool /* need_restore */) {
|
void lfrfid_debug_scene_tune_on_enter(void* context) {
|
||||||
app->view_controller.switch_to<LfRfidViewTuneVM>();
|
LfRfidDebug* app = context;
|
||||||
|
|
||||||
furi_hal_gpio_init_simple(&gpio_ext_pa7, GpioModeOutputPushPull);
|
furi_hal_gpio_init_simple(&gpio_ext_pa7, GpioModeOutputPushPull);
|
||||||
|
|
||||||
furi_hal_rfid_comp_set_callback(comparator_trigger_callback, this);
|
furi_hal_rfid_comp_set_callback(comparator_trigger_callback, app);
|
||||||
furi_hal_rfid_comp_start();
|
furi_hal_rfid_comp_start();
|
||||||
|
|
||||||
furi_hal_rfid_pins_read();
|
furi_hal_rfid_pins_read();
|
||||||
furi_hal_rfid_tim_read(125000, 0.5);
|
furi_hal_rfid_tim_read(125000, 0.5);
|
||||||
furi_hal_rfid_tim_read_start();
|
furi_hal_rfid_tim_read_start();
|
||||||
|
|
||||||
|
view_dispatcher_switch_to_view(app->view_dispatcher, LfRfidDebugViewTune);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LfRfidDebugAppSceneTune::on_event(LfRfidDebugApp* app, LfRfidDebugApp::Event* /* event */) {
|
bool lfrfid_debug_scene_tune_on_event(void* context, SceneManagerEvent event) {
|
||||||
|
UNUSED(event);
|
||||||
|
|
||||||
|
LfRfidDebug* app = context;
|
||||||
bool consumed = false;
|
bool consumed = false;
|
||||||
|
|
||||||
LfRfidViewTuneVM* tune = app->view_controller;
|
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));
|
||||||
if(tune->is_dirty()) {
|
furi_hal_rfid_set_read_pulse(lfrfid_debug_view_tune_get_ccr(app->tune_view));
|
||||||
furi_hal_rfid_set_read_period(tune->get_ARR());
|
|
||||||
furi_hal_rfid_set_read_pulse(tune->get_CCR());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return consumed;
|
return consumed;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LfRfidDebugAppSceneTune::on_exit(LfRfidDebugApp* /* app */) {
|
void lfrfid_debug_scene_tune_on_exit(void* context) {
|
||||||
|
UNUSED(context);
|
||||||
|
|
||||||
furi_hal_rfid_comp_stop();
|
furi_hal_rfid_comp_stop();
|
||||||
furi_hal_rfid_comp_set_callback(NULL, NULL);
|
furi_hal_rfid_comp_set_callback(NULL, NULL);
|
||||||
|
|
||||||
30
applications/debug/lfrfid_debug/scenes/lfrfid_debug_scene.c
Normal file
30
applications/debug/lfrfid_debug/scenes/lfrfid_debug_scene.c
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
#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,
|
||||||
|
};
|
||||||
29
applications/debug/lfrfid_debug/scenes/lfrfid_debug_scene.h
Normal file
29
applications/debug/lfrfid_debug/scenes/lfrfid_debug_scene.h
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
#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,0 +1,2 @@
|
|||||||
|
ADD_SCENE(lfrfid_debug, start, Start)
|
||||||
|
ADD_SCENE(lfrfid_debug, tune, Tune)
|
||||||
229
applications/debug/lfrfid_debug/views/lfrfid_debug_view_tune.c
Normal file
229
applications/debug/lfrfid_debug/views/lfrfid_debug_view_tune.c
Normal file
@@ -0,0 +1,229 @@
|
|||||||
|
#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--;
|
||||||
|
return 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++;
|
||||||
|
return 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;
|
||||||
|
return 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;
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static void lfrfid_debug_view_tune_button_ok(LfRfidTuneView* tune_view) {
|
||||||
|
with_view_model(
|
||||||
|
tune_view->view, (LfRfidTuneViewModel * model) {
|
||||||
|
model->fine = !model->fine;
|
||||||
|
return 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;
|
||||||
|
return 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;
|
||||||
|
return 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;
|
||||||
|
return 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;
|
||||||
|
return 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;
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#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);
|
||||||
11
applications/debug/text_box_test/application.fam
Normal file
11
applications/debug/text_box_test/application.fam
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
App(
|
||||||
|
appid="text_box_test",
|
||||||
|
name="Text Box Test",
|
||||||
|
apptype=FlipperAppType.DEBUG,
|
||||||
|
entry_point="text_box_test_app",
|
||||||
|
cdefines=["APP_TEXT_BOX_TEST"],
|
||||||
|
requires=["gui"],
|
||||||
|
stack_size=1 * 1024,
|
||||||
|
order=140,
|
||||||
|
fap_category="Debug",
|
||||||
|
)
|
||||||
11
applications/debug/uart_echo/application.fam
Normal file
11
applications/debug/uart_echo/application.fam
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
App(
|
||||||
|
appid="uart_echo",
|
||||||
|
name="UART Echo",
|
||||||
|
apptype=FlipperAppType.DEBUG,
|
||||||
|
entry_point="uart_echo_app",
|
||||||
|
cdefines=["APP_UART_ECHO"],
|
||||||
|
requires=["gui"],
|
||||||
|
stack_size=2 * 1024,
|
||||||
|
order=70,
|
||||||
|
fap_category="Debug",
|
||||||
|
)
|
||||||
@@ -10,7 +10,7 @@ App(
|
|||||||
App(
|
App(
|
||||||
appid="delay_test",
|
appid="delay_test",
|
||||||
name="Delay Test",
|
name="Delay Test",
|
||||||
apptype=FlipperAppType.DEBUG,
|
apptype=FlipperAppType.SYSTEM,
|
||||||
entry_point="delay_test_app",
|
entry_point="delay_test_app",
|
||||||
stack_size=1 * 1024,
|
stack_size=1 * 1024,
|
||||||
requires=["unit_tests"],
|
requires=["unit_tests"],
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#include <furi.h>
|
#include <furi.h>
|
||||||
#include <furi_hal.h>
|
#include <furi_hal.h>
|
||||||
#include <applications/storage/storage.h>
|
#include <storage/storage.h>
|
||||||
#include <lib/flipper_format/flipper_format.h>
|
#include <lib/flipper_format/flipper_format.h>
|
||||||
#include <lib/nfc/protocols/nfca.h>
|
#include <lib/nfc/protocols/nfca.h>
|
||||||
#include <lib/digital_signal/digital_signal.h>
|
#include <lib/digital_signal/digital_signal.h>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
#define CAME_ATOMO_DIR_NAME EXT_PATH("subghz/assets/came_atomo")
|
#define CAME_ATOMO_DIR_NAME EXT_PATH("subghz/assets/came_atomo")
|
||||||
#define NICE_FLOR_S_DIR_NAME EXT_PATH("subghz/assets/nice_flor_s")
|
#define NICE_FLOR_S_DIR_NAME EXT_PATH("subghz/assets/nice_flor_s")
|
||||||
#define TEST_RANDOM_DIR_NAME EXT_PATH("unit_tests/subghz/test_random_raw.sub")
|
#define TEST_RANDOM_DIR_NAME EXT_PATH("unit_tests/subghz/test_random_raw.sub")
|
||||||
#define TEST_RANDOM_COUNT_PARSE 196
|
#define TEST_RANDOM_COUNT_PARSE 233
|
||||||
#define TEST_TIMEOUT 10000
|
#define TEST_TIMEOUT 10000
|
||||||
|
|
||||||
static SubGhzEnvironment* environment_handler;
|
static SubGhzEnvironment* environment_handler;
|
||||||
@@ -127,7 +127,7 @@ static bool subghz_decode_random_test(const char* path) {
|
|||||||
}
|
}
|
||||||
subghz_file_encoder_worker_free(file_worker_encoder_handler);
|
subghz_file_encoder_worker_free(file_worker_encoder_handler);
|
||||||
}
|
}
|
||||||
FURI_LOG_T(TAG, "\r\n Decoder count parse \033[0;33m%d\033[0m ", subghz_test_decoder_count);
|
FURI_LOG_D(TAG, "\r\n Decoder count parse \033[0;33m%d\033[0m ", subghz_test_decoder_count);
|
||||||
if(furi_get_tick() - test_start > TEST_TIMEOUT * 10) {
|
if(furi_get_tick() - test_start > TEST_TIMEOUT * 10) {
|
||||||
printf("\033[0;31mRandom test ERROR TimeOut\033[0m\r\n");
|
printf("\033[0;31mRandom test ERROR TimeOut\033[0m\r\n");
|
||||||
return false;
|
return false;
|
||||||
@@ -419,6 +419,28 @@ MU_TEST(subghz_decoder_magellen_test) {
|
|||||||
"Test decoder " SUBGHZ_PROTOCOL_MAGELLEN_NAME " error\r\n");
|
"Test decoder " SUBGHZ_PROTOCOL_MAGELLEN_NAME " error\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MU_TEST(subghz_decoder_intertechno_v3_test) {
|
||||||
|
mu_assert(
|
||||||
|
subghz_decoder_test(
|
||||||
|
EXT_PATH("unit_tests/subghz/intertechno_v3_raw.sub"),
|
||||||
|
SUBGHZ_PROTOCOL_INTERTECHNO_V3_NAME),
|
||||||
|
"Test decoder " SUBGHZ_PROTOCOL_INTERTECHNO_V3_NAME " error\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
MU_TEST(subghz_decoder_clemsa_test) {
|
||||||
|
mu_assert(
|
||||||
|
subghz_decoder_test(
|
||||||
|
EXT_PATH("unit_tests/subghz/clemsa_raw.sub"), SUBGHZ_PROTOCOL_CLEMSA_NAME),
|
||||||
|
"Test decoder " SUBGHZ_PROTOCOL_CLEMSA_NAME " error\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
MU_TEST(subghz_decoder_oregon2_test) {
|
||||||
|
mu_assert(
|
||||||
|
subghz_decoder_test(
|
||||||
|
EXT_PATH("unit_tests/subghz/oregon2_raw.sub"), SUBGHZ_PROTOCOL_OREGON2_NAME),
|
||||||
|
"Test decoder " SUBGHZ_PROTOCOL_OREGON2_NAME " error\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
//test encoders
|
//test encoders
|
||||||
MU_TEST(subghz_encoder_princeton_test) {
|
MU_TEST(subghz_encoder_princeton_test) {
|
||||||
mu_assert(
|
mu_assert(
|
||||||
@@ -528,6 +550,18 @@ MU_TEST(subghz_encoder_magellen_test) {
|
|||||||
"Test encoder " SUBGHZ_PROTOCOL_MAGELLEN_NAME " error\r\n");
|
"Test encoder " SUBGHZ_PROTOCOL_MAGELLEN_NAME " error\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MU_TEST(subghz_encoder_intertechno_v3_test) {
|
||||||
|
mu_assert(
|
||||||
|
subghz_encoder_test(EXT_PATH("unit_tests/subghz/intertechno_v3.sub")),
|
||||||
|
"Test encoder " SUBGHZ_PROTOCOL_INTERTECHNO_V3_NAME " error\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
MU_TEST(subghz_encoder_clemsa_test) {
|
||||||
|
mu_assert(
|
||||||
|
subghz_encoder_test(EXT_PATH("unit_tests/subghz/clemsa.sub")),
|
||||||
|
"Test encoder " SUBGHZ_PROTOCOL_CLEMSA_NAME " error\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
MU_TEST(subghz_random_test) {
|
MU_TEST(subghz_random_test) {
|
||||||
mu_assert(subghz_decode_random_test(TEST_RANDOM_DIR_NAME), "Random test error\r\n");
|
mu_assert(subghz_decode_random_test(TEST_RANDOM_DIR_NAME), "Random test error\r\n");
|
||||||
}
|
}
|
||||||
@@ -566,6 +600,9 @@ MU_TEST_SUITE(subghz) {
|
|||||||
MU_RUN_TEST(subghz_decoder_phoenix_v2_test);
|
MU_RUN_TEST(subghz_decoder_phoenix_v2_test);
|
||||||
MU_RUN_TEST(subghz_decoder_honeywell_wdb_test);
|
MU_RUN_TEST(subghz_decoder_honeywell_wdb_test);
|
||||||
MU_RUN_TEST(subghz_decoder_magellen_test);
|
MU_RUN_TEST(subghz_decoder_magellen_test);
|
||||||
|
MU_RUN_TEST(subghz_decoder_intertechno_v3_test);
|
||||||
|
MU_RUN_TEST(subghz_decoder_clemsa_test);
|
||||||
|
MU_RUN_TEST(subghz_decoder_oregon2_test);
|
||||||
|
|
||||||
MU_RUN_TEST(subghz_encoder_princeton_test);
|
MU_RUN_TEST(subghz_encoder_princeton_test);
|
||||||
MU_RUN_TEST(subghz_encoder_came_test);
|
MU_RUN_TEST(subghz_encoder_came_test);
|
||||||
@@ -585,6 +622,8 @@ MU_TEST_SUITE(subghz) {
|
|||||||
MU_RUN_TEST(subghz_encoder_phoenix_v2_test);
|
MU_RUN_TEST(subghz_encoder_phoenix_v2_test);
|
||||||
MU_RUN_TEST(subghz_encoder_honeywell_wdb_test);
|
MU_RUN_TEST(subghz_encoder_honeywell_wdb_test);
|
||||||
MU_RUN_TEST(subghz_encoder_magellen_test);
|
MU_RUN_TEST(subghz_encoder_magellen_test);
|
||||||
|
MU_RUN_TEST(subghz_encoder_intertechno_v3_test);
|
||||||
|
MU_RUN_TEST(subghz_encoder_clemsa_test);
|
||||||
|
|
||||||
MU_RUN_TEST(subghz_random_test);
|
MU_RUN_TEST(subghz_random_test);
|
||||||
subghz_test_deinit();
|
subghz_test_deinit();
|
||||||
11
applications/debug/usb_mouse/application.fam
Normal file
11
applications/debug/usb_mouse/application.fam
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
App(
|
||||||
|
appid="usb_mouse",
|
||||||
|
name="USB Mouse Demo",
|
||||||
|
apptype=FlipperAppType.DEBUG,
|
||||||
|
entry_point="usb_mouse_app",
|
||||||
|
cdefines=["APP_USB_MOUSE"],
|
||||||
|
requires=["gui"],
|
||||||
|
stack_size=1 * 1024,
|
||||||
|
order=60,
|
||||||
|
fap_category="Debug",
|
||||||
|
)
|
||||||
11
applications/debug/usb_test/application.fam
Normal file
11
applications/debug/usb_test/application.fam
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
App(
|
||||||
|
appid="usb_test",
|
||||||
|
name="USB Test",
|
||||||
|
apptype=FlipperAppType.DEBUG,
|
||||||
|
entry_point="usb_test_app",
|
||||||
|
cdefines=["APP_USB_TEST"],
|
||||||
|
requires=["gui"],
|
||||||
|
stack_size=1 * 1024,
|
||||||
|
order=50,
|
||||||
|
fap_category="Debug",
|
||||||
|
)
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user