diff --git a/applications/plugins/esp8266_deauth/esp8266_deauth.c b/applications/plugins/esp8266_deauth/esp8266_deauth.c index b9e9c02a7..3cc61a588 100644 --- a/applications/plugins/esp8266_deauth/esp8266_deauth.c +++ b/applications/plugins/esp8266_deauth/esp8266_deauth.c @@ -365,8 +365,6 @@ int32_t esp8266_deauth_app(void* p) { DEAUTH_APP_LOG_I("Mutex created"); - app->m_rx_stream = furi_stream_buffer_alloc(1 * 1024, 1); - //app->m_notification = furi_record_open("notification"); ViewPort* view_port = view_port_alloc(); @@ -379,13 +377,7 @@ int32_t esp8266_deauth_app(void* p) { //notification_message(app->notification, &sequence_set_only_blue_255); - // Enable uart listener -#if DISABLE_CONSOLE - furi_hal_console_disable(); -#endif - furi_hal_uart_set_br(FuriHalUartIdUSART1, FLIPPERZERO_SERIAL_BAUD); - furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, uart_on_irq_cb, app); - DEAUTH_APP_LOG_I("UART Listener created"); + app->m_rx_stream = furi_stream_buffer_alloc(1 * 1024, 1); app->m_worker_thread = furi_thread_alloc(); furi_thread_set_name(app->m_worker_thread, "WiFiDeauthModuleUARTWorker"); @@ -395,6 +387,14 @@ int32_t esp8266_deauth_app(void* p) { furi_thread_start(app->m_worker_thread); DEAUTH_APP_LOG_I("UART thread allocated"); + // Enable uart listener +#if DISABLE_CONSOLE + furi_hal_console_disable(); +#endif + furi_hal_uart_set_br(FuriHalUartIdUSART1, FLIPPERZERO_SERIAL_BAUD); + furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, uart_on_irq_cb, app); + DEAUTH_APP_LOG_I("UART Listener created"); + SPluginEvent event; for(bool processing = true; processing;) { FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100); diff --git a/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_console_output.c b/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_console_output.c index 55e6f63a4..25ea0abb0 100644 --- a/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_console_output.c +++ b/applications/plugins/wifi_marauder_companion/scenes/wifi_marauder_scene_console_output.c @@ -34,7 +34,7 @@ void wifi_marauder_scene_console_output_on_enter(void* context) { app->text_box_store_strlen = 0; if(0 == strncmp("help", app->selected_tx_string, strlen("help"))) { const char* help_msg = - "Marauder companion v0.2.1\nFor app support/feedback,\nreach out to me:\n@cococode#6011 (discord)\n0xchocolate (github)\n"; + "Marauder companion v0.2.2\nFor app support/feedback,\nreach out to me:\n@cococode#6011 (discord)\n0xchocolate (github)\n"; furi_string_cat_str(app->text_box_store, help_msg); app->text_box_store_strlen += strlen(help_msg); } diff --git a/applications/plugins/wifi_marauder_companion/wifi_marauder_uart.c b/applications/plugins/wifi_marauder_companion/wifi_marauder_uart.c index 8c8d82eb6..228b0f83d 100644 --- a/applications/plugins/wifi_marauder_companion/wifi_marauder_uart.c +++ b/applications/plugins/wifi_marauder_companion/wifi_marauder_uart.c @@ -38,8 +38,6 @@ void wifi_marauder_uart_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context) static int32_t uart_worker(void* context) { WifiMarauderUart* uart = (void*)context; - uart->rx_stream = furi_stream_buffer_alloc(RX_BUF_SIZE, 1); - while(1) { uint32_t events = furi_thread_flags_wait(WORKER_ALL_RX_EVENTS, FuriFlagWaitAny, FuriWaitForever); @@ -65,18 +63,19 @@ void wifi_marauder_uart_tx(uint8_t* data, size_t len) { WifiMarauderUart* wifi_marauder_uart_init(WifiMarauderApp* app) { WifiMarauderUart* uart = malloc(sizeof(WifiMarauderUart)); - furi_hal_console_disable(); - furi_hal_uart_set_br(UART_CH, BAUDRATE); - furi_hal_uart_set_irq_cb(UART_CH, wifi_marauder_uart_on_irq_cb, uart); - uart->app = app; + uart->rx_stream = furi_stream_buffer_alloc(RX_BUF_SIZE, 1); uart->rx_thread = furi_thread_alloc(); furi_thread_set_name(uart->rx_thread, "WifiMarauderUartRxThread"); furi_thread_set_stack_size(uart->rx_thread, 1024); furi_thread_set_context(uart->rx_thread, uart); furi_thread_set_callback(uart->rx_thread, uart_worker); - furi_thread_start(uart->rx_thread); + + furi_hal_console_disable(); + furi_hal_uart_set_br(UART_CH, BAUDRATE); + furi_hal_uart_set_irq_cb(UART_CH, wifi_marauder_uart_on_irq_cb, uart); + return uart; } diff --git a/applications/plugins/wifi_scanner/wifi_scanner.c b/applications/plugins/wifi_scanner/wifi_scanner.c index c426c7159..826048e26 100644 --- a/applications/plugins/wifi_scanner/wifi_scanner.c +++ b/applications/plugins/wifi_scanner/wifi_scanner.c @@ -674,8 +674,6 @@ int32_t wifi_scanner_app(void* p) { WIFI_APP_LOG_I("Mutex created"); - app->m_rx_stream = furi_stream_buffer_alloc(1 * 1024, 1); - app->m_notification = furi_record_open("notification"); ViewPort* view_port = view_port_alloc(); @@ -688,13 +686,7 @@ int32_t wifi_scanner_app(void* p) { //notification_message(app->notification, &sequence_set_only_blue_255); - // Enable uart listener -#if DISABLE_CONSOLE - furi_hal_console_disable(); -#endif - furi_hal_uart_set_br(FuriHalUartIdUSART1, FLIPPERZERO_SERIAL_BAUD); - furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, uart_on_irq_cb, app); - WIFI_APP_LOG_I("UART Listener created"); + app->m_rx_stream = furi_stream_buffer_alloc(1 * 1024, 1); app->m_worker_thread = furi_thread_alloc(); furi_thread_set_name(app->m_worker_thread, "WiFiModuleUARTWorker"); @@ -704,6 +696,14 @@ int32_t wifi_scanner_app(void* p) { furi_thread_start(app->m_worker_thread); WIFI_APP_LOG_I("UART thread allocated"); + // Enable uart listener +#if DISABLE_CONSOLE + furi_hal_console_disable(); +#endif + furi_hal_uart_set_br(FuriHalUartIdUSART1, FLIPPERZERO_SERIAL_BAUD); + furi_hal_uart_set_irq_cb(FuriHalUartIdUSART1, uart_on_irq_cb, app); + WIFI_APP_LOG_I("UART Listener created"); + // Because we assume that module was on before we launched the app. We need to ensure that module will be in initial state on app start send_serial_command(ESerialCommand_Restart);