Skip to content

Commit 94a401b

Browse files
authored
Merge pull request #12 from polarikus/sdk_1.3.2
Update to flipper SDK version 1.3.2
2 parents cd97f93 + f20e77c commit 94a401b

9 files changed

+114
-54
lines changed

.catalog/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v 0.4
2+
3+
- Update to flipper SDK version 1.3.2
4+
15
## v 0.3
26

37
- Update to flipper SDK version 0.98.1

.clang-format

+89-34
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,55 @@ Language: Cpp
33
AccessModifierOffset: -4
44
AlignAfterOpenBracket: AlwaysBreak
55
AlignArrayOfStructures: None
6-
AlignConsecutiveMacros: None
7-
AlignConsecutiveAssignments: None
8-
AlignConsecutiveBitFields: None
9-
AlignConsecutiveDeclarations: None
6+
AlignConsecutiveAssignments:
7+
Enabled: false
8+
AcrossEmptyLines: false
9+
AcrossComments: false
10+
AlignCompound: false
11+
AlignFunctionPointers: false
12+
PadOperators: true
13+
AlignConsecutiveBitFields:
14+
Enabled: true
15+
AcrossEmptyLines: true
16+
AcrossComments: true
17+
AlignCompound: false
18+
AlignFunctionPointers: false
19+
PadOperators: true
20+
AlignConsecutiveDeclarations:
21+
Enabled: false
22+
AcrossEmptyLines: false
23+
AcrossComments: false
24+
AlignCompound: false
25+
AlignFunctionPointers: false
26+
PadOperators: true
27+
AlignConsecutiveMacros:
28+
Enabled: true
29+
AcrossEmptyLines: false
30+
AcrossComments: true
31+
AlignCompound: true
32+
AlignFunctionPointers: false
33+
PadOperators: true
34+
AlignConsecutiveShortCaseStatements:
35+
Enabled: false
36+
AcrossEmptyLines: false
37+
AcrossComments: false
38+
AlignCaseColons: false
1039
AlignEscapedNewlines: Left
1140
AlignOperands: Align
12-
AlignTrailingComments: false
41+
AlignTrailingComments:
42+
Kind: Never
43+
OverEmptyLines: 0
1344
AllowAllArgumentsOnNextLine: true
1445
AllowAllParametersOfDeclarationOnNextLine: false
15-
AllowShortEnumsOnASingleLine: true
46+
AllowBreakBeforeNoexceptSpecifier: Never
1647
AllowShortBlocksOnASingleLine: Never
1748
AllowShortCaseLabelsOnASingleLine: false
49+
AllowShortCompoundRequirementOnASingleLine: true
50+
AllowShortEnumsOnASingleLine: false
1851
AllowShortFunctionsOnASingleLine: None
19-
AllowShortLambdasOnASingleLine: All
2052
AllowShortIfStatementsOnASingleLine: WithoutElse
21-
AllowShortLoopsOnASingleLine: true
53+
AllowShortLambdasOnASingleLine: All
54+
AllowShortLoopsOnASingleLine: false
2255
AlwaysBreakAfterDefinitionReturnType: None
2356
AlwaysBreakAfterReturnType: None
2457
AlwaysBreakBeforeMultilineStrings: false
@@ -27,17 +60,18 @@ AttributeMacros:
2760
- __capability
2861
BinPackArguments: false
2962
BinPackParameters: false
63+
BitFieldColonSpacing: Both
3064
BraceWrapping:
3165
AfterCaseLabel: false
3266
AfterClass: false
3367
AfterControlStatement: Never
3468
AfterEnum: false
69+
AfterExternBlock: false
3570
AfterFunction: false
3671
AfterNamespace: false
3772
AfterObjCDeclaration: false
3873
AfterStruct: false
3974
AfterUnion: false
40-
AfterExternBlock: false
4175
BeforeCatch: false
4276
BeforeElse: false
4377
BeforeLambdaBody: false
@@ -46,38 +80,35 @@ BraceWrapping:
4680
SplitEmptyFunction: true
4781
SplitEmptyRecord: true
4882
SplitEmptyNamespace: true
83+
BreakAdjacentStringLiterals: true
84+
BreakAfterAttributes: Leave
85+
BreakAfterJavaFieldAnnotations: false
86+
BreakArrays: true
4987
BreakBeforeBinaryOperators: None
50-
BreakBeforeConceptDeclarations: true
88+
BreakBeforeConceptDeclarations: Always
5189
BreakBeforeBraces: Attach
52-
BreakBeforeInheritanceComma: false
53-
BreakInheritanceList: BeforeColon
90+
BreakBeforeInlineASMColon: OnlyMultiline
5491
BreakBeforeTernaryOperators: false
55-
BreakConstructorInitializersBeforeComma: false
5692
BreakConstructorInitializers: BeforeComma
57-
BreakAfterJavaFieldAnnotations: false
93+
BreakInheritanceList: BeforeColon
5894
BreakStringLiterals: false
5995
ColumnLimit: 99
6096
CommentPragmas: '^ IWYU pragma:'
61-
QualifierAlignment: Leave
6297
CompactNamespaces: false
6398
ConstructorInitializerIndentWidth: 4
6499
ContinuationIndentWidth: 4
65100
Cpp11BracedListStyle: true
66-
DeriveLineEnding: true
67101
DerivePointerAlignment: false
68102
DisableFormat: false
69103
EmptyLineAfterAccessModifier: Never
70104
EmptyLineBeforeAccessModifier: LogicalBlock
71105
ExperimentalAutoDetectBinPacking: false
72-
PackConstructorInitializers: BinPack
73-
BasedOnStyle: ''
74-
ConstructorInitializerAllOnOneLineOrOnePerLine: false
75-
AllowAllConstructorInitializersOnNextLine: true
76106
FixNamespaceComments: false
77107
ForEachMacros:
78108
- foreach
79109
- Q_FOREACH
80110
- BOOST_FOREACH
111+
- M_EACH
81112
IfMacros:
82113
- KJ_IF_MAYBE
83114
IncludeBlocks: Preserve
@@ -97,19 +128,30 @@ IncludeCategories:
97128
IncludeIsMainRegex: '(Test)?$'
98129
IncludeIsMainSourceRegex: ''
99130
IndentAccessModifiers: false
100-
IndentCaseLabels: false
101131
IndentCaseBlocks: false
132+
IndentCaseLabels: false
133+
IndentExternBlock: AfterExternBlock
102134
IndentGotoLabels: true
103135
IndentPPDirectives: None
104-
IndentExternBlock: AfterExternBlock
105-
IndentRequires: false
136+
IndentRequiresClause: false
106137
IndentWidth: 4
107138
IndentWrappedFunctionNames: true
139+
InsertBraces: false
140+
InsertNewlineAtEOF: true
108141
InsertTrailingCommas: None
142+
IntegerLiteralSeparator:
143+
Binary: 0
144+
BinaryMinDigits: 0
145+
Decimal: 0
146+
DecimalMinDigits: 0
147+
Hex: 0
148+
HexMinDigits: 0
109149
JavaScriptQuotes: Leave
110150
JavaScriptWrapImports: true
111151
KeepEmptyLinesAtTheStartOfBlocks: false
152+
KeepEmptyLinesAtEOF: false
112153
LambdaBodyIndentation: Signature
154+
LineEnding: DeriveLF
113155
MacroBlockBegin: ''
114156
MacroBlockEnd: ''
115157
MaxEmptyLinesToKeep: 1
@@ -119,34 +161,44 @@ ObjCBlockIndentWidth: 4
119161
ObjCBreakBeforeNestedBlockParam: true
120162
ObjCSpaceAfterProperty: true
121163
ObjCSpaceBeforeProtocolList: true
164+
PackConstructorInitializers: BinPack
122165
PenaltyBreakAssignment: 10
123166
PenaltyBreakBeforeFirstCallParameter: 30
124167
PenaltyBreakComment: 10
125168
PenaltyBreakFirstLessLess: 0
126169
PenaltyBreakOpenParenthesis: 0
170+
PenaltyBreakScopeResolution: 500
127171
PenaltyBreakString: 10
128172
PenaltyBreakTemplateDeclaration: 10
129173
PenaltyExcessCharacter: 100
130-
PenaltyReturnTypeOnItsOwnLine: 60
131174
PenaltyIndentedWhitespace: 0
175+
PenaltyReturnTypeOnItsOwnLine: 60
132176
PointerAlignment: Left
133177
PPIndentWidth: -1
178+
QualifierAlignment: Leave
134179
ReferenceAlignment: Pointer
135180
ReflowComments: false
136181
RemoveBracesLLVM: false
182+
RemoveParentheses: Leave
183+
RemoveSemicolon: true
184+
RequiresClausePosition: OwnLine
185+
RequiresExpressionIndentation: OuterScope
137186
SeparateDefinitionBlocks: Leave
138187
ShortNamespaceLines: 1
188+
SkipMacroDefinitionBody: false
139189
SortIncludes: Never
140190
SortJavaStaticImport: Before
141-
SortUsingDeclarations: false
191+
SortUsingDeclarations: Never
142192
SpaceAfterCStyleCast: false
143193
SpaceAfterLogicalNot: false
144194
SpaceAfterTemplateKeyword: true
195+
SpaceAroundPointerQualifiers: Default
145196
SpaceBeforeAssignmentOperators: true
146197
SpaceBeforeCaseColon: false
147198
SpaceBeforeCpp11BracedList: false
148199
SpaceBeforeCtorInitializerColon: true
149200
SpaceBeforeInheritanceColon: true
201+
SpaceBeforeJsonColon: false
150202
SpaceBeforeParens: Never
151203
SpaceBeforeParensOptions:
152204
AfterControlStatements: false
@@ -155,32 +207,35 @@ SpaceBeforeParensOptions:
155207
AfterFunctionDeclarationName: false
156208
AfterIfMacros: false
157209
AfterOverloadedOperator: false
210+
AfterPlacementOperator: true
211+
AfterRequiresInClause: false
212+
AfterRequiresInExpression: false
158213
BeforeNonEmptyParentheses: false
159-
SpaceAroundPointerQualifiers: Default
160214
SpaceBeforeRangeBasedForLoopColon: true
215+
SpaceBeforeSquareBrackets: false
161216
SpaceInEmptyBlock: false
162-
SpaceInEmptyParentheses: false
163217
SpacesBeforeTrailingComments: 1
164218
SpacesInAngles: Never
165-
SpacesInConditionalStatement: false
166219
SpacesInContainerLiterals: false
167-
SpacesInCStyleCastParentheses: false
168220
SpacesInLineCommentPrefix:
169221
Minimum: 1
170222
Maximum: -1
171-
SpacesInParentheses: false
223+
SpacesInParens: Never
224+
SpacesInParensOptions:
225+
InCStyleCasts: false
226+
InConditionalStatements: false
227+
InEmptyParentheses: false
228+
Other: false
172229
SpacesInSquareBrackets: false
173-
SpaceBeforeSquareBrackets: false
174-
BitFieldColonSpacing: Both
175-
Standard: c++03
230+
Standard: c++20
176231
StatementAttributeLikeMacros:
177232
- Q_EMIT
178233
StatementMacros:
179234
- Q_UNUSED
180235
- QT_REQUIRE_VERSION
181236
TabWidth: 4
182-
UseCRLF: false
183237
UseTab: Never
238+
VerilogBreakBetweenInstancePorts: true
184239
WhitespaceSensitiveMacros:
185240
- STRINGIZE
186241
- PP_STRINGIZE

application.fam

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ App(
1313
fap_libs=["assets"],
1414
fap_description="Emulates a barcode scanner for testing cash registers. Why buy a scanner when you have a flipper?",
1515
fap_author="Igor Danilov",
16-
fap_version=(0, 3),
16+
fap_version=(0, 4),
1717
order=70,
1818
fap_category="USB",
1919
fap_icon_assets="icons"

bc_scanner_app.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <furi.h>
33
#include <furi_hal.h>
44
#include <storage/storage.h>
5-
#define TAG "BarCodeScanner"
5+
#define TAG "BarCodeScanner"
66
#define WORKER_TAG TAG "App"
77

88
static bool bc_scanner_app_custom_event_callback(void* context, uint32_t event) {
@@ -39,7 +39,6 @@ BarCodeApp* bc_scanner_app_alloc(char* arg) {
3939
app->dialogs = furi_record_open(RECORD_DIALOGS);
4040

4141
app->view_dispatcher = view_dispatcher_alloc();
42-
view_dispatcher_enable_queue(app->view_dispatcher);
4342

4443
app->scene_manager = scene_manager_alloc(&bc_scanner_scene_handlers, app);
4544

bc_scanner_app_i.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
#include <gui/modules/widget.h>
1616
#include "views/bc_scanner_view.h"
1717

18-
#define RECORD_STORAGE "storage"
18+
#define RECORD_STORAGE "storage"
1919
#define BC_SCANNER_APP_PATH_FOLDER ANY_PATH("bcscanner")
20-
#define BC_SCANNER_APP_EXTENSION ".bc"
20+
#define BC_SCANNER_APP_EXTENSION ".bc"
2121

2222
typedef enum {
2323
BarCodeAppErrorNoFiles,

bc_scanner_script.c

+10-11
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
#include <storage/storage.h>
55
#include "bc_scanner_script.h"
66
#include "cli/cli_vcp.h"
7-
#include "cli/cli.h"
87

9-
#define TAG "BarCodeScanner"
10-
#define WORKER_TAG TAG "Worker"
8+
#define TAG "BarCodeScanner"
9+
#define WORKER_TAG TAG "Worker"
1110
#define FILE_BUFFER_LEN 50
1211

13-
#define SCRIPT_STATE_ERROR (-1)
14-
#define SCRIPT_STATE_END (-2)
12+
#define SCRIPT_STATE_ERROR (-1)
13+
#define SCRIPT_STATE_END (-2)
1514
#define SCRIPT_STATE_NEXT_LINE (-3)
1615

1716
#define UART_BAUD 19200
@@ -60,9 +59,9 @@ static void scan_sound() {
6059
*/
6160
static void usb_uart_serial_init(BarCodeScript* bc_script) {
6261
furi_hal_usb_unlock();
63-
Cli* cli = furi_record_open(RECORD_CLI);
64-
cli_session_close(cli);
65-
furi_record_close(RECORD_CLI);
62+
CliVcp* cli = furi_record_open(RECORD_CLI_VCP);
63+
cli_vcp_disable(cli);
64+
furi_record_close(RECORD_CLI_VCP);
6665
furi_check(furi_hal_usb_set_config(&usb_cdc_single, NULL) == true);
6766

6867
bc_script->serial_handle = furi_hal_serial_control_acquire(FuriHalSerialIdUsart);
@@ -76,9 +75,9 @@ static void usb_uart_serial_init(BarCodeScript* bc_script) {
7675
static void usb_uart_serial_deinit(BarCodeScript* bc_script) {
7776
furi_hal_usb_unlock();
7877
furi_check(furi_hal_usb_set_config(&usb_cdc_single, NULL) == true);
79-
Cli* cli = furi_record_open(RECORD_CLI);
80-
cli_session_open(cli, &cli_vcp);
81-
furi_record_close(RECORD_CLI);
78+
CliVcp* cli = furi_record_open(RECORD_CLI_VCP);
79+
cli_vcp_enable(cli);
80+
furi_record_close(RECORD_CLI_VCP);
8281
furi_hal_serial_deinit(bc_script->serial_handle);
8382
furi_hal_serial_control_release(bc_script->serial_handle);
8483
}

bc_scanner_script.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ typedef enum {
1818
BarCodeStateFileError,
1919
} BarCodeWorkerState;
2020

21-
typedef enum { FileIsEmpty, FileOpenError } FileError;
21+
typedef enum {
22+
FileIsEmpty,
23+
FileOpenError
24+
} FileError;
2225

2326
typedef struct {
2427
BarCodeWorkerState state;

scenes/bc_scanner_scene_work.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "furi_hal.h"
55
#include "toolbox/path.h"
66

7-
#define TAG "BcScanner"
7+
#define TAG "BcScanner"
88
#define WORKER_TAG TAG "WorkScene"
99

1010
void bc_scanner_scene_work_ok_callback(InputType type, void* context) {

views/bc_scanner_view.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#include <gui/elements.h>
44

55
#define MAX_NAME_LEN 64
6-
#define TAG "BcScanner"
7-
#define WORKER_TAG TAG "View"
6+
#define TAG "BcScanner"
7+
#define WORKER_TAG TAG "View"
88

99
struct BarCodeView {
1010
View* view;

0 commit comments

Comments
 (0)