From 9b62b557b442ab88206b8b44253c1dcbac35c4e3 Mon Sep 17 00:00:00 2001 From: Skorpionm <85568270+Skorpionm@users.noreply.github.com> Date: Wed, 22 Dec 2021 23:35:53 +0400 Subject: [PATCH] SubGhz: fix transmission frequency (#922) --- .../subghz/scenes/subghz_scene_more_raw.c | 2 +- .../subghz/scenes/subghz_scene_saved_menu.c | 2 +- .../targets/f6/furi-hal/furi-hal-subghz.c | 60 ------------------- .../targets/f7/furi-hal/furi-hal-subghz.c | 60 ------------------- 4 files changed, 2 insertions(+), 122 deletions(-) diff --git a/applications/subghz/scenes/subghz_scene_more_raw.c b/applications/subghz/scenes/subghz_scene_more_raw.c index c8fde230..10e0aad4 100644 --- a/applications/subghz/scenes/subghz_scene_more_raw.c +++ b/applications/subghz/scenes/subghz_scene_more_raw.c @@ -15,7 +15,7 @@ void subghz_scene_more_raw_on_enter(void* context) { submenu_add_item( subghz->submenu, - "Edit name", + "Rename", SubmenuIndexEdit, subghz_scene_more_raw_submenu_callback, subghz); diff --git a/applications/subghz/scenes/subghz_scene_saved_menu.c b/applications/subghz/scenes/subghz_scene_saved_menu.c index a25f8e6f..c6623c6b 100644 --- a/applications/subghz/scenes/subghz_scene_saved_menu.c +++ b/applications/subghz/scenes/subghz_scene_saved_menu.c @@ -22,7 +22,7 @@ void subghz_scene_saved_menu_on_enter(void* context) { submenu_add_item( subghz->submenu, - "Edit name", + "Rename", SubmenuIndexEdit, subghz_scene_saved_menu_submenu_callback, subghz); diff --git a/firmware/targets/f6/furi-hal/furi-hal-subghz.c b/firmware/targets/f6/furi-hal/furi-hal-subghz.c index a493eb49..b54b4845 100644 --- a/firmware/targets/f6/furi-hal/furi-hal-subghz.c +++ b/firmware/targets/f6/furi-hal/furi-hal-subghz.c @@ -60,17 +60,6 @@ static const uint8_t furi_hal_subghz_preset_ook_270khz_async_regs[][2] = { {CC1101_FREND0, 0x11}, // Adjusts current TX LO buffer + high is PATABLE[1] {CC1101_FREND1, 0xB6}, // - /* Frequency Synthesizer Calibration, valid for 433.92 */ - {CC1101_FSCAL3, 0xE9}, - {CC1101_FSCAL2, 0x2A}, - {CC1101_FSCAL1, 0x00}, - {CC1101_FSCAL0, 0x1F}, - - /* Magic f4ckery */ - {CC1101_TEST2, 0x81}, // FIFOTHR ADC_RETENTION=1 matched value - {CC1101_TEST1, 0x35}, // FIFOTHR ADC_RETENTION=1 matched value - {CC1101_TEST0, 0x09}, // VCO selection calibration stage is disabled - /* End */ {0, 0}, }; @@ -122,17 +111,6 @@ static const uint8_t furi_hal_subghz_preset_ook_650khz_async_regs[][2] = { {CC1101_FREND0, 0x11}, // Adjusts current TX LO buffer + high is PATABLE[1] {CC1101_FREND1, 0xB6}, // - /* Frequency Synthesizer Calibration, valid for 433.92 */ - {CC1101_FSCAL3, 0xE9}, - {CC1101_FSCAL2, 0x2A}, - {CC1101_FSCAL1, 0x00}, - {CC1101_FSCAL0, 0x1F}, - - /* Magic f4ckery */ - {CC1101_TEST2, 0x88}, - {CC1101_TEST1, 0x31}, - {CC1101_TEST0, 0x09}, // VCO selection calibration stage is disabled - /* End */ {0, 0}, }; @@ -177,17 +155,6 @@ static const uint8_t furi_hal_subghz_preset_2fsk_dev2_38khz_async_regs[][2] = { {CC1101_FREND0, 0x10}, // Adjusts current TX LO buffer {CC1101_FREND1, 0x56}, - /* Frequency Synthesizer Calibration, valid for 433.92 */ - {CC1101_FSCAL3, 0xE9}, - {CC1101_FSCAL2, 0x2A}, - {CC1101_FSCAL1, 0x00}, - {CC1101_FSCAL0, 0x1F}, - - /* Magic f4ckery */ - {CC1101_TEST2, 0x81}, // FIFOTHR ADC_RETENTION=1 matched value - {CC1101_TEST1, 0x35}, // FIFOTHR ADC_RETENTION=1 matched value - {CC1101_TEST0, 0x09}, // VCO selection calibration stage is disabled - /* End */ {0, 0}, }; @@ -232,17 +199,6 @@ static const uint8_t furi_hal_subghz_preset_2fsk_dev4_76khz_async_regs[][2] = { {CC1101_FREND0, 0x10}, // Adjusts current TX LO buffer {CC1101_FREND1, 0x56}, - /* Frequency Synthesizer Calibration, valid for 433.92 */ - {CC1101_FSCAL3, 0xE9}, - {CC1101_FSCAL2, 0x2A}, - {CC1101_FSCAL1, 0x00}, - {CC1101_FSCAL0, 0x1F}, - - /* Magic f4ckery */ - {CC1101_TEST2, 0x81}, // FIFOTHR ADC_RETENTION=1 matched value - {CC1101_TEST1, 0x35}, // FIFOTHR ADC_RETENTION=1 matched value - {CC1101_TEST0, 0x09}, // VCO selection calibration stage is disabled - /* End */ {0, 0}, }; @@ -279,17 +235,9 @@ static const uint8_t furi_hal_subghz_preset_msk_99_97kb_async_regs[][2] = { {CC1101_FREND0, 0x10}, {CC1101_FREND1, 0x56}, - {CC1101_FSCAL3, 0xE9}, - {CC1101_FSCAL2, 0x2A}, - {CC1101_FSCAL1, 0x00}, - {CC1101_FSCAL0, 0x1F}, - {CC1101_BSCFG, 0x1C}, {CC1101_FSTEST, 0x59}, - {CC1101_TEST2, 0x81}, - {CC1101_TEST1, 0x35}, - {CC1101_TEST0, 0x09}, /* End */ {0, 0}, }; @@ -322,13 +270,6 @@ static const uint8_t furi_hal_subghz_preset_gfsk_9_99kb_async_regs[][2] = { {CC1101_AGCCTRL0, 0x91}, {CC1101_WORCTRL, 0xFB}, //Wake On Radio Control - {CC1101_FSCAL3, 0xE9}, //Frequency Synthesizer Calibration - {CC1101_FSCAL2, 0x2A}, //Frequency Synthesizer Calibration - {CC1101_FSCAL1, 0x00}, //Frequency Synthesizer Calibration - {CC1101_FSCAL0, 0x1F}, //Frequency Synthesizer Calibration - {CC1101_TEST2, 0x81}, //Various Test Settings - {CC1101_TEST1, 0x35}, //Various Test Settings - {CC1101_TEST0, 0x09}, //Various Test Settings /* End */ {0, 0}, }; @@ -687,7 +628,6 @@ uint32_t furi_hal_subghz_set_frequency(uint32_t value) { } furi_hal_spi_release(&furi_hal_spi_bus_handle_subghz); - return real_frequency; } diff --git a/firmware/targets/f7/furi-hal/furi-hal-subghz.c b/firmware/targets/f7/furi-hal/furi-hal-subghz.c index a493eb49..b54b4845 100644 --- a/firmware/targets/f7/furi-hal/furi-hal-subghz.c +++ b/firmware/targets/f7/furi-hal/furi-hal-subghz.c @@ -60,17 +60,6 @@ static const uint8_t furi_hal_subghz_preset_ook_270khz_async_regs[][2] = { {CC1101_FREND0, 0x11}, // Adjusts current TX LO buffer + high is PATABLE[1] {CC1101_FREND1, 0xB6}, // - /* Frequency Synthesizer Calibration, valid for 433.92 */ - {CC1101_FSCAL3, 0xE9}, - {CC1101_FSCAL2, 0x2A}, - {CC1101_FSCAL1, 0x00}, - {CC1101_FSCAL0, 0x1F}, - - /* Magic f4ckery */ - {CC1101_TEST2, 0x81}, // FIFOTHR ADC_RETENTION=1 matched value - {CC1101_TEST1, 0x35}, // FIFOTHR ADC_RETENTION=1 matched value - {CC1101_TEST0, 0x09}, // VCO selection calibration stage is disabled - /* End */ {0, 0}, }; @@ -122,17 +111,6 @@ static const uint8_t furi_hal_subghz_preset_ook_650khz_async_regs[][2] = { {CC1101_FREND0, 0x11}, // Adjusts current TX LO buffer + high is PATABLE[1] {CC1101_FREND1, 0xB6}, // - /* Frequency Synthesizer Calibration, valid for 433.92 */ - {CC1101_FSCAL3, 0xE9}, - {CC1101_FSCAL2, 0x2A}, - {CC1101_FSCAL1, 0x00}, - {CC1101_FSCAL0, 0x1F}, - - /* Magic f4ckery */ - {CC1101_TEST2, 0x88}, - {CC1101_TEST1, 0x31}, - {CC1101_TEST0, 0x09}, // VCO selection calibration stage is disabled - /* End */ {0, 0}, }; @@ -177,17 +155,6 @@ static const uint8_t furi_hal_subghz_preset_2fsk_dev2_38khz_async_regs[][2] = { {CC1101_FREND0, 0x10}, // Adjusts current TX LO buffer {CC1101_FREND1, 0x56}, - /* Frequency Synthesizer Calibration, valid for 433.92 */ - {CC1101_FSCAL3, 0xE9}, - {CC1101_FSCAL2, 0x2A}, - {CC1101_FSCAL1, 0x00}, - {CC1101_FSCAL0, 0x1F}, - - /* Magic f4ckery */ - {CC1101_TEST2, 0x81}, // FIFOTHR ADC_RETENTION=1 matched value - {CC1101_TEST1, 0x35}, // FIFOTHR ADC_RETENTION=1 matched value - {CC1101_TEST0, 0x09}, // VCO selection calibration stage is disabled - /* End */ {0, 0}, }; @@ -232,17 +199,6 @@ static const uint8_t furi_hal_subghz_preset_2fsk_dev4_76khz_async_regs[][2] = { {CC1101_FREND0, 0x10}, // Adjusts current TX LO buffer {CC1101_FREND1, 0x56}, - /* Frequency Synthesizer Calibration, valid for 433.92 */ - {CC1101_FSCAL3, 0xE9}, - {CC1101_FSCAL2, 0x2A}, - {CC1101_FSCAL1, 0x00}, - {CC1101_FSCAL0, 0x1F}, - - /* Magic f4ckery */ - {CC1101_TEST2, 0x81}, // FIFOTHR ADC_RETENTION=1 matched value - {CC1101_TEST1, 0x35}, // FIFOTHR ADC_RETENTION=1 matched value - {CC1101_TEST0, 0x09}, // VCO selection calibration stage is disabled - /* End */ {0, 0}, }; @@ -279,17 +235,9 @@ static const uint8_t furi_hal_subghz_preset_msk_99_97kb_async_regs[][2] = { {CC1101_FREND0, 0x10}, {CC1101_FREND1, 0x56}, - {CC1101_FSCAL3, 0xE9}, - {CC1101_FSCAL2, 0x2A}, - {CC1101_FSCAL1, 0x00}, - {CC1101_FSCAL0, 0x1F}, - {CC1101_BSCFG, 0x1C}, {CC1101_FSTEST, 0x59}, - {CC1101_TEST2, 0x81}, - {CC1101_TEST1, 0x35}, - {CC1101_TEST0, 0x09}, /* End */ {0, 0}, }; @@ -322,13 +270,6 @@ static const uint8_t furi_hal_subghz_preset_gfsk_9_99kb_async_regs[][2] = { {CC1101_AGCCTRL0, 0x91}, {CC1101_WORCTRL, 0xFB}, //Wake On Radio Control - {CC1101_FSCAL3, 0xE9}, //Frequency Synthesizer Calibration - {CC1101_FSCAL2, 0x2A}, //Frequency Synthesizer Calibration - {CC1101_FSCAL1, 0x00}, //Frequency Synthesizer Calibration - {CC1101_FSCAL0, 0x1F}, //Frequency Synthesizer Calibration - {CC1101_TEST2, 0x81}, //Various Test Settings - {CC1101_TEST1, 0x35}, //Various Test Settings - {CC1101_TEST0, 0x09}, //Various Test Settings /* End */ {0, 0}, }; @@ -687,7 +628,6 @@ uint32_t furi_hal_subghz_set_frequency(uint32_t value) { } furi_hal_spi_release(&furi_hal_spi_bus_handle_subghz); - return real_frequency; }