SubGhz: add some consts and fix unit tests

This commit is contained in:
gid9798
2023-07-03 14:02:57 +03:00
parent 01d7beef4e
commit 2ef07a7a6c
12 changed files with 29 additions and 40 deletions

View File

@@ -61,8 +61,7 @@ void subghz_cli_command_tx_carrier(Cli* cli, FuriString* args, void* context) {
}
furi_hal_subghz_reset();
furi_hal_subghz_load_custom_preset(
(uint8_t*)subghz_device_cc1101_preset_ook_650khz_async_regs);
furi_hal_subghz_load_custom_preset(subghz_device_cc1101_preset_ook_650khz_async_regs);
frequency = furi_hal_subghz_set_frequency_and_path(frequency);
furi_hal_gpio_init(&gpio_cc1101_g0, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
@@ -106,8 +105,7 @@ void subghz_cli_command_rx_carrier(Cli* cli, FuriString* args, void* context) {
}
furi_hal_subghz_reset();
furi_hal_subghz_load_custom_preset(
(uint8_t*)subghz_device_cc1101_preset_ook_650khz_async_regs);
furi_hal_subghz_load_custom_preset(subghz_device_cc1101_preset_ook_650khz_async_regs);
frequency = furi_hal_subghz_set_frequency_and_path(frequency);
printf("Receiving at frequency %lu Hz\r\n", frequency);
printf("Press CTRL+C to stop\r\n");
@@ -403,8 +401,7 @@ void subghz_cli_command_rx_raw(Cli* cli, FuriString* args, void* context) {
// Configure radio
furi_hal_subghz_reset();
furi_hal_subghz_load_custom_preset(
(uint8_t*)subghz_device_cc1101_preset_ook_650khz_async_regs);
furi_hal_subghz_load_custom_preset(subghz_device_cc1101_preset_ook_650khz_async_regs);
frequency = furi_hal_subghz_set_frequency_and_path(frequency);
furi_hal_gpio_init(&gpio_cc1101_g0, GpioModeInput, GpioPullNo, GpioSpeedLow);

View File

@@ -141,8 +141,7 @@ void subghz_test_carrier_enter(void* context) {
SubGhzTestCarrier* subghz_test_carrier = context;
furi_hal_subghz_reset();
furi_hal_subghz_load_custom_preset(
(uint8_t*)subghz_device_cc1101_preset_ook_650khz_async_regs);
furi_hal_subghz_load_custom_preset(subghz_device_cc1101_preset_ook_650khz_async_regs);
furi_hal_gpio_init(&gpio_cc1101_g0, GpioModeInput, GpioPullNo, GpioSpeedLow);

View File

@@ -195,8 +195,7 @@ void subghz_test_packet_enter(void* context) {
SubGhzTestPacket* instance = context;
furi_hal_subghz_reset();
furi_hal_subghz_load_custom_preset(
(uint8_t*)subghz_device_cc1101_preset_ook_650khz_async_regs);
furi_hal_subghz_load_custom_preset(subghz_device_cc1101_preset_ook_650khz_async_regs);
with_view_model(
instance->view,

View File

@@ -144,8 +144,7 @@ void subghz_test_static_enter(void* context) {
SubGhzTestStatic* instance = context;
furi_hal_subghz_reset();
furi_hal_subghz_load_custom_preset(
(uint8_t*)subghz_device_cc1101_preset_ook_650khz_async_regs);
furi_hal_subghz_load_custom_preset(subghz_device_cc1101_preset_ook_650khz_async_regs);
furi_hal_gpio_init(&gpio_cc1101_g0, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
furi_hal_gpio_write(&gpio_cc1101_g0, false);