Esteban Fuentealba 1 год назад
Родитель
Сommit
56269850a3
7 измененных файлов с 674 добавлено и 413 удалено
  1. 191 0
      .clang-format
  2. 0 1
      cJSON.c
  3. 36 74
      link_camera.c
  4. 75 57
      link_camera.h
  5. 339 246
      qrcode.c
  6. 28 28
      qrcode.h
  7. 5 7
      uart.c

+ 191 - 0
.clang-format

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

+ 0 - 1
cJSON.c

@@ -57,7 +57,6 @@
 
 
 #include "cJSON.h"
 #include "cJSON.h"
 
 
-
 /* define our own boolean type */
 /* define our own boolean type */
 #ifdef true
 #ifdef true
 #undef true
 #undef true

+ 36 - 74
link_camera.c

@@ -5,21 +5,18 @@
 QRCode qrcode;
 QRCode qrcode;
 uint8_t qrcodeData[((((4 * 8 + 17) * (4 * 8 + 17)) + 7) / 8)];
 uint8_t qrcodeData[((((4 * 8 + 17) * (4 * 8 + 17)) + 7) / 8)];
 
 
-static uint32_t link_camera_exit(void *context)
-{
+static uint32_t link_camera_exit(void* context) {
     UNUSED(context);
     UNUSED(context);
     return VIEW_NONE;
     return VIEW_NONE;
 }
 }
 
 
-static void view_draw_callback(Canvas *canvas, void *_model)
-{
-    LinkCameraModel *model = _model;
+static void view_draw_callback(Canvas* canvas, void* _model) {
+    LinkCameraModel* model = _model;
     canvas_clear(canvas);
     canvas_clear(canvas);
     canvas_set_color(canvas, ColorBlack);
     canvas_set_color(canvas, ColorBlack);
     canvas_set_font(canvas, FontPrimary);
     canvas_set_font(canvas, FontPrimary);
 
 
-    if (model->connected)
-    {
+    if(model->connected) {
         canvas_set_font(canvas, FontPrimary);
         canvas_set_font(canvas, FontPrimary);
         canvas_draw_str(canvas, 2, 11, "SSID");
         canvas_draw_str(canvas, 2, 11, "SSID");
         canvas_set_font(canvas, FontSecondary);
         canvas_set_font(canvas, FontSecondary);
@@ -33,9 +30,7 @@ static void view_draw_callback(Canvas *canvas, void *_model)
         canvas_draw_str(canvas, 2, 50, "Host");
         canvas_draw_str(canvas, 2, 50, "Host");
         canvas_set_font(canvas, FontSecondary);
         canvas_set_font(canvas, FontSecondary);
         canvas_draw_str(canvas, 2, 60, model->ip);
         canvas_draw_str(canvas, 2, 60, model->ip);
-    }
-    else
-    {
+    } else {
         canvas_draw_icon(canvas, 60, 7, &I_malveke_67x49);
         canvas_draw_icon(canvas, 60, 7, &I_malveke_67x49);
         canvas_set_font(canvas, FontSecondary);
         canvas_set_font(canvas, FontSecondary);
 
 
@@ -46,16 +41,12 @@ static void view_draw_callback(Canvas *canvas, void *_model)
         canvas_draw_str(canvas, 4, 44, "into Flipper");
         canvas_draw_str(canvas, 4, 44, "into Flipper");
         elements_button_center(canvas, "Ok");
         elements_button_center(canvas, "Ok");
     }
     }
-
 }
 }
-static bool view_input_callback(InputEvent *event, void *context)
-{
-    LinkCameraApp *instance = context;
+static bool view_input_callback(InputEvent* event, void* context) {
+    LinkCameraApp* instance = context;
     UNUSED(instance);
     UNUSED(instance);
-    if (event->type == InputTypePress)
-    {
-        if (event->key == InputKeyBack)
-        {
+    if(event->type == InputTypePress) {
+        if(event->key == InputKeyBack) {
             uart_set_handle_rx_data_cb(instance->uart, NULL);
             uart_set_handle_rx_data_cb(instance->uart, NULL);
             uart_free(instance->uart);
             uart_free(instance->uart);
 
 
@@ -63,31 +54,21 @@ static bool view_input_callback(InputEvent *event, void *context)
             furi_delay_ms(100);
             furi_delay_ms(100);
             furi_hal_power_enable_external_3_3v();
             furi_hal_power_enable_external_3_3v();
             furi_delay_ms(200);
             furi_delay_ms(200);
-        }
-        else if (event->key == InputKeyOk)
-        {
-
+        } else if(event->key == InputKeyOk) {
             furi_hal_power_disable_external_3_3v();
             furi_hal_power_disable_external_3_3v();
             furi_delay_ms(100);
             furi_delay_ms(100);
             furi_hal_power_enable_external_3_3v();
             furi_hal_power_enable_external_3_3v();
             furi_delay_ms(200);
             furi_delay_ms(200);
 
 
             with_view_model(
             with_view_model(
-                instance->view,
-                LinkCameraModel * model,
-                {
-                    model->initialized = true;
-                },
-                true);
-            uart_tx(instance->uart, (uint8_t *)("c"), 1);
-            uart_tx(instance->uart, (uint8_t *)("\n"), 1);
-
+                instance->view, LinkCameraModel * model, { model->initialized = true; }, true);
+            uart_tx(instance->uart, (uint8_t*)("c"), 1);
+            uart_tx(instance->uart, (uint8_t*)("\n"), 1);
         }
         }
     }
     }
     return false;
     return false;
 }
 }
-static void link_camera_free(LinkCameraApp *app)
-{
+static void link_camera_free(LinkCameraApp* app) {
     furi_assert(app);
     furi_assert(app);
     // Free views
     // Free views
     view_dispatcher_remove_view(app->view_dispatcher, 0);
     view_dispatcher_remove_view(app->view_dispatcher, 0);
@@ -100,59 +81,42 @@ static void link_camera_free(LinkCameraApp *app)
     // Free rest
     // Free rest
     free(app);
     free(app);
 }
 }
-void handle_rx_data_cb(uint8_t *buf, size_t len, void *context)
-{
+void handle_rx_data_cb(uint8_t* buf, size_t len, void* context) {
     furi_assert(context);
     furi_assert(context);
     UNUSED(len);
     UNUSED(len);
-    LinkCameraApp *instance = (LinkCameraApp *)context;
+    LinkCameraApp* instance = (LinkCameraApp*)context;
 
 
     with_view_model(
     with_view_model(
         instance->view,
         instance->view,
         LinkCameraModel * model,
         LinkCameraModel * model,
         {
         {
-            cJSON *json = cJSON_Parse((char *)buf);
-            if (json == NULL)
-            {
-            }
-            else
-            {
-                cJSON *type = cJSON_GetObjectItemCaseSensitive(json, "type");
-                if (cJSON_IsString(type) && (type->valuestring != NULL))
-                {
+            cJSON* json = cJSON_Parse((char*)buf);
+            if(json == NULL) {
+            } else {
+                cJSON* type = cJSON_GetObjectItemCaseSensitive(json, "type");
+                if(cJSON_IsString(type) && (type->valuestring != NULL)) {
                     model->event_type = strdup(type->valuestring);
                     model->event_type = strdup(type->valuestring);
-                }
-                else
-                {
+                } else {
                     model->event_type = "None";
                     model->event_type = "None";
                 }
                 }
 
 
-                if (strcmp(model->event_type, "connected") == 0)
-                {
-                    cJSON *ip = cJSON_GetObjectItemCaseSensitive(json, "ip");
-                    if (cJSON_IsString(ip) && (ip->valuestring != NULL))
-                    {
+                if(strcmp(model->event_type, "connected") == 0) {
+                    cJSON* ip = cJSON_GetObjectItemCaseSensitive(json, "ip");
+                    if(cJSON_IsString(ip) && (ip->valuestring != NULL)) {
                         model->ip = strdup(ip->valuestring);
                         model->ip = strdup(ip->valuestring);
-                    }
-                    else
-                    {
+                    } else {
                         model->ip = "0.0.0.0";
                         model->ip = "0.0.0.0";
                     }
                     }
-                    cJSON *ssid = cJSON_GetObjectItemCaseSensitive(json, "ssid");
-                    if (cJSON_IsString(ssid) && (ssid->valuestring != NULL))
-                    {
+                    cJSON* ssid = cJSON_GetObjectItemCaseSensitive(json, "ssid");
+                    if(cJSON_IsString(ssid) && (ssid->valuestring != NULL)) {
                         model->ssid = strdup(ssid->valuestring);
                         model->ssid = strdup(ssid->valuestring);
-                    }
-                    else
-                    {
+                    } else {
                         model->ssid = " - ";
                         model->ssid = " - ";
                     }
                     }
-                    cJSON *password = cJSON_GetObjectItemCaseSensitive(json, "password");
-                    if (cJSON_IsString(password) && (password->valuestring != NULL))
-                    {
+                    cJSON* password = cJSON_GetObjectItemCaseSensitive(json, "password");
+                    if(cJSON_IsString(password) && (password->valuestring != NULL)) {
                         model->password = strdup(password->valuestring);
                         model->password = strdup(password->valuestring);
-                    }
-                    else
-                    {
+                    } else {
                         model->password = "******";
                         model->password = "******";
                     }
                     }
                     model->connected = true;
                     model->connected = true;
@@ -161,9 +125,8 @@ void handle_rx_data_cb(uint8_t *buf, size_t len, void *context)
         },
         },
         true);
         true);
 }
 }
-static LinkCameraApp *link_camera_alloc()
-{
-    LinkCameraApp *app = malloc(sizeof(LinkCameraApp));
+static LinkCameraApp* link_camera_alloc() {
+    LinkCameraApp* app = malloc(sizeof(LinkCameraApp));
     // Gui
     // Gui
     app->gui = furi_record_open(RECORD_GUI);
     app->gui = furi_record_open(RECORD_GUI);
     app->storage = furi_record_open(RECORD_STORAGE);
     app->storage = furi_record_open(RECORD_STORAGE);
@@ -190,11 +153,10 @@ static LinkCameraApp *link_camera_alloc()
     return app;
     return app;
 }
 }
 
 
-int32_t link_camera_app(void *p)
-{
+int32_t link_camera_app(void* p) {
     UNUSED(p);
     UNUSED(p);
 
 
-    LinkCameraApp *app = link_camera_alloc();
+    LinkCameraApp* app = link_camera_alloc();
     view_dispatcher_run(app->view_dispatcher);
     view_dispatcher_run(app->view_dispatcher);
     link_camera_free(app);
     link_camera_free(app);
 
 

+ 75 - 57
link_camera.h

@@ -38,62 +38,80 @@ typedef enum {
 
 
 #define WORKER_EVENTS_MASK (WorkerEventStop | WorkerEventRx)
 #define WORKER_EVENTS_MASK (WorkerEventStop | WorkerEventRx)
 
 
-
-const uint8_t _I_DolphinCommon_56x48_0[] = {0x01,0x00,0xdf,0x00,0x00,0x1f,0xfe,0x0e,0x05,0x3f,0x04,0x06,0x78,0x06,0x30,0x20,0xf8,0x00,0xc6,0x12,0x1c,0x04,0x0c,0x0a,0x38,0x08,0x08,0x0c,0x60,0xc0,0x21,0xe0,0x04,0x0a,0x18,0x02,0x1b,0x00,0x18,0xa3,0x00,0x21,0x90,0x01,0x8a,0x20,0x02,0x19,0x80,0x18,0x80,0x64,0x09,0x20,0x89,0x81,0x8c,0x3e,0x41,0xe2,0x80,0x50,0x00,0x43,0x08,0x01,0x0c,0xfc,0x68,0x40,0x61,0xc0,0x50,0x30,0x00,0x63,0xa0,0x7f,0x80,0xc4,0x41,0x19,0x07,0xff,0x02,0x06,0x18,0x24,0x03,0x41,0xf3,0x2b,0x10,0x19,0x38,0x10,0x30,0x31,0x7f,0xe0,0x34,0x08,0x30,0x19,0x60,0x80,0x65,0x86,0x0a,0x4c,0x0c,0x30,0x81,0xb9,0x41,0xa0,0x54,0x08,0xc7,0xe2,0x06,0x8a,0x18,0x25,0x02,0x21,0x0f,0x19,0x88,0xd8,0x6e,0x1b,0x01,0xd1,0x1b,0x86,0x39,0x66,0x3a,0xa4,0x1a,0x50,0x06,0x48,0x18,0x18,0xd0,0x03,0x01,0x41,0x98,0xcc,0x60,0x39,0x01,0x49,0x2d,0x06,0x03,0x50,0xf8,0x40,0x3e,0x02,0xc1,0x82,0x86,0xc7,0xfe,0x0f,0x28,0x2c,0x91,0xd2,0x90,0x9a,0x18,0x19,0x3e,0x6d,0x73,0x12,0x16,0x00,0x32,0x49,0x72,0xc0,0x7e,0x5d,0x44,0xba,0x2c,0x08,0xa4,0xc8,0x82,0x06,0x17,0xe0,0x81,0x90,0x2a,0x40,0x61,0xe1,0xa2,0x44,0x0c,0x76,0x2b,0xe8,0x89,0x26,0x43,0x83,0x31,0x8c,0x78,0x0c,0xb0,0x48,0x10,0x1a,0xe0,0x00,0x63,};
+const uint8_t _I_DolphinCommon_56x48_0[] = {
+    0x01, 0x00, 0xdf, 0x00, 0x00, 0x1f, 0xfe, 0x0e, 0x05, 0x3f, 0x04, 0x06, 0x78, 0x06, 0x30, 0x20,
+    0xf8, 0x00, 0xc6, 0x12, 0x1c, 0x04, 0x0c, 0x0a, 0x38, 0x08, 0x08, 0x0c, 0x60, 0xc0, 0x21, 0xe0,
+    0x04, 0x0a, 0x18, 0x02, 0x1b, 0x00, 0x18, 0xa3, 0x00, 0x21, 0x90, 0x01, 0x8a, 0x20, 0x02, 0x19,
+    0x80, 0x18, 0x80, 0x64, 0x09, 0x20, 0x89, 0x81, 0x8c, 0x3e, 0x41, 0xe2, 0x80, 0x50, 0x00, 0x43,
+    0x08, 0x01, 0x0c, 0xfc, 0x68, 0x40, 0x61, 0xc0, 0x50, 0x30, 0x00, 0x63, 0xa0, 0x7f, 0x80, 0xc4,
+    0x41, 0x19, 0x07, 0xff, 0x02, 0x06, 0x18, 0x24, 0x03, 0x41, 0xf3, 0x2b, 0x10, 0x19, 0x38, 0x10,
+    0x30, 0x31, 0x7f, 0xe0, 0x34, 0x08, 0x30, 0x19, 0x60, 0x80, 0x65, 0x86, 0x0a, 0x4c, 0x0c, 0x30,
+    0x81, 0xb9, 0x41, 0xa0, 0x54, 0x08, 0xc7, 0xe2, 0x06, 0x8a, 0x18, 0x25, 0x02, 0x21, 0x0f, 0x19,
+    0x88, 0xd8, 0x6e, 0x1b, 0x01, 0xd1, 0x1b, 0x86, 0x39, 0x66, 0x3a, 0xa4, 0x1a, 0x50, 0x06, 0x48,
+    0x18, 0x18, 0xd0, 0x03, 0x01, 0x41, 0x98, 0xcc, 0x60, 0x39, 0x01, 0x49, 0x2d, 0x06, 0x03, 0x50,
+    0xf8, 0x40, 0x3e, 0x02, 0xc1, 0x82, 0x86, 0xc7, 0xfe, 0x0f, 0x28, 0x2c, 0x91, 0xd2, 0x90, 0x9a,
+    0x18, 0x19, 0x3e, 0x6d, 0x73, 0x12, 0x16, 0x00, 0x32, 0x49, 0x72, 0xc0, 0x7e, 0x5d, 0x44, 0xba,
+    0x2c, 0x08, 0xa4, 0xc8, 0x82, 0x06, 0x17, 0xe0, 0x81, 0x90, 0x2a, 0x40, 0x61, 0xe1, 0xa2, 0x44,
+    0x0c, 0x76, 0x2b, 0xe8, 0x89, 0x26, 0x43, 0x83, 0x31, 0x8c, 0x78, 0x0c, 0xb0, 0x48, 0x10, 0x1a,
+    0xe0, 0x00, 0x63,
+};
 const uint8_t* const _I_DolphinCommon_56x48[] = {_I_DolphinCommon_56x48_0};
 const uint8_t* const _I_DolphinCommon_56x48[] = {_I_DolphinCommon_56x48_0};
-const Icon I_DolphinCommon_56x48 = {.width=56,.height=48,.frame_count=1,.frame_rate=0,.frames=_I_DolphinCommon_56x48};
-
-
+const Icon I_DolphinCommon_56x48 = {
+    .width = 56,
+    .height = 48,
+    .frame_count = 1,
+    .frame_rate = 0,
+    .frames = _I_DolphinCommon_56x48};
 
 
-const uint8_t u8g2_font_5x7_tf[1612] = 
-  "\277\0\2\2\3\3\3\4\4\5\7\0\377\6\377\6\0\1\12\2\26\6/ \5\0\275\1!\6\261\261"
-  "\31)\42\7[\267IV\0#\12-\261\253\206\252\206\252\0$\11-\261[\365Ni\1%\10\64\261"
-  "\311\261w\0&\11,\261\213)V\61\5'\5\231\267\31(\7r\261S\315\0)\10r\261\211\251R"
-  "\0*\7k\261I\325j+\12-\261\315(\16\231Q\4,\7[\257S%\0-\6\14\265\31\1."
-  "\6R\261\31\1/\7$\263\217m\0\60\10s\261\253\134\25\0\61\7s\261K\262\65\62\11\64\261S"
-  "\61\307r\4\63\12\64\261\31\71i$\223\2\64\12\64\261\215\252\32\61'\0\65\12\64\261\31z#\231"
-  "\24\0\66\12\64\261SyE\231\24\0\67\12\64\261\31\71\346\230#\0\70\12\64\261S\61\251(\223\2"
-  "\71\12\64\261SQ\246\235\24\0:\7j\261\31q\4;\10\63\257\263\221*\1<\7k\261Mu\1"
-  "=\10\34\263\31\31\215\0>\7k\261\311U\11\77\11s\261k\246\14\23\0@\11\64\261SQ\335H"
-  "\1A\11\64\261SQ\216)\3B\12\64\261Yq\244(G\2C\11\64\261SQ\227I\1D\11\64"
-  "\261Y\321\71\22\0E\11\64\261\31z\345<\2F\10\64\261\31z\345\32G\11\64\261SQ\247\231\6"
-  "H\10\64\261\211rL\63I\7s\261Y\261\65J\10\64\261o\313\244\0K\12\64\261\211*I\231\312"
-  "\0L\7\64\261\311\335#M\11\64\261\211\343\210f\0N\10\64\261\211k\251\63O\11\64\261S\321\231"
-  "\24\0P\12\64\261YQ\216\224\63\0Q\12<\257S\321\134I\243\0R\11\64\261YQ\216\324\14S"
-  "\12\64\261S\61eT&\5T\7s\261Y\261\13U\10\64\261\211\236I\1V\11\64\261\211\316$\25"
-  "\0W\11\64\261\211\346\70b\0X\12\64\261\211\62I\25e\0Y\10s\261IVY\1Z\11\64\261"
-  "\31\71\266G\0[\7s\261\31\261\71\134\11$\263\311(\243\214\2]\7s\261\231\315\21^\5S\271"
-  "k_\6\14\261\31\1`\6R\271\211\1a\10$\261\33Q\251\2b\12\64\261\311yE\71\22\0c"
-  "\6#\261\233Yd\10\64\261\257F\224ie\10$\261Sid\5f\11\64\261\255\312\231#\0g\11"
-  ",\257\33\61\251\214\6h\10\64\261\311yE\63i\10s\261\313HV\3j\11{\257\315\260T\25\0"
-  "k\11\64\261\311U\222\251\14l\7s\261\221]\3m\10$\261IiH\31n\7$\261Y\321\14o"
-  "\10$\261SQ&\5p\11,\257YQ\216\224\1q\10,\257\33Q\246\35r\10$\261YQg\0"
-  "s\10$\261\33\32\15\5t\11\64\261\313q\346\214\4u\7$\261\211f\32v\7c\261IV\5w"
-  "\7$\261\211r\34x\10$\261\211I\252\30y\11,\257\211\62\225%\0z\10$\261\31\261\34\1{"
-  "\10s\261MI\326\1|\5\261\261\71}\11s\261\311Q\305\24\1~\7\24\271K*\1\240\5\0\275"
-  "\1\241\6\261\261I#\242\11\64\257\215#\65g\2\243\10,\261UqV\2\244\12-\261\311i\246\270"
-  "r\0\245\11s\261I\252Z\61\1\246\6\251\261Q\2\247\10{\257\233\252\222\13\250\6K\273I\1\251"
-  "\13=\257[Y\245\251\222N\13\252\6\33\267[I\253\7\35\263\213\262\1\254\6\24\263\31\71\255\5K"
-  "\265\31\256\13=\257[y\244\71uZ\0\257\6\14\273\31\1\260\6[\267\353\2\261\13\65\261\315(\16"
-  "\231Q\34\2\262\6b\265Q\6\263\6b\265\31i\264\6R\271S\0\265\10,\257\211\346H\31\266\10"
-  "\64\261\33j\365\3\267\6R\265\31\1\270\6R\257S\0\271\7c\265K\62\15\272\6\33\267\353\2\273"
-  "\10\35\263\211\245L\0\274\11<\257\311\315\250v\0\275\11<\257\311-\35\263\0\276\12<\257\221:\252"
-  "\250v\0\277\11s\261\313\60\305T\1\300\11\64\261SQ\216)\3\301\11\64\261SQ\216)\3\302\11"
-  "\64\261SQ\216)\3\303\11\64\261SQ\216)\3\304\12\64\261\211I\305\61e\0\305\11\64\261\223*"
-  "\216)\3\306\11\64\261\33\251\32\252%\307\12<\257SQ\227IF\0\310\11\64\261\31z\345<\2\311"
-  "\11\64\261\31z\345<\2\312\11\64\261\31z\345<\2\313\11\64\261\31z\345<\2\314\7s\261Y\261"
-  "\65\315\7s\261Y\261\65\316\7s\261Y\261\65\317\7s\261Y\261\65\320\11\64\261\231iu\215\4\321"
-  "\10\64\261Is\251\63\322\11\64\261S\321\231\24\0\323\11\64\261S\321\231\24\0\324\11\64\261S\321\231"
-  "\24\0\325\11\64\261S\321\231\24\0\326\12\64\261\211IE\63)\0\327\10$\261\211I\252\30\330\11\64"
-  "\261\33\351HG\2\331\10\64\261\211\236I\1\332\10\64\261\211\236I\1\333\10\64\261\211\236I\1\334\12"
-  "\64\261\211\31E\63)\0\335\10s\261IVY\1\336\12\64\261\311+\216\224\63\0\337\11\64\261SQ"
-  "\225V\2\340\12\64\261\313(\216\250T\1\341\11\64\261\255GT\252\0\342\11\64\261\255\322\210J\25\343"
-  "\12\64\261K*\216\250T\1\344\11\64\261\253\341\210J\25\345\11\64\261\223rD\245\12\346\10$\261\33"
-  "i\305\1\347\10k\257\233Y%\0\350\12\64\261\313(\252\64\262\2\351\11\64\261\255U\32Y\1\352\12"
-  "\64\261\213)\252\64\262\2\353\12\64\261I\31\253\64\262\2\354\10s\261\311IV\3\355\7s\261+e"
-  "\65\356\7s\261\253f\65\357\10s\261IYV\3\360\12\64\261\313\310\212\62)\0\361\11\64\261K*"
-  "\255h\6\362\12\64\261\313(\252(\223\2\363\11\64\261\255U\224I\1\364\12\64\261\323XE\231\24\0"
-  "\365\12\64\261K*\252(\223\2\366\12\64\261\253\241\212\62)\0\367\11,\261\323pd\250\0\370\11$"
-  "\261\33i\244\221\0\371\11\64\261\313\250\64\323\0\372\7\64\261m\232i\373\10\64\261\323\60\232i\374\11"
-  "\64\261\253Q\64\323\0\375\11<\257m\312T\226\0\376\12\64\257\311+\312\221\62\0\377\12<\257\253Q"
-  "\224\251,\1\0\0\0\4\377\377\0";
+const uint8_t u8g2_font_5x7_tf[1612] =
+    "\277\0\2\2\3\3\3\4\4\5\7\0\377\6\377\6\0\1\12\2\26\6/ \5\0\275\1!\6\261\261"
+    "\31)\42\7[\267IV\0#\12-\261\253\206\252\206\252\0$\11-\261[\365Ni\1%\10\64\261"
+    "\311\261w\0&\11,\261\213)V\61\5'\5\231\267\31(\7r\261S\315\0)\10r\261\211\251R"
+    "\0*\7k\261I\325j+\12-\261\315(\16\231Q\4,\7[\257S%\0-\6\14\265\31\1."
+    "\6R\261\31\1/\7$\263\217m\0\60\10s\261\253\134\25\0\61\7s\261K\262\65\62\11\64\261S"
+    "\61\307r\4\63\12\64\261\31\71i$\223\2\64\12\64\261\215\252\32\61'\0\65\12\64\261\31z#\231"
+    "\24\0\66\12\64\261SyE\231\24\0\67\12\64\261\31\71\346\230#\0\70\12\64\261S\61\251(\223\2"
+    "\71\12\64\261SQ\246\235\24\0:\7j\261\31q\4;\10\63\257\263\221*\1<\7k\261Mu\1"
+    "=\10\34\263\31\31\215\0>\7k\261\311U\11\77\11s\261k\246\14\23\0@\11\64\261SQ\335H"
+    "\1A\11\64\261SQ\216)\3B\12\64\261Yq\244(G\2C\11\64\261SQ\227I\1D\11\64"
+    "\261Y\321\71\22\0E\11\64\261\31z\345<\2F\10\64\261\31z\345\32G\11\64\261SQ\247\231\6"
+    "H\10\64\261\211rL\63I\7s\261Y\261\65J\10\64\261o\313\244\0K\12\64\261\211*I\231\312"
+    "\0L\7\64\261\311\335#M\11\64\261\211\343\210f\0N\10\64\261\211k\251\63O\11\64\261S\321\231"
+    "\24\0P\12\64\261YQ\216\224\63\0Q\12<\257S\321\134I\243\0R\11\64\261YQ\216\324\14S"
+    "\12\64\261S\61eT&\5T\7s\261Y\261\13U\10\64\261\211\236I\1V\11\64\261\211\316$\25"
+    "\0W\11\64\261\211\346\70b\0X\12\64\261\211\62I\25e\0Y\10s\261IVY\1Z\11\64\261"
+    "\31\71\266G\0[\7s\261\31\261\71\134\11$\263\311(\243\214\2]\7s\261\231\315\21^\5S\271"
+    "k_\6\14\261\31\1`\6R\271\211\1a\10$\261\33Q\251\2b\12\64\261\311yE\71\22\0c"
+    "\6#\261\233Yd\10\64\261\257F\224ie\10$\261Sid\5f\11\64\261\255\312\231#\0g\11"
+    ",\257\33\61\251\214\6h\10\64\261\311yE\63i\10s\261\313HV\3j\11{\257\315\260T\25\0"
+    "k\11\64\261\311U\222\251\14l\7s\261\221]\3m\10$\261IiH\31n\7$\261Y\321\14o"
+    "\10$\261SQ&\5p\11,\257YQ\216\224\1q\10,\257\33Q\246\35r\10$\261YQg\0"
+    "s\10$\261\33\32\15\5t\11\64\261\313q\346\214\4u\7$\261\211f\32v\7c\261IV\5w"
+    "\7$\261\211r\34x\10$\261\211I\252\30y\11,\257\211\62\225%\0z\10$\261\31\261\34\1{"
+    "\10s\261MI\326\1|\5\261\261\71}\11s\261\311Q\305\24\1~\7\24\271K*\1\240\5\0\275"
+    "\1\241\6\261\261I#\242\11\64\257\215#\65g\2\243\10,\261UqV\2\244\12-\261\311i\246\270"
+    "r\0\245\11s\261I\252Z\61\1\246\6\251\261Q\2\247\10{\257\233\252\222\13\250\6K\273I\1\251"
+    "\13=\257[Y\245\251\222N\13\252\6\33\267[I\253\7\35\263\213\262\1\254\6\24\263\31\71\255\5K"
+    "\265\31\256\13=\257[y\244\71uZ\0\257\6\14\273\31\1\260\6[\267\353\2\261\13\65\261\315(\16"
+    "\231Q\34\2\262\6b\265Q\6\263\6b\265\31i\264\6R\271S\0\265\10,\257\211\346H\31\266\10"
+    "\64\261\33j\365\3\267\6R\265\31\1\270\6R\257S\0\271\7c\265K\62\15\272\6\33\267\353\2\273"
+    "\10\35\263\211\245L\0\274\11<\257\311\315\250v\0\275\11<\257\311-\35\263\0\276\12<\257\221:\252"
+    "\250v\0\277\11s\261\313\60\305T\1\300\11\64\261SQ\216)\3\301\11\64\261SQ\216)\3\302\11"
+    "\64\261SQ\216)\3\303\11\64\261SQ\216)\3\304\12\64\261\211I\305\61e\0\305\11\64\261\223*"
+    "\216)\3\306\11\64\261\33\251\32\252%\307\12<\257SQ\227IF\0\310\11\64\261\31z\345<\2\311"
+    "\11\64\261\31z\345<\2\312\11\64\261\31z\345<\2\313\11\64\261\31z\345<\2\314\7s\261Y\261"
+    "\65\315\7s\261Y\261\65\316\7s\261Y\261\65\317\7s\261Y\261\65\320\11\64\261\231iu\215\4\321"
+    "\10\64\261Is\251\63\322\11\64\261S\321\231\24\0\323\11\64\261S\321\231\24\0\324\11\64\261S\321\231"
+    "\24\0\325\11\64\261S\321\231\24\0\326\12\64\261\211IE\63)\0\327\10$\261\211I\252\30\330\11\64"
+    "\261\33\351HG\2\331\10\64\261\211\236I\1\332\10\64\261\211\236I\1\333\10\64\261\211\236I\1\334\12"
+    "\64\261\211\31E\63)\0\335\10s\261IVY\1\336\12\64\261\311+\216\224\63\0\337\11\64\261SQ"
+    "\225V\2\340\12\64\261\313(\216\250T\1\341\11\64\261\255GT\252\0\342\11\64\261\255\322\210J\25\343"
+    "\12\64\261K*\216\250T\1\344\11\64\261\253\341\210J\25\345\11\64\261\223rD\245\12\346\10$\261\33"
+    "i\305\1\347\10k\257\233Y%\0\350\12\64\261\313(\252\64\262\2\351\11\64\261\255U\32Y\1\352\12"
+    "\64\261\213)\252\64\262\2\353\12\64\261I\31\253\64\262\2\354\10s\261\311IV\3\355\7s\261+e"
+    "\65\356\7s\261\253f\65\357\10s\261IYV\3\360\12\64\261\313\310\212\62)\0\361\11\64\261K*"
+    "\255h\6\362\12\64\261\313(\252(\223\2\363\11\64\261\255U\224I\1\364\12\64\261\323XE\231\24\0"
+    "\365\12\64\261K*\252(\223\2\366\12\64\261\253\241\212\62)\0\367\11,\261\323pd\250\0\370\11$"
+    "\261\33i\244\221\0\371\11\64\261\313\250\64\323\0\372\7\64\261m\232i\373\10\64\261\323\60\232i\374\11"
+    "\64\261\253Q\64\323\0\375\11<\257m\312T\226\0\376\12\64\257\311+\312\221\62\0\377\12<\257\253Q"
+    "\224\251,\1\0\0\0\4\377\377\0";

Разница между файлами не показана из-за своего большого размера
+ 339 - 246
qrcode.c


+ 28 - 28
qrcode.h

@@ -33,7 +33,6 @@
  *  See: https://github.com/nayuki/QR-Code-generator/tree/master/cpp
  *  See: https://github.com/nayuki/QR-Code-generator/tree/master/cpp
  */
  */
 
 
-
 #ifndef __QRCODE_H_
 #ifndef __QRCODE_H_
 #define __QRCODE_H_
 #define __QRCODE_H_
 
 
@@ -46,55 +45,56 @@
 #include <stdint.h>
 #include <stdint.h>
 #include <stdbool.h>
 #include <stdbool.h>
 
 
-
 // QR Code Format Encoding
 // QR Code Format Encoding
-#define MODE_NUMERIC        0
-#define MODE_ALPHANUMERIC   1
-#define MODE_BYTE           2
-
+#define MODE_NUMERIC 0
+#define MODE_ALPHANUMERIC 1
+#define MODE_BYTE 2
 
 
 // Error Correction Code Levels
 // Error Correction Code Levels
-#define ECC_LOW            0
-#define ECC_MEDIUM         1
-#define ECC_QUARTILE       2
-#define ECC_HIGH           3
-
+#define ECC_LOW 0
+#define ECC_MEDIUM 1
+#define ECC_QUARTILE 2
+#define ECC_HIGH 3
 
 
 // If set to non-zero, this library can ONLY produce QR codes at that version
 // If set to non-zero, this library can ONLY produce QR codes at that version
 // This saves a lot of dynamic memory, as the codeword tables are skipped
 // This saves a lot of dynamic memory, as the codeword tables are skipped
 #ifndef LOCK_VERSION
 #ifndef LOCK_VERSION
-#define LOCK_VERSION       0
+#define LOCK_VERSION 0
 #endif
 #endif
 
 
-
 typedef struct QRCode {
 typedef struct QRCode {
     uint8_t version;
     uint8_t version;
     uint8_t size;
     uint8_t size;
     uint8_t ecc;
     uint8_t ecc;
     uint8_t mode;
     uint8_t mode;
     uint8_t mask;
     uint8_t mask;
-    uint8_t *modules;
+    uint8_t* modules;
 } QRCode;
 } QRCode;
 
 
-
 #ifdef __cplusplus
 #ifdef __cplusplus
-extern "C"{
-#endif  /* __cplusplus */
-
-
+extern "C" {
+#endif /* __cplusplus */
 
 
 uint16_t qrcode_getBufferSize(uint8_t version);
 uint16_t qrcode_getBufferSize(uint8_t version);
 
 
-int8_t qrcode_initText(QRCode *qrcode, uint8_t *modules, uint8_t version, uint8_t ecc, const char *data);
-int8_t qrcode_initBytes(QRCode *qrcode, uint8_t *modules, uint8_t version, uint8_t ecc, uint8_t *data, uint16_t length);
-
-bool qrcode_getModule(QRCode *qrcode, uint8_t x, uint8_t y);
-
-
+int8_t qrcode_initText(
+    QRCode* qrcode,
+    uint8_t* modules,
+    uint8_t version,
+    uint8_t ecc,
+    const char* data);
+int8_t qrcode_initBytes(
+    QRCode* qrcode,
+    uint8_t* modules,
+    uint8_t version,
+    uint8_t ecc,
+    uint8_t* data,
+    uint16_t length);
+
+bool qrcode_getModule(QRCode* qrcode, uint8_t x, uint8_t y);
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
-#endif  /* __cplusplus */
-
+#endif /* __cplusplus */
 
 
-#endif  /* __QRCODE_H_ */
+#endif /* __QRCODE_H_ */

+ 5 - 7
uart.c

@@ -22,8 +22,6 @@ typedef enum {
 
 
 #define WORKER_ALL_RX_EVENTS (WorkerEvtStop | WorkerEvtRxDone)
 #define WORKER_ALL_RX_EVENTS (WorkerEvtStop | WorkerEvtRxDone)
 
 
-
-
 void uart_set_handle_rx_data_cb(
 void uart_set_handle_rx_data_cb(
     Uart* uart,
     Uart* uart,
     void (*handle_rx_data_cb)(uint8_t* buf, size_t len, void* context)) {
     void (*handle_rx_data_cb)(uint8_t* buf, size_t len, void* context)) {
@@ -44,7 +42,8 @@ static void wifi_marauder_uart_on_irq_cb(
     }
     }
 }
 }
 
 
-static void uart_on_irq_cb(FuriHalSerialHandle* handle, FuriHalSerialRxEvent event, void* context) {
+static void
+    uart_on_irq_cb(FuriHalSerialHandle* handle, FuriHalSerialRxEvent event, void* context) {
     Uart* uart = (Uart*)context;
     Uart* uart = (Uart*)context;
     UNUSED(handle);
     UNUSED(handle);
 
 
@@ -109,7 +108,7 @@ static int32_t uart_worker(void* context) {
     Uart* uart = (Uart*)context;
     Uart* uart = (Uart*)context;
 
 
     while(1) {
     while(1) {
-       uint32_t events =
+        uint32_t events =
             furi_thread_flags_wait(WORKER_ALL_RX_EVENTS, FuriFlagWaitAny, FuriWaitForever);
             furi_thread_flags_wait(WORKER_ALL_RX_EVENTS, FuriFlagWaitAny, FuriWaitForever);
         furi_check((events & FuriFlagError) == 0);
         furi_check((events & FuriFlagError) == 0);
 
 
@@ -163,14 +162,13 @@ Uart* _uart_init(void* app, FuriHalSerialId channel, const char* thread_name) {
         furi_delay_ms(5000);
         furi_delay_ms(5000);
     }
     }
     furi_check(uart->serial_handle);
     furi_check(uart->serial_handle);
-    furi_hal_serial_init(uart->serial_handle,  BAUDRATE);
+    furi_hal_serial_init(uart->serial_handle, BAUDRATE);
     furi_hal_serial_async_rx_start(
     furi_hal_serial_async_rx_start(
         uart->serial_handle,
         uart->serial_handle,
         channel == FuriHalSerialIdUsart ? uart_on_irq_cb : wifi_marauder_uart_on_irq_cb,
         channel == FuriHalSerialIdUsart ? uart_on_irq_cb : wifi_marauder_uart_on_irq_cb,
         uart,
         uart,
         false);
         false);
 
 
-
     return uart;
     return uart;
 }
 }
 
 
@@ -185,7 +183,7 @@ Uart* lp_uart_init(void* app) {
 void uart_free(Uart* uart) {
 void uart_free(Uart* uart) {
     furi_assert(uart);
     furi_assert(uart);
 
 
-   furi_thread_flags_set(furi_thread_get_id(uart->rx_thread), WorkerEvtStop);
+    furi_thread_flags_set(furi_thread_get_id(uart->rx_thread), WorkerEvtStop);
     furi_thread_join(uart->rx_thread);
     furi_thread_join(uart->rx_thread);
     furi_thread_free(uart->rx_thread);
     furi_thread_free(uart->rx_thread);
 
 

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