diff --git a/.vscode/example/tasks.json b/.vscode/example/tasks.json index 67a4b2cdb..0acfc7e2d 100644 --- a/.vscode/example/tasks.json +++ b/.vscode/example/tasks.json @@ -15,6 +15,18 @@ "type": "shell", "command": "./fbt" }, + { + "label": "[FBT] Format", + "group": "build", + "type": "shell", + "command": "./fbt format" + }, + { + "label": "[FBT] Clear", + "group": "build", + "type": "shell", + "command": "./fbt -c" + }, { "label": "[Release] Flash (ST-Link)", "group": "build", diff --git a/applications/external/barcode_gen/application.fam b/applications/external/barcode_gen/application.fam index 19bb84122..dad2b30cf 100644 --- a/applications/external/barcode_gen/application.fam +++ b/applications/external/barcode_gen/application.fam @@ -8,9 +8,9 @@ App( fap_category="Tools", fap_icon="images/barcode_10.png", fap_icon_assets="images", - fap_icon_assets_symbol="barcode_app", + fap_file_assets="barcode_encoding_files", fap_author="@Kingal1337", fap_weburl="https://github.com/Kingal1337/flipper-barcode-generator", - fap_version="1.0", + fap_version="1.1", fap_description="App allows you to display various barcodes on flipper screen", ) diff --git a/applications/external/barcode_gen/barcode_app.h b/applications/external/barcode_gen/barcode_app.h index 3150bff1f..bddc82235 100644 --- a/applications/external/barcode_gen/barcode_app.h +++ b/applications/external/barcode_gen/barcode_app.h @@ -23,20 +23,17 @@ #define BARCODE_HEIGHT 50 #define BARCODE_Y_START 3 -//the folder where the encodings are located -#define BARCODE_DATA_FILE_DIR_PATH EXT_PATH("apps_data/barcode_data") - //the folder where the codabar encoding table is located -#define CODABAR_DICT_FILE_PATH BARCODE_DATA_FILE_DIR_PATH "/codabar_encodings.txt" +#define CODABAR_DICT_FILE_PATH APP_ASSETS_PATH("codabar_encodings.txt") //the folder where the code 39 encoding table is located -#define CODE39_DICT_FILE_PATH BARCODE_DATA_FILE_DIR_PATH "/code39_encodings.txt" +#define CODE39_DICT_FILE_PATH APP_ASSETS_PATH("code39_encodings.txt") //the folder where the code 128 encoding table is located -#define CODE128_DICT_FILE_PATH BARCODE_DATA_FILE_DIR_PATH "/code128_encodings.txt" +#define CODE128_DICT_FILE_PATH APP_ASSETS_PATH("code128_encodings.txt") //the folder where the code 128 C encoding table is located -#define CODE128C_DICT_FILE_PATH BARCODE_DATA_FILE_DIR_PATH "/code128c_encodings.txt" +#define CODE128C_DICT_FILE_PATH APP_ASSETS_PATH("code128c_encodings.txt") //the folder where the user stores their barcodes #define DEFAULT_USER_BARCODES EXT_PATH("apps_data/barcodes") diff --git a/assets/resources/apps_data/barcode_data/codabar_encodings.txt b/applications/external/barcode_gen/barcode_encoding_files/codabar_encodings.txt similarity index 100% rename from assets/resources/apps_data/barcode_data/codabar_encodings.txt rename to applications/external/barcode_gen/barcode_encoding_files/codabar_encodings.txt diff --git a/assets/resources/apps_data/barcode_data/code128_encodings.txt b/applications/external/barcode_gen/barcode_encoding_files/code128_encodings.txt similarity index 100% rename from assets/resources/apps_data/barcode_data/code128_encodings.txt rename to applications/external/barcode_gen/barcode_encoding_files/code128_encodings.txt diff --git a/assets/resources/apps_data/barcode_data/code128c_encodings.txt b/applications/external/barcode_gen/barcode_encoding_files/code128c_encodings.txt similarity index 100% rename from assets/resources/apps_data/barcode_data/code128c_encodings.txt rename to applications/external/barcode_gen/barcode_encoding_files/code128c_encodings.txt diff --git a/assets/resources/apps_data/barcode_data/code39_encodings.txt b/applications/external/barcode_gen/barcode_encoding_files/code39_encodings.txt similarity index 100% rename from assets/resources/apps_data/barcode_data/code39_encodings.txt rename to applications/external/barcode_gen/barcode_encoding_files/code39_encodings.txt diff --git a/applications/external/hid_app/assets/KB_key_Alt_17x10.png b/applications/external/hid_app/assets/KB_key_Alt_17x10.png new file mode 100644 index 000000000..26c4f7315 Binary files /dev/null and b/applications/external/hid_app/assets/KB_key_Alt_17x10.png differ diff --git a/applications/external/hid_app/assets/KB_key_Cmd_17x10.png b/applications/external/hid_app/assets/KB_key_Cmd_17x10.png new file mode 100644 index 000000000..8d87ffde6 Binary files /dev/null and b/applications/external/hid_app/assets/KB_key_Cmd_17x10.png differ diff --git a/applications/external/hid_app/assets/KB_key_Ctl_17x10.png b/applications/external/hid_app/assets/KB_key_Ctl_17x10.png new file mode 100644 index 000000000..01f3157c9 Binary files /dev/null and b/applications/external/hid_app/assets/KB_key_Ctl_17x10.png differ diff --git a/applications/external/hid_app/assets/KB_key_Del_17x10.png b/applications/external/hid_app/assets/KB_key_Del_17x10.png new file mode 100644 index 000000000..62bad18b5 Binary files /dev/null and b/applications/external/hid_app/assets/KB_key_Del_17x10.png differ diff --git a/applications/external/hid_app/assets/KB_key_Esc_17x10.png b/applications/external/hid_app/assets/KB_key_Esc_17x10.png new file mode 100644 index 000000000..7a9fdda22 Binary files /dev/null and b/applications/external/hid_app/assets/KB_key_Esc_17x10.png differ diff --git a/applications/external/hid_app/assets/KB_key_Tab_17x10.png b/applications/external/hid_app/assets/KB_key_Tab_17x10.png new file mode 100644 index 000000000..d904dd418 Binary files /dev/null and b/applications/external/hid_app/assets/KB_key_Tab_17x10.png differ diff --git a/applications/external/hid_app/assets/OutCircles.png b/applications/external/hid_app/assets/OutCircles_70x51.png similarity index 100% rename from applications/external/hid_app/assets/OutCircles.png rename to applications/external/hid_app/assets/OutCircles_70x51.png diff --git a/applications/external/hid_app/assets/S_DOWN.png b/applications/external/hid_app/assets/S_DOWN_31x15.png similarity index 100% rename from applications/external/hid_app/assets/S_DOWN.png rename to applications/external/hid_app/assets/S_DOWN_31x15.png diff --git a/applications/external/hid_app/assets/S_LEFT.png b/applications/external/hid_app/assets/S_LEFT_15x31.png similarity index 100% rename from applications/external/hid_app/assets/S_LEFT.png rename to applications/external/hid_app/assets/S_LEFT_15x31.png diff --git a/applications/external/hid_app/assets/S_RIGHT.png b/applications/external/hid_app/assets/S_RIGHT_15x31.png similarity index 100% rename from applications/external/hid_app/assets/S_RIGHT.png rename to applications/external/hid_app/assets/S_RIGHT_15x31.png diff --git a/applications/external/hid_app/assets/S_UP.png b/applications/external/hid_app/assets/S_UP_31x15.png similarity index 100% rename from applications/external/hid_app/assets/S_UP.png rename to applications/external/hid_app/assets/S_UP_31x15.png diff --git a/applications/external/hid_app/views/hid_keyboard.c b/applications/external/hid_app/views/hid_keyboard.c index 9b8c87b13..1c1525ec9 100644 --- a/applications/external/hid_app/views/hid_keyboard.c +++ b/applications/external/hid_app/views/hid_keyboard.c @@ -139,17 +139,17 @@ const HidKeyboardKey hid_keyboard_keyset[ROW_COUNT][COLUMN_COUNT] = { {.width = 1, .icon = &I_ButtonRight_4x7, .value = HID_KEYBOARD_RIGHT_ARROW}, }, { - {.width = 2, .icon = NULL, .key = "Ctl", .value = HID_KEYBOARD_L_CTRL}, + {.width = 2, .icon = &I_KB_key_Ctl_17x10, .value = HID_KEYBOARD_L_CTRL}, {.width = 0, .icon = NULL, .value = HID_KEYBOARD_L_CTRL}, - {.width = 2, .icon = NULL, .key = "Alt", .value = HID_KEYBOARD_L_ALT}, + {.width = 2, .icon = &I_KB_key_Alt_17x10, .value = HID_KEYBOARD_L_ALT}, {.width = 0, .icon = NULL, .value = HID_KEYBOARD_L_ALT}, - {.width = 2, .icon = NULL, .key = "Cmd", .value = HID_KEYBOARD_L_GUI}, + {.width = 2, .icon = &I_KB_key_Cmd_17x10, .value = HID_KEYBOARD_L_GUI}, {.width = 0, .icon = NULL, .value = HID_KEYBOARD_L_GUI}, - {.width = 2, .icon = NULL, .key = "Tab", .value = HID_KEYBOARD_TAB}, + {.width = 2, .icon = &I_KB_key_Tab_17x10, .value = HID_KEYBOARD_TAB}, {.width = 0, .icon = NULL, .value = HID_KEYBOARD_TAB}, - {.width = 2, .icon = NULL, .key = "Esc", .value = HID_KEYBOARD_ESCAPE}, + {.width = 2, .icon = &I_KB_key_Esc_17x10, .value = HID_KEYBOARD_ESCAPE}, {.width = 0, .icon = NULL, .value = HID_KEYBOARD_ESCAPE}, - {.width = 2, .icon = NULL, .key = "Del", .value = HID_KEYBOARD_DELETE_FORWARD}, + {.width = 2, .icon = &I_KB_key_Del_17x10, .value = HID_KEYBOARD_DELETE_FORWARD}, {.width = 0, .icon = NULL, .value = HID_KEYBOARD_DELETE_FORWARD}, }, }; diff --git a/applications/external/hid_app/views/hid_media.c b/applications/external/hid_app/views/hid_media.c index 98f88819f..caf854eb1 100644 --- a/applications/external/hid_app/views/hid_media.c +++ b/applications/external/hid_app/views/hid_media.c @@ -54,12 +54,12 @@ static void hid_media_draw_callback(Canvas* canvas, void* context) { canvas_set_font(canvas, FontSecondary); // Keypad circles - canvas_draw_icon(canvas, 58, 3, &I_OutCircles); + canvas_draw_icon(canvas, 58, 3, &I_OutCircles_70x51); // Up if(model->up_pressed) { canvas_set_bitmap_mode(canvas, 1); - canvas_draw_icon(canvas, 68, 6, &I_S_UP); + canvas_draw_icon(canvas, 68, 6, &I_S_UP_31x15); canvas_set_bitmap_mode(canvas, 0); canvas_set_color(canvas, ColorWhite); } @@ -69,7 +69,7 @@ static void hid_media_draw_callback(Canvas* canvas, void* context) { // Down if(model->down_pressed) { canvas_set_bitmap_mode(canvas, 1); - canvas_draw_icon(canvas, 68, 36, &I_S_DOWN); + canvas_draw_icon(canvas, 68, 36, &I_S_DOWN_31x15); canvas_set_bitmap_mode(canvas, 0); canvas_set_color(canvas, ColorWhite); } @@ -79,7 +79,7 @@ static void hid_media_draw_callback(Canvas* canvas, void* context) { // Left if(model->left_pressed) { canvas_set_bitmap_mode(canvas, 1); - canvas_draw_icon(canvas, 61, 13, &I_S_LEFT); + canvas_draw_icon(canvas, 61, 13, &I_S_LEFT_15x31); canvas_set_bitmap_mode(canvas, 0); canvas_set_color(canvas, ColorWhite); } @@ -90,7 +90,7 @@ static void hid_media_draw_callback(Canvas* canvas, void* context) { // Right if(model->right_pressed) { canvas_set_bitmap_mode(canvas, 1); - canvas_draw_icon(canvas, 91, 13, &I_S_RIGHT); + canvas_draw_icon(canvas, 91, 13, &I_S_RIGHT_15x31); canvas_set_bitmap_mode(canvas, 0); canvas_set_color(canvas, ColorWhite); } diff --git a/applications/external/hid_app/views/hid_mouse.c b/applications/external/hid_app/views/hid_mouse.c index e93ea3fc1..4c4737155 100644 --- a/applications/external/hid_app/views/hid_mouse.c +++ b/applications/external/hid_app/views/hid_mouse.c @@ -47,12 +47,12 @@ static void hid_mouse_draw_callback(Canvas* canvas, void* context) { } // Keypad circles - canvas_draw_icon(canvas, 58, 3, &I_OutCircles); + canvas_draw_icon(canvas, 58, 3, &I_OutCircles_70x51); // Up if(model->up_pressed) { canvas_set_bitmap_mode(canvas, 1); - canvas_draw_icon(canvas, 68, 6, &I_S_UP); + canvas_draw_icon(canvas, 68, 6, &I_S_UP_31x15); canvas_set_bitmap_mode(canvas, 0); canvas_set_color(canvas, ColorWhite); } @@ -62,7 +62,7 @@ static void hid_mouse_draw_callback(Canvas* canvas, void* context) { // Down if(model->down_pressed) { canvas_set_bitmap_mode(canvas, 1); - canvas_draw_icon(canvas, 68, 36, &I_S_DOWN); + canvas_draw_icon(canvas, 68, 36, &I_S_DOWN_31x15); canvas_set_bitmap_mode(canvas, 0); canvas_set_color(canvas, ColorWhite); } @@ -72,7 +72,7 @@ static void hid_mouse_draw_callback(Canvas* canvas, void* context) { // Left if(model->left_pressed) { canvas_set_bitmap_mode(canvas, 1); - canvas_draw_icon(canvas, 61, 13, &I_S_LEFT); + canvas_draw_icon(canvas, 61, 13, &I_S_LEFT_15x31); canvas_set_bitmap_mode(canvas, 0); canvas_set_color(canvas, ColorWhite); } @@ -82,7 +82,7 @@ static void hid_mouse_draw_callback(Canvas* canvas, void* context) { // Right if(model->right_pressed) { canvas_set_bitmap_mode(canvas, 1); - canvas_draw_icon(canvas, 91, 13, &I_S_RIGHT); + canvas_draw_icon(canvas, 91, 13, &I_S_RIGHT_15x31); canvas_set_bitmap_mode(canvas, 0); canvas_set_color(canvas, ColorWhite); } diff --git a/applications/external/hid_app/views/hid_tikshorts.c b/applications/external/hid_app/views/hid_tikshorts.c index b494245cf..78e7488f3 100644 --- a/applications/external/hid_app/views/hid_tikshorts.c +++ b/applications/external/hid_app/views/hid_tikshorts.c @@ -40,7 +40,7 @@ static void hid_tikshorts_draw_callback(Canvas* canvas, void* context) { canvas_set_font(canvas, FontSecondary); // Keypad circles - canvas_draw_icon(canvas, 58, 3, &I_OutCircles); + canvas_draw_icon(canvas, 58, 3, &I_OutCircles_70x51); // Pause if(model->back_mouse_pressed) { @@ -55,7 +55,7 @@ static void hid_tikshorts_draw_callback(Canvas* canvas, void* context) { // Up if(model->up_pressed) { canvas_set_bitmap_mode(canvas, 1); - canvas_draw_icon(canvas, 68, 6, &I_S_UP); + canvas_draw_icon(canvas, 68, 6, &I_S_UP_31x15); canvas_set_bitmap_mode(canvas, 0); canvas_set_color(canvas, ColorWhite); } @@ -65,7 +65,7 @@ static void hid_tikshorts_draw_callback(Canvas* canvas, void* context) { // Down if(model->down_pressed) { canvas_set_bitmap_mode(canvas, 1); - canvas_draw_icon(canvas, 68, 36, &I_S_DOWN); + canvas_draw_icon(canvas, 68, 36, &I_S_DOWN_31x15); canvas_set_bitmap_mode(canvas, 0); canvas_set_color(canvas, ColorWhite); } @@ -75,7 +75,7 @@ static void hid_tikshorts_draw_callback(Canvas* canvas, void* context) { // Left if(model->left_pressed) { canvas_set_bitmap_mode(canvas, 1); - canvas_draw_icon(canvas, 61, 13, &I_S_LEFT); + canvas_draw_icon(canvas, 61, 13, &I_S_LEFT_15x31); canvas_set_bitmap_mode(canvas, 0); canvas_set_color(canvas, ColorWhite); } @@ -85,7 +85,7 @@ static void hid_tikshorts_draw_callback(Canvas* canvas, void* context) { // Right if(model->right_pressed) { canvas_set_bitmap_mode(canvas, 1); - canvas_draw_icon(canvas, 91, 13, &I_S_RIGHT); + canvas_draw_icon(canvas, 91, 13, &I_S_RIGHT_15x31); canvas_set_bitmap_mode(canvas, 0); canvas_set_color(canvas, ColorWhite); } diff --git a/applications/external/spectrum_analyzer/spectrum_analyzer.c b/applications/external/spectrum_analyzer/spectrum_analyzer.c index fd31a6935..bbecad642 100644 --- a/applications/external/spectrum_analyzer/spectrum_analyzer.c +++ b/applications/external/spectrum_analyzer/spectrum_analyzer.c @@ -11,7 +11,7 @@ #include "spectrum_analyzer_worker.h" typedef struct { - uint16_t center_freq; + uint32_t center_freq; uint8_t width; uint8_t band; uint8_t vscroll; @@ -53,39 +53,55 @@ void spectrum_analyzer_draw_scale(Canvas* canvas, const SpectrumAnalyzerModel* m } // Draw scale tags - uint16_t tag_left; - uint16_t tag_center; - uint16_t tag_right; + uint32_t tag_left = 0; + uint32_t tag_center = 0; + uint32_t tag_right = 0; char temp_str[18]; tag_center = model->center_freq; switch(model->width) { case NARROW: - tag_left = model->center_freq - 2; - tag_right = model->center_freq + 2; + tag_left = model->center_freq - 2000; + tag_right = model->center_freq + 2000; break; case ULTRANARROW: - tag_left = model->center_freq - 1; - tag_right = model->center_freq + 1; + tag_left = model->center_freq - 1000; + tag_right = model->center_freq + 1000; + break; + case PRECISE: + tag_left = model->center_freq - 200; + tag_right = model->center_freq + 200; break; case ULTRAWIDE: - tag_left = model->center_freq - 40; - tag_right = model->center_freq + 40; + tag_left = model->center_freq - 40000; + tag_right = model->center_freq + 40000; break; default: - tag_left = model->center_freq - 10; - tag_right = model->center_freq + 10; + tag_left = model->center_freq - 10000; + tag_right = model->center_freq + 10000; } canvas_set_font(canvas, FontSecondary); - snprintf(temp_str, 18, "%u", tag_left); - canvas_draw_str_aligned(canvas, FREQ_START_X, 63, AlignCenter, AlignBottom, temp_str); - snprintf(temp_str, 18, "%u", tag_center); - canvas_draw_str_aligned(canvas, 128 / 2, 63, AlignCenter, AlignBottom, temp_str); - snprintf(temp_str, 18, "%u", tag_right); - canvas_draw_str_aligned( - canvas, FREQ_START_X + FREQ_LENGTH_X - 1, 63, AlignCenter, AlignBottom, temp_str); + switch(model->width) { + case PRECISE: + snprintf(temp_str, 18, "%.1f", ((double)tag_left) / 1000); + canvas_draw_str_aligned(canvas, FREQ_START_X, 63, AlignCenter, AlignBottom, temp_str); + snprintf(temp_str, 18, "%.1f", ((double)tag_center) / 1000); + canvas_draw_str_aligned(canvas, 128 / 2, 63, AlignCenter, AlignBottom, temp_str); + snprintf(temp_str, 18, "%.1f", ((double)tag_right) / 1000); + canvas_draw_str_aligned( + canvas, FREQ_START_X + FREQ_LENGTH_X - 1, 63, AlignCenter, AlignBottom, temp_str); + break; + default: + snprintf(temp_str, 18, "%lu", tag_left / 1000); + canvas_draw_str_aligned(canvas, FREQ_START_X, 63, AlignCenter, AlignBottom, temp_str); + snprintf(temp_str, 18, "%lu", tag_center / 1000); + canvas_draw_str_aligned(canvas, 128 / 2, 63, AlignCenter, AlignBottom, temp_str); + snprintf(temp_str, 18, "%lu", tag_right / 1000); + canvas_draw_str_aligned( + canvas, FREQ_START_X + FREQ_LENGTH_X - 1, 63, AlignCenter, AlignBottom, temp_str); + } } static void spectrum_analyzer_render_callback(Canvas* const canvas, void* ctx) { @@ -115,6 +131,9 @@ static void spectrum_analyzer_render_callback(Canvas* const canvas, void* ctx) { case ULTRANARROW: strncpy(temp_mode_str, "ULTRANARROW", 12); break; + case PRECISE: + strncpy(temp_mode_str, "PRECISE", 12); + break; case ULTRAWIDE: strncpy(temp_mode_str, "ULTRAWIDE", 12); break; @@ -207,12 +226,12 @@ void spectrum_analyzer_calculate_frequencies(SpectrumAnalyzerModel* model) { uint8_t new_band; uint32_t min_hz; uint32_t max_hz; - uint8_t margin; - uint8_t step; - uint16_t upper_limit; - uint16_t lower_limit; - uint16_t next_up; - uint16_t next_down; + uint32_t margin; + uint32_t step; + uint32_t upper_limit; + uint32_t lower_limit; + uint32_t next_up; + uint32_t next_down; uint8_t next_band_up; uint8_t next_band_down; @@ -227,19 +246,24 @@ void spectrum_analyzer_calculate_frequencies(SpectrumAnalyzerModel* model) { step = ULTRANARROW_STEP; model->spacing = ULTRANARROW_SPACING; break; + case PRECISE: + margin = PRECISE_MARGIN; + step = PRECISE_STEP; + model->spacing = PRECISE_SPACING; + break; case ULTRAWIDE: margin = ULTRAWIDE_MARGIN; step = ULTRAWIDE_STEP; model->spacing = ULTRAWIDE_SPACING; /* nearest 20 MHz step */ - model->center_freq = ((model->center_freq + 10) / 20) * 20; + model->center_freq = ((model->center_freq + 10000) / 20000) * 20000; break; default: margin = WIDE_MARGIN; step = WIDE_STEP; model->spacing = WIDE_SPACING; /* nearest 5 MHz step */ - model->center_freq = ((model->center_freq + 2) / 5) * 5; + model->center_freq = ((model->center_freq + 2000) / 5000) * 5000; break; } @@ -288,21 +312,21 @@ void spectrum_analyzer_calculate_frequencies(SpectrumAnalyzerModel* model) { /* doing everything in Hz from here on */ switch(model->band) { case BAND_400: - min_hz = MIN_400 * 1000000; - max_hz = MAX_400 * 1000000; + min_hz = MIN_400 * 1000; + max_hz = MAX_400 * 1000; break; case BAND_300: - min_hz = MIN_300 * 1000000; - max_hz = MAX_300 * 1000000; + min_hz = MIN_300 * 1000; + max_hz = MAX_300 * 1000; break; default: - min_hz = MIN_900 * 1000000; - max_hz = MAX_900 * 1000000; + min_hz = MIN_900 * 1000; + max_hz = MAX_900 * 1000; break; } model->channel0_frequency = - model->center_freq * 1000000 - (model->spacing * ((NUM_CHANNELS / 2) + 1)); + model->center_freq * 1000 - (model->spacing * ((NUM_CHANNELS / 2) + 1)); // /* calibrate upper channels */ // hz = model->center_freq * 1000000; @@ -328,7 +352,7 @@ void spectrum_analyzer_calculate_frequencies(SpectrumAnalyzerModel* model) { model->max_rssi_dec = 0; 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", "center_freq: %lu", model->center_freq); FURI_LOG_D( "Spectrum", "ch[0]: %lu - ch[%u]: %lu", @@ -425,7 +449,7 @@ int32_t spectrum_analyzer_app(void* p) { SpectrumAnalyzerModel* model = spectrum_analyzer->model; uint8_t vstep = VERTICAL_SHORT_STEP; - uint8_t hstep; + uint32_t hstep; bool exit_loop = false; @@ -455,7 +479,7 @@ int32_t spectrum_analyzer_app(void* p) { break; case InputKeyRight: model->center_freq += hstep; - FURI_LOG_D("Spectrum", "center_freq: %u", model->center_freq); + FURI_LOG_D("Spectrum", "center_freq: %lu", model->center_freq); spectrum_analyzer_calculate_frequencies(model); spectrum_analyzer_worker_set_frequencies( spectrum_analyzer->worker, model->channel0_frequency, model->spacing, model->width); @@ -465,7 +489,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: %u", model->center_freq); + FURI_LOG_D("Spectrum", "center_freq: %lu", model->center_freq); break; case InputKeyOk: { switch(model->width) { @@ -476,6 +500,9 @@ int32_t spectrum_analyzer_app(void* p) { model->width = ULTRANARROW; break; case ULTRANARROW: + model->width = PRECISE; + break; + case PRECISE: model->width = ULTRAWIDE; break; case ULTRAWIDE: diff --git a/applications/external/spectrum_analyzer/spectrum_analyzer.h b/applications/external/spectrum_analyzer/spectrum_analyzer.h index b5cd6d8fe..7595f625c 100644 --- a/applications/external/spectrum_analyzer/spectrum_analyzer.h +++ b/applications/external/spectrum_analyzer/spectrum_analyzer.h @@ -15,17 +15,20 @@ * wide mode (default): 20 MHz on screen, 196 kHz per channel * narrow mode: 4 MHz on screen, 39 kHz per channel * ultranarrow mode: 2 MHz on screen, 19 kHz per channel + * pricse mode: 400 KHz on screen, 3.92 kHz per channel */ #define WIDE 0 #define NARROW 1 #define ULTRAWIDE 2 #define ULTRANARROW 3 +#define PRECISE 4 /* channel spacing in Hz */ #define WIDE_SPACING 196078 #define NARROW_SPACING 39215 #define ULTRAWIDE_SPACING 784313 #define ULTRANARROW_SPACING 19607 +#define PRECISE_SPACING 3921 /* vertical scrolling */ #define VERTICAL_SHORT_STEP 16 @@ -33,36 +36,40 @@ #define MIN_VSCROLL 0 #define DEFAULT_VSCROLL 48 -/* frequencies in MHz */ -#define DEFAULT_FREQ 440 -#define WIDE_STEP 5 -#define NARROW_STEP 1 -#define ULTRAWIDE_STEP 20 -#define ULTRANARROW_STEP 1 -#define WIDE_MARGIN 13 -#define NARROW_MARGIN 3 -#define ULTRAWIDE_MARGIN 42 -#define ULTRANARROW_MARGIN 1 +/* frequencies in KHz */ +#define DEFAULT_FREQ 440000 +#define WIDE_STEP 5000 +#define NARROW_STEP 1000 +#define ULTRAWIDE_STEP 20000 +#define ULTRANARROW_STEP 500 +#define PRECISE_STEP 100 + +/* margin in KHz */ +#define WIDE_MARGIN 13000 +#define NARROW_MARGIN 3000 +#define ULTRAWIDE_MARGIN 42000 +#define ULTRANARROW_MARGIN 1000 +#define PRECISE_MARGIN 200 /* frequency bands supported by device */ #define BAND_300 0 #define BAND_400 1 #define BAND_900 2 -/* band limits in MHz */ -#define MIN_300 281 -#define CEN_300 315 -#define MAX_300 361 -#define MIN_400 378 -#define CEN_400 435 -#define MAX_400 481 -#define MIN_900 749 -#define CEN_900 855 -#define MAX_900 962 +/* band limits in KHz */ +#define MIN_300 281000 +#define CEN_300 315000 +#define MAX_300 361000 +#define MIN_400 378000 +#define CEN_400 435000 +#define MAX_400 481000 +#define MIN_900 749000 +#define CEN_900 855000 +#define MAX_900 962000 -/* band transition points in MHz */ -#define EDGE_400 369 -#define EDGE_900 615 +/* band transition points in KHz */ +#define EDGE_400 369000 +#define EDGE_900 615000 /* VCO transition points in Hz */ #define MID_300 318000000 diff --git a/lib/flipper_application/application_assets.c b/lib/flipper_application/application_assets.c index 1262870d5..083c3ca19 100644 --- a/lib/flipper_application/application_assets.c +++ b/lib/flipper_application/application_assets.c @@ -157,14 +157,6 @@ static bool flipper_application_assets_process_dirs( FuriString* full_path = flipper_application_assets_alloc_app_full_path(app_name); do { - if(!storage_simply_mkdir(storage, APPS_ASSETS_PATH)) { - break; - } - - if(!storage_simply_mkdir(storage, furi_string_get_cstr(full_path))) { - break; - } - FuriString* dir_path = furi_string_alloc(); char* path = NULL; @@ -279,6 +271,8 @@ bool flipper_application_assets_load(File* file, const char* elf_path, size_t of FURI_LOG_D(TAG, "Loading assets for %s", furi_string_get_cstr(app_name)); + FuriString* full_path = flipper_application_assets_alloc_app_full_path(app_name); + do { if(!storage_file_seek(file, offset, true)) { break; @@ -319,13 +313,23 @@ bool flipper_application_assets_load(File* file, const char* elf_path, size_t of FURI_LOG_D(TAG, "Assets removed"); } + if(!storage_simply_mkdir(storage, APPS_ASSETS_PATH)) { + break; + } + + if(!storage_simply_mkdir(storage, furi_string_get_cstr(full_path))) { + break; + } + // process directories - if(!flipper_application_assets_process_dirs(storage, file, app_name, header.dirs_count)) { + if(header.dirs_count && + !flipper_application_assets_process_dirs(storage, file, app_name, header.dirs_count)) { break; } // process files - if(!flipper_application_assets_process_files(storage, file, app_name, header.files_count)) { + if(header.files_count && !flipper_application_assets_process_files( + storage, file, app_name, header.files_count)) { break; } @@ -353,6 +357,7 @@ bool flipper_application_assets_load(File* file, const char* elf_path, size_t of } furi_record_close(RECORD_STORAGE); + furi_string_free(full_path); furi_string_free(app_name); FURI_LOG_D(TAG, "Assets loading %s", result ? "success" : "failed");