Willy-JL 2 лет назад
Родитель
Сommit
aaf90130ed

+ 2 - 1
esp_flasher/scenes/esp_flasher_scene_quick.c

@@ -114,7 +114,8 @@ bool esp_flasher_scene_quick_on_event(void* context, SceneManagerEvent event) {
             boot = APP_DATA_PATH("assets/marauder/DevproWroom/esp32_marauder.ino.bootloader.bin");
             part = APP_DATA_PATH("assets/marauder/esp32_marauder.ino.partitions.bin");
             app0 = APP_DATA_PATH("assets/marauder/boot_app0.bin");
-            firm = APP_DATA_PATH("assets/marauder/DevproWroom/esp32_marauder.marauder_dev_board_pro.bin");
+            firm = APP_DATA_PATH(
+                "assets/marauder/DevproWroom/esp32_marauder.marauder_dev_board_pro.bin");
             break;
         default:
             flash = false;

+ 14 - 6
wifi_marauder_companion/wifi_marauder_uart.c

@@ -53,14 +53,19 @@ void wifi_marauder_uart_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context)
             // We are trying to match a pcap delimiter
             const char* pcap_begin = "%PCAP_BEGIN%";
             const char* pcap_close = "%PCAP_CLOSE%";
-            if(data == pcap_begin[uart->pcap_test_idx] || data == pcap_close[uart->pcap_test_idx]) {
+            if(data == pcap_begin[uart->pcap_test_idx] ||
+               data == pcap_close[uart->pcap_test_idx]) {
                 // Received char matches next char in a pcap delimiter, append to buffer
                 uart->pcap_test_buf[uart->pcap_test_idx++] = data;
                 if(uart->pcap_test_idx == sizeof(uart->pcap_test_buf)) {
                     // Buffer reached max length, parse what delimiter this is and discard buffer
-                    if(!memcmp(uart->pcap_test_buf, (void*)pcap_begin, sizeof(uart->pcap_test_buf))) {
+                    if(!memcmp(
+                           uart->pcap_test_buf, (void*)pcap_begin, sizeof(uart->pcap_test_buf))) {
                         uart->pcap = true;
-                    } else if(!memcmp(uart->pcap_test_buf, (void*)pcap_close, sizeof(uart->pcap_test_buf))) {
+                    } else if(!memcmp(
+                                  uart->pcap_test_buf,
+                                  (void*)pcap_close,
+                                  sizeof(uart->pcap_test_buf))) {
                         uart->pcap = false;
                     }
                     uart->pcap_test_idx = 0;
@@ -70,10 +75,12 @@ void wifi_marauder_uart_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context)
             } else {
                 // Received char doesn't match any expected next char, send old buffer
                 if(uart->pcap) {
-                    furi_stream_buffer_send(uart->pcap_stream, uart->pcap_test_buf, uart->pcap_test_idx, 0);
+                    furi_stream_buffer_send(
+                        uart->pcap_stream, uart->pcap_test_buf, uart->pcap_test_idx, 0);
                     furi_thread_flags_set(furi_thread_get_id(uart->rx_thread), WorkerEvtPcapDone);
                 } else {
-                    furi_stream_buffer_send(uart->rx_stream, uart->pcap_test_buf, uart->pcap_test_idx, 0);
+                    furi_stream_buffer_send(
+                        uart->rx_stream, uart->pcap_test_buf, uart->pcap_test_idx, 0);
                     furi_thread_flags_set(furi_thread_get_id(uart->rx_thread), WorkerEvtRxDone);
                 }
                 // Reset buffer and try parsing this char from scratch
@@ -112,7 +119,8 @@ static int32_t uart_worker(void* context) {
             }
         }
         if(events & WorkerEvtPcapDone) {
-            size_t len = furi_stream_buffer_receive(uart->pcap_stream, uart->rx_buf, RX_BUF_SIZE, 0);
+            size_t len =
+                furi_stream_buffer_receive(uart->pcap_stream, uart->rx_buf, RX_BUF_SIZE, 0);
             if(len > 0) {
                 if(uart->handle_rx_pcap_cb) uart->handle_rx_pcap_cb(uart->rx_buf, len, uart->app);
             }