فهرست منبع

QR Code simple app ignore start serial garbage

Erwin Ried 2 سال پیش
والد
کامیت
d336700cda

+ 4 - 3
flipper_companion_apps/applications/plugins/esp32cam_qrcode/uart_echo.c

@@ -107,7 +107,7 @@ static int32_t uart_echo_worker(void* context) {
             do {
                 uint8_t data[64];
                 length = furi_stream_buffer_receive(app->rx_stream, data, 64, 0);
-                if(length > 0) {
+                if(length > 0 && app->initialized) {
                     furi_hal_uart_tx(FuriHalUartIdUSART1, data, length);
                     with_view_model(
                         app->view,
@@ -179,9 +179,10 @@ static UartEchoApp* uart_echo_app_alloc() {
     furi_delay_ms(100);
     furi_hal_power_enable_external_3_3v();
     furi_hal_power_enable_otg();
-    furi_delay_ms(600); 
+    furi_delay_ms(1000); 
     furi_hal_uart_tx(FuriHalUartIdUSART1, (uint8_t[1]){'q'}, 1); // Just to trigger the qr code mode
-
+    furi_delay_ms(10);
+    app->initialized = true;
     return app;
 }
 

+ 1 - 0
flipper_companion_apps/applications/plugins/esp32cam_qrcode/uart_echo.h

@@ -21,6 +21,7 @@ typedef struct {
     View* view;
     FuriThread* worker_thread;
     FuriStreamBuffer* rx_stream;
+    bool initialized;
 } UartEchoApp;
 
 typedef struct {