diff --git a/applications/main/archive/helpers/archive_files.c b/applications/main/archive/helpers/archive_files.c index 3e78c0d1b..10b89c3b5 100644 --- a/applications/main/archive/helpers/archive_files.c +++ b/applications/main/archive/helpers/archive_files.c @@ -18,7 +18,7 @@ void archive_set_file_type(ArchiveFile_t* file, const char* path, bool is_folder } else { for(size_t i = 0; i < COUNT_OF(known_ext); i++) { if((known_ext[i][0] == '?') || (known_ext[i][0] == '*')) continue; - if(furi_string_end_with_str(file->path, known_ext[i])) { + if(furi_string_end_with(file->path, known_ext[i])) { // Check for .txt containing folder if(strcmp(known_ext[i], ".txt") == 0) { const char* txt_path = NULL; diff --git a/applications/services/gui/modules/file_browser_worker.c b/applications/services/gui/modules/file_browser_worker.c index 978773c06..d57238842 100644 --- a/applications/services/gui/modules/file_browser_worker.c +++ b/applications/services/gui/modules/file_browser_worker.c @@ -83,6 +83,7 @@ static bool browser_path_trim(FuriString* path) { return is_root; } static void browser_parse_ext_filter(ExtFilterArray_t ext_filter, const char* filter_str) { + ExtFilterArray_reset(ext_filter); if(!filter_str) { return; } @@ -94,7 +95,6 @@ static void browser_parse_ext_filter(ExtFilterArray_t ext_filter, const char* fi size_t str_offset = 0; FuriString* ext_temp = furi_string_alloc(); - ExtFilterArray_reset(ext_filter); while(1) { size_t ext_len = strcspn(&filter_str[str_offset], "|"); diff --git a/applications/services/gui/modules/text_box.c b/applications/services/gui/modules/text_box.c index ea4d7a7bc..0cfc6286b 100644 --- a/applications/services/gui/modules/text_box.c +++ b/applications/services/gui/modules/text_box.c @@ -4,6 +4,9 @@ #include #include +#define TEXT_BOX_MAX_SYMBOL_WIDTH (10) +#define TEXT_BOX_LINE_WIDTH (120) + struct TextBox { View* view; @@ -78,13 +81,11 @@ static void text_box_insert_endline(Canvas* canvas, TextBoxModel* model) { const char* str = model->text; size_t line_num = 0; - const size_t text_width = 120; - while(str[i] != '\0') { char symb = str[i++]; if(symb != '\n') { size_t glyph_width = canvas_glyph_width(canvas, symb); - if(line_width + glyph_width > text_width) { + if(line_width + glyph_width > TEXT_BOX_LINE_WIDTH) { line_num++; line_width = 0; furi_string_push_back(model->text_formatted, '\n'); @@ -212,6 +213,7 @@ void text_box_reset(TextBox* text_box) { furi_string_set(model->text_formatted, ""); model->font = TextBoxFontText; model->focus = TextBoxFocusStart; + model->formatted = false; }, true); } @@ -219,6 +221,8 @@ void text_box_reset(TextBox* text_box) { void text_box_set_text(TextBox* text_box, const char* text) { furi_assert(text_box); furi_assert(text); + size_t str_length = strlen(text); + size_t formating_margin = str_length * TEXT_BOX_MAX_SYMBOL_WIDTH / TEXT_BOX_LINE_WIDTH; with_view_model( text_box->view, @@ -226,7 +230,7 @@ void text_box_set_text(TextBox* text_box, const char* text) { { model->text = text; furi_string_reset(model->text_formatted); - furi_string_reserve(model->text_formatted, strlen(text)); + furi_string_reserve(model->text_formatted, str_length + formating_margin); model->formatted = false; }, true); diff --git a/applications/system/js_app/js_thread.c b/applications/system/js_app/js_thread.c index 22007d013..5ca365404 100644 --- a/applications/system/js_app/js_thread.c +++ b/applications/system/js_app/js_thread.c @@ -210,6 +210,7 @@ static void js_global_to_hex_string(struct mjs* mjs) { mjs_return(mjs, ret); } +#ifdef JS_DEBUG static void js_dump_write_callback(void* ctx, const char* format, ...) { File* file = ctx; furi_assert(ctx); @@ -225,6 +226,7 @@ static void js_dump_write_callback(void* ctx, const char* format, ...) { storage_file_write(file, furi_string_get_cstr(str), furi_string_size(str)); furi_string_free(str); } +#endif static int32_t js_thread(void* arg) { JsThread* worker = arg; @@ -255,6 +257,7 @@ static int32_t js_thread(void* arg) { mjs_err_t err = mjs_exec_file(mjs, furi_string_get_cstr(worker->path), NULL); +#ifdef JS_DEBUG if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) { FuriString* dump_path = furi_string_alloc_set(worker->path); furi_string_cat(dump_path, ".lst"); @@ -273,6 +276,7 @@ static int32_t js_thread(void* arg) { furi_string_free(dump_path); } +#endif if(err != MJS_OK) { FURI_LOG_E(TAG, "Exec error: %s", mjs_strerror(mjs, err)); diff --git a/lib/signal_reader/signal_reader.c b/lib/signal_reader/signal_reader.c index 1c08d29f4..c06c7a5c0 100644 --- a/lib/signal_reader/signal_reader.c +++ b/lib/signal_reader/signal_reader.c @@ -228,6 +228,7 @@ void signal_reader_start(SignalReader* instance, SignalReaderCallback callback, /* We need the EXTI to be configured as interrupt generating line, but no ISR registered */ furi_hal_gpio_init( instance->pin, GpioModeInterruptRiseFall, instance->pull, GpioSpeedVeryHigh); + furi_hal_gpio_enable_int_callback(instance->pin); /* Set DMAMUX request generation signal ID on specified DMAMUX channel */ LL_DMAMUX_SetRequestSignalID( @@ -309,6 +310,8 @@ void signal_reader_stop(SignalReader* instance) { furi_hal_interrupt_set_isr(SIGNAL_READER_DMA_GPIO_IRQ, NULL, NULL); + furi_hal_gpio_disable_int_callback(instance->pin); + // Deinit DMA Rx pin LL_DMA_DeInit(SIGNAL_READER_DMA_GPIO_DEF); // Deinit DMA Sync timer diff --git a/scripts/toolchain/fbtenv.sh b/scripts/toolchain/fbtenv.sh index ea7c9019b..73bae42c4 100755 --- a/scripts/toolchain/fbtenv.sh +++ b/scripts/toolchain/fbtenv.sh @@ -141,7 +141,12 @@ fbtenv_get_kernel_type() return 1; fi TOOLCHAIN_ARCH_DIR="$FBT_TOOLCHAIN_PATH/toolchain/$ARCH_TYPE-$SYS_TYPE"; - TOOLCHAIN_URL="https://update.flipperzero.one/builds/toolchain/gcc-arm-none-eabi-12.3-$ARCH_TYPE-$SYS_TYPE-flipper-$FBT_TOOLCHAIN_VERSION.tar.gz"; + if [ -z "${FBT_TOOLS_CUSTOM_LINK:-}" ]; then + TOOLCHAIN_URL="https://update.flipperzero.one/builds/toolchain/gcc-arm-none-eabi-12.3-$ARCH_TYPE-$SYS_TYPE-flipper-$FBT_TOOLCHAIN_VERSION.tar.gz"; + else + echo "info: custom toolchain link is used"; + TOOLCHAIN_URL=$FBT_TOOLS_CUSTOM_LINK; + fi return 0; } diff --git a/targets/f7/furi_hal/furi_hal_gpio.c b/targets/f7/furi_hal/furi_hal_gpio.c index 1e703b5d1..da195bdca 100644 --- a/targets/f7/furi_hal/furi_hal_gpio.c +++ b/targets/f7/furi_hal/furi_hal_gpio.c @@ -215,11 +215,8 @@ void furi_hal_gpio_enable_int_callback(const GpioPin* gpio) { FURI_CRITICAL_ENTER(); - uint8_t pin_num = furi_hal_gpio_get_pin_num(gpio); - if(gpio_interrupt[pin_num].callback) { - const uint32_t exti_line = GET_EXTI_LINE(gpio->pin); - LL_EXTI_EnableIT_0_31(exti_line); - } + const uint32_t exti_line = GET_EXTI_LINE(gpio->pin); + LL_EXTI_EnableIT_0_31(exti_line); FURI_CRITICAL_EXIT(); }