diff --git a/applications/plugins/doom/doom_music_player_worker.c b/applications/plugins/doom/doom_music_player_worker.c index 8b7f95f11..d691f3cae 100644 --- a/applications/plugins/doom/doom_music_player_worker.c +++ b/applications/plugins/doom/doom_music_player_worker.c @@ -258,7 +258,7 @@ static bool music_player_worker_parse_notes(MusicPlayerWorker* instance, const c if(!is_valid) { FURI_LOG_E( TAG, - "Invalid note: %u%c%c%u.%u", + "Invalid note: %lu%c%c%lu.%lu", duration, note_char == '\0' ? '_' : note_char, sharp_char == '\0' ? '_' : sharp_char, @@ -281,7 +281,7 @@ static bool music_player_worker_parse_notes(MusicPlayerWorker* instance, const c if(music_player_worker_add_note(instance, semitone, duration, dots)) { FURI_LOG_D( TAG, - "Added note: %c%c%u.%u = %u %u", + "Added note: %c%c%lu.%lu = %u %lu", note_char == '\0' ? '_' : note_char, sharp_char == '\0' ? '_' : sharp_char, octave, @@ -291,7 +291,7 @@ static bool music_player_worker_parse_notes(MusicPlayerWorker* instance, const c } else { FURI_LOG_E( TAG, - "Invalid note: %c%c%u.%u = %u %u", + "Invalid note: %c%c%lu.%lu = %u %lu", note_char == '\0' ? '_' : note_char, sharp_char == '\0' ? '_' : sharp_char, octave, diff --git a/applications/plugins/esp8266_deauth/esp8266_deauth.c b/applications/plugins/esp8266_deauth/esp8266_deauth.c index d36580ec1..8503ae65c 100644 --- a/applications/plugins/esp8266_deauth/esp8266_deauth.c +++ b/applications/plugins/esp8266_deauth/esp8266_deauth.c @@ -10,7 +10,7 @@ //#include //#include //#include -#include + #include #include "FlipperZeroWiFiDeauthModuleDefines.h" @@ -65,7 +65,7 @@ typedef struct SWiFiDeauthApp { Gui* m_gui; FuriThread* m_worker_thread; //NotificationApp* m_notification; - StreamBufferHandle_t m_rx_stream; + FuriStreamBuffer* m_rx_stream; SGpioButtons m_GpioButtons; bool m_wifiDeauthModuleInitialized; @@ -219,7 +219,6 @@ static void static void uart_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context) { furi_assert(context); - BaseType_t xHigherPriorityTaskWoken = pdFALSE; SWiFiDeauthApp* app = context; @@ -227,9 +226,8 @@ static void uart_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context) { if(ev == UartIrqEventRXNE) { DEAUTH_APP_LOG_I("ev == UartIrqEventRXNE"); - xStreamBufferSendFromISR(app->m_rx_stream, &data, 1, &xHigherPriorityTaskWoken); + furi_stream_buffer_send(app->m_rx_stream, &data, 1, 0); furi_thread_flags_set(furi_thread_get_id(app->m_worker_thread), WorkerEventRx); - portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } } @@ -242,7 +240,7 @@ static int32_t uart_worker(void* context) { return 1; } - StreamBufferHandle_t rx_stream = app->m_rx_stream; + FuriStreamBuffer* rx_stream = app->m_rx_stream; release_mutex((ValueMutex*)context, app); @@ -272,7 +270,7 @@ static int32_t uart_worker(void* context) { const uint8_t dataBufferSize = 64; uint8_t dataBuffer[dataBufferSize]; dataReceivedLength = - xStreamBufferReceive(rx_stream, dataBuffer, dataBufferSize, 25); + furi_stream_buffer_receive(rx_stream, dataBuffer, dataBufferSize, 25); if(dataReceivedLength > 0) { #if ENABLE_MODULE_POWER if(!initialized) { @@ -367,7 +365,7 @@ int32_t esp8266_deauth_app(void* p) { DEAUTH_APP_LOG_I("Mutex created"); - app->m_rx_stream = xStreamBufferCreate(1 * 1024, 1); + app->m_rx_stream = furi_stream_buffer_alloc(1 * 1024, 1); //app->m_notification = furi_record_open("notification"); @@ -518,7 +516,7 @@ int32_t esp8266_deauth_app(void* p) { furi_message_queue_free(event_queue); - vStreamBufferDelete(app->m_rx_stream); + furi_stream_buffer_free(app->m_rx_stream); delete_mutex(&app_data_mutex); diff --git a/applications/plugins/mousejacker/mousejacker.c b/applications/plugins/mousejacker/mousejacker.c index bd53cbaa1..a0cf4845f 100644 --- a/applications/plugins/mousejacker/mousejacker.c +++ b/applications/plugins/mousejacker/mousejacker.c @@ -118,7 +118,7 @@ static bool open_ducky_script(Stream* stream, PluginState* plugin_state) { furi_record_close("dialogs"); if(ret) { if(!file_stream_open(stream, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) { - FURI_LOG_D(TAG, "Cannot open file \"%s\"", (path)); + FURI_LOG_D(TAG, "Cannot open file \"%s\"", furi_string_get_cstr(path)); } else { result = true; } @@ -147,7 +147,7 @@ static bool open_addrs_file(Stream* stream) { furi_record_close("dialogs"); if(ret) { if(!file_stream_open(stream, furi_string_get_cstr(path), FSAM_READ, FSOM_OPEN_EXISTING)) { - FURI_LOG_D(TAG, "Cannot open file \"%s\"", (path)); + FURI_LOG_D(TAG, "Cannot open file \"%s\"", furi_string_get_cstr(path)); } else { result = true; } diff --git a/applications/plugins/mousejacker/mousejacker_ducky.c b/applications/plugins/mousejacker/mousejacker_ducky.c index f323a93da..7a57856e1 100644 --- a/applications/plugins/mousejacker/mousejacker_ducky.c +++ b/applications/plugins/mousejacker/mousejacker_ducky.c @@ -261,7 +261,7 @@ static bool mj_process_ducky_line( repeat_cnt = atoi(line_tmp); if(repeat_cnt < 2) return false; - FURI_LOG_D(TAG, "repeating %s %d times", prev_line, repeat_cnt); + FURI_LOG_D(TAG, "repeating %s %ld times", prev_line, repeat_cnt); for(uint32_t i = 0; i < repeat_cnt; i++) mj_process_ducky_line(handle, addr, addr_size, rate, prev_line, NULL, plugin_state); diff --git a/applications/plugins/playlist/playlist.c b/applications/plugins/playlist/playlist.c index f0f9ea0c3..db03fadff 100644 --- a/applications/plugins/playlist/playlist.c +++ b/applications/plugins/playlist/playlist.c @@ -473,9 +473,9 @@ static void render_callback(Canvas* canvas, void* ctx) { canvas, 1, 19, AlignLeft, AlignTop, furi_string_get_cstr(temp_str)); if(app->meta->playlist_repetitions <= 0) { - furi_string_printf(temp_str, "Repeat: inf", app->meta->playlist_repetitions); + furi_string_set(temp_str, "Repeat: inf"); } else if(app->meta->playlist_repetitions == 1) { - furi_string_printf(temp_str, "Repeat: no", app->meta->playlist_repetitions); + furi_string_set(temp_str, "Repeat: no"); } else { furi_string_printf(temp_str, "Repeat: %dx", app->meta->playlist_repetitions); } diff --git a/applications/plugins/spectrum_analyzer/spectrum_analyzer.c b/applications/plugins/spectrum_analyzer/spectrum_analyzer.c index 5bc563451..d94739bc1 100644 --- a/applications/plugins/spectrum_analyzer/spectrum_analyzer.c +++ b/applications/plugins/spectrum_analyzer/spectrum_analyzer.c @@ -326,7 +326,7 @@ void spectrum_analyzer_calculate_frequencies(SpectrumAnalyzerModel* model) { model->max_rssi = -200.0; model->max_rssi_dec = 0; - FURI_LOG_D("Spectrum", "setup_frequencies - max_hz: %u - min_hz: %u", max_hz, min_hz); + FURI_LOG_D("Spectrum", "setup_frequencies - max_hz: %lu - min_hz: %lu", max_hz, min_hz); FURI_LOG_D("Spectrum", "center_freq: %u", model->center_freq); FURI_LOG_D( "Spectrum", @@ -450,7 +450,7 @@ int32_t spectrum_analyzer_app(void* p) { break; case InputKeyRight: model->center_freq += hstep; - FURI_LOG_D("Spectrum", "center_freq: %lu", model->center_freq); + FURI_LOG_D("Spectrum", "center_freq: %u", model->center_freq); spectrum_analyzer_calculate_frequencies(model); spectrum_analyzer_worker_set_frequencies( spectrum_analyzer->worker, model->channel0_frequency, model->spacing, model->width); @@ -460,7 +460,7 @@ int32_t spectrum_analyzer_app(void* p) { spectrum_analyzer_calculate_frequencies(model); spectrum_analyzer_worker_set_frequencies( spectrum_analyzer->worker, model->channel0_frequency, model->spacing, model->width); - FURI_LOG_D("Spectrum", "center_freq: %lu", model->center_freq); + FURI_LOG_D("Spectrum", "center_freq: %u", model->center_freq); break; case InputKeyOk: { switch(model->width) { diff --git a/applications/plugins/spectrum_analyzer/spectrum_analyzer_worker.c b/applications/plugins/spectrum_analyzer/spectrum_analyzer_worker.c index f4533f5d1..e670d2808 100644 --- a/applications/plugins/spectrum_analyzer/spectrum_analyzer_worker.c +++ b/applications/plugins/spectrum_analyzer/spectrum_analyzer_worker.c @@ -168,7 +168,7 @@ void spectrum_analyzer_worker_set_frequencies( FURI_LOG_D( "SpectrumWorker", - "spectrum_analyzer_worker_set_frequencies - channel0_frequency= %u - spacing = %u - width = %u", + "spectrum_analyzer_worker_set_frequencies - channel0_frequency= %lu - spacing = %lu - width = %u", channel0_frequency, spacing, width); diff --git a/applications/plugins/subbrute/subbrute_device.c b/applications/plugins/subbrute/subbrute_device.c index 903dd86e5..e335438a4 100644 --- a/applications/plugins/subbrute/subbrute_device.c +++ b/applications/plugins/subbrute/subbrute_device.c @@ -212,7 +212,7 @@ bool subbrute_device_create_packet_parsed(SubBruteDevice* instance, uint64_t ste //snprintf(step_payload, sizeof(step_payload), "%16X", step); //snprintf(step_payload, sizeof(step_payload), "%016llX", step); FuriString* buffer = furi_string_alloc(); - furi_string_printf(buffer, "%16X", step); + furi_string_printf(buffer, "%16llX", step); int j = 0; furi_string_set_str(candidate, " "); for(uint8_t i = 0; i < 16; i++) { diff --git a/applications/plugins/subbrute/subbrute_i.h b/applications/plugins/subbrute/subbrute_i.h index edd64362e..348a180c1 100644 --- a/applications/plugins/subbrute/subbrute_i.h +++ b/applications/plugins/subbrute/subbrute_i.h @@ -9,7 +9,6 @@ #include #include -#include #include #include diff --git a/applications/plugins/wifi_marauder_companion/wifi_marauder_uart.c b/applications/plugins/wifi_marauder_companion/wifi_marauder_uart.c index a7dc26e8b..8c8d82eb6 100644 --- a/applications/plugins/wifi_marauder_companion/wifi_marauder_uart.c +++ b/applications/plugins/wifi_marauder_companion/wifi_marauder_uart.c @@ -1,15 +1,13 @@ #include "wifi_marauder_app_i.h" #include "wifi_marauder_uart.h" -#include - #define UART_CH (FuriHalUartIdUSART1) #define BAUDRATE (115200) struct WifiMarauderUart { WifiMarauderApp* app; FuriThread* rx_thread; - StreamBufferHandle_t rx_stream; + FuriStreamBuffer* rx_stream; uint8_t rx_buf[RX_BUF_SIZE + 1]; void (*handle_rx_data_cb)(uint8_t* buf, size_t len, void* context); }; @@ -30,19 +28,17 @@ void wifi_marauder_uart_set_handle_rx_data_cb( void wifi_marauder_uart_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context) { WifiMarauderUart* uart = (WifiMarauderUart*)context; - BaseType_t xHigherPriorityTaskWoken = pdFALSE; if(ev == UartIrqEventRXNE) { - xStreamBufferSendFromISR(uart->rx_stream, &data, 1, &xHigherPriorityTaskWoken); + furi_stream_buffer_send(uart->rx_stream, &data, 1, 0); furi_thread_flags_set(furi_thread_get_id(uart->rx_thread), WorkerEvtRxDone); - portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } } static int32_t uart_worker(void* context) { WifiMarauderUart* uart = (void*)context; - uart->rx_stream = xStreamBufferCreate(RX_BUF_SIZE, 1); + uart->rx_stream = furi_stream_buffer_alloc(RX_BUF_SIZE, 1); while(1) { uint32_t events = @@ -50,14 +46,14 @@ static int32_t uart_worker(void* context) { furi_check((events & FuriFlagError) == 0); if(events & WorkerEvtStop) break; if(events & WorkerEvtRxDone) { - size_t len = xStreamBufferReceive(uart->rx_stream, uart->rx_buf, RX_BUF_SIZE, 0); + size_t len = furi_stream_buffer_receive(uart->rx_stream, uart->rx_buf, RX_BUF_SIZE, 0); if(len > 0) { if(uart->handle_rx_data_cb) uart->handle_rx_data_cb(uart->rx_buf, len, uart->app); } } } - vStreamBufferDelete(uart->rx_stream); + furi_stream_buffer_free(uart->rx_stream); return 0; } diff --git a/applications/plugins/wifi_scanner/wifi_scanner.c b/applications/plugins/wifi_scanner/wifi_scanner.c index 03dc0e903..4de68ee58 100644 --- a/applications/plugins/wifi_scanner/wifi_scanner.c +++ b/applications/plugins/wifi_scanner/wifi_scanner.c @@ -10,7 +10,7 @@ #include #include #include -#include + #include #include "FlipperZeroWiFiModuleDefines.h" @@ -86,7 +86,7 @@ typedef struct SWiFiScannerApp { Gui* m_gui; FuriThread* m_worker_thread; NotificationApp* m_notification; - StreamBufferHandle_t m_rx_stream; + FuriStreamBuffer* m_rx_stream; bool m_wifiModuleInitialized; bool m_wifiModuleAttached; @@ -445,7 +445,6 @@ static void wifi_module_input_callback(InputEvent* input_event, FuriMessageQueue static void uart_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context) { furi_assert(context); - BaseType_t xHigherPriorityTaskWoken = pdFALSE; SWiFiScannerApp* app = context; @@ -453,9 +452,8 @@ static void uart_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context) { if(ev == UartIrqEventRXNE) { WIFI_APP_LOG_I("ev == UartIrqEventRXNE"); - xStreamBufferSendFromISR(app->m_rx_stream, &data, 1, &xHigherPriorityTaskWoken); + furi_stream_buffer_send(app->m_rx_stream, &data, 1, 0); furi_thread_flags_set(furi_thread_get_id(app->m_worker_thread), WorkerEventRx); - portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } } @@ -467,7 +465,7 @@ static int32_t uart_worker(void* context) { return 1; } - StreamBufferHandle_t rx_stream = app->m_rx_stream; + FuriStreamBuffer* rx_stream = app->m_rx_stream; release_mutex((ValueMutex*)context, app); @@ -483,7 +481,7 @@ static int32_t uart_worker(void* context) { receivedString = furi_string_alloc(); do { uint8_t data[64]; - length = xStreamBufferReceive(rx_stream, data, 64, 25); + length = furi_stream_buffer_receive(rx_stream, data, 64, 25); if(length > 0) { WIFI_APP_LOG_I("Received Data - length: %i", length); @@ -676,7 +674,7 @@ int32_t wifi_scanner_app(void* p) { WIFI_APP_LOG_I("Mutex created"); - app->m_rx_stream = xStreamBufferCreate(1 * 1024, 1); + app->m_rx_stream = furi_stream_buffer_alloc(1 * 1024, 1); app->m_notification = furi_record_open("notification"); @@ -839,7 +837,7 @@ int32_t wifi_scanner_app(void* p) { furi_message_queue_free(event_queue); - vStreamBufferDelete(app->m_rx_stream); + furi_stream_buffer_free(app->m_rx_stream); delete_mutex(&app_data_mutex);