diff --git a/radio/src/dataconstants.h b/radio/src/dataconstants.h index 79a740723..c619d800e 100644 --- a/radio/src/dataconstants.h +++ b/radio/src/dataconstants.h @@ -660,12 +660,14 @@ enum HatsMode { HATSMODE_GLOBAL }; +#if defined(STM32F2) || defined(STM32F4) enum UartSampleModes { UART_SAMPLE_MODE_NORMAL = 0, UART_SAMPLE_MODE_ONEBIT, UART_SAMPLE_MODE_MAX SKIP = UART_SAMPLE_MODE_ONEBIT }; +#endif // PXX2 constants #define PXX2_LEN_REGISTRATION_ID 8 diff --git a/radio/src/datastructs_private.h b/radio/src/datastructs_private.h index 3c9cd2951..c7aeb341d 100644 --- a/radio/src/datastructs_private.h +++ b/radio/src/datastructs_private.h @@ -1072,7 +1072,9 @@ PACK(struct RadioData { CUST_ATTR(rotEncDirection, r_rotEncDirection, nullptr); NOBACKUP(uint8_t rotEncMode:3); +#if defined(STM32F2) || defined(STM32F4) NOBACKUP(int8_t uartSampleMode:2); // See UartSampleModes +#endif #if defined(STICK_DEAD_ZONE) NOBACKUP(uint8_t stickDeadZone:3); diff --git a/radio/src/gui/colorlcd/radio/hw_extmodule.cpp b/radio/src/gui/colorlcd/radio/hw_extmodule.cpp index b5cc414e1..c44193e8f 100644 --- a/radio/src/gui/colorlcd/radio/hw_extmodule.cpp +++ b/radio/src/gui/colorlcd/radio/hw_extmodule.cpp @@ -25,6 +25,7 @@ #define SET_DIRTY() storageDirty(EE_GENERAL) +#if defined(STM32F4) ExternalModuleWindow::ExternalModuleWindow(Window *parent, FlexGridLayout& grid) { auto line = parent->newLine(grid); @@ -39,3 +40,4 @@ ExternalModuleWindow::ExternalModuleWindow(Window *parent, FlexGridLayout& grid) restartModule(EXTERNAL_MODULE); }); } +#endif diff --git a/radio/src/gui/colorlcd/radio/radio_hardware.cpp b/radio/src/gui/colorlcd/radio/radio_hardware.cpp index 27bb12569..0c924f6cc 100644 --- a/radio/src/gui/colorlcd/radio/radio_hardware.cpp +++ b/radio/src/gui/colorlcd/radio/radio_hardware.cpp @@ -172,7 +172,7 @@ void RadioHardwarePage::build(Window* window) new InternalModuleWindow(window, grid); #endif -#if defined(HARDWARE_EXTERNAL_MODULE) +#if defined(HARDWARE_EXTERNAL_MODULE) && defined(STM32F4) new Subtitle(window, STR_EXTERNALRF); new ExternalModuleWindow(window, grid); #endif diff --git a/radio/src/gui/common/stdlcd/radio_hardware.cpp b/radio/src/gui/common/stdlcd/radio_hardware.cpp index 7c602ee24..1a7f5dd9d 100644 --- a/radio/src/gui/common/stdlcd/radio_hardware.cpp +++ b/radio/src/gui/common/stdlcd/radio_hardware.cpp @@ -314,7 +314,7 @@ static void _init_menu_tab_array(uint8_t* tab, size_t len) memset((void*)&tab[ITEM_RADIO_HARDWARE_LABEL_INTERNAL_MODULE], HIDDEN_ROW, 3); #endif -#if defined(HARDWARE_EXTERNAL_MODULE) +#if defined(HARDWARE_EXTERNAL_MODULE) && (defined(STM32F2) || defined(STM32F4)) tab[ITEM_RADIO_HARDWARE_SERIAL_SAMPLE_MODE] = 0; #else tab[ITEM_RADIO_HARDWARE_SERIAL_SAMPLE_MODE] = HIDDEN_ROW; @@ -502,12 +502,14 @@ void menuRadioHardware(event_t event) } break; +#if defined(STM32F2) || defined(STM32F4) case ITEM_RADIO_HARDWARE_SERIAL_SAMPLE_MODE: g_eeGeneral.uartSampleMode = editChoice(HW_SETTINGS_COLUMN2, y, STR_SAMPLE_MODE, STR_SAMPLE_MODES, g_eeGeneral.uartSampleMode, 0, UART_SAMPLE_MODE_MAX, attr, event); if (attr && checkIncDec_Ret) { restartModule(EXTERNAL_MODULE); } break; +#endif #if defined(BLUETOOTH) case ITEM_RADIO_HARDWARE_BLUETOOTH_MODE: diff --git a/radio/src/hal/module_port.cpp b/radio/src/hal/module_port.cpp index 948054c52..81ce63cef 100644 --- a/radio/src/hal/module_port.cpp +++ b/radio/src/hal/module_port.cpp @@ -69,10 +69,12 @@ static bool _init_serial_driver(etx_module_driver_t* d, const etx_module_port_t* // S.PORT specific HW settings if (port->port == ETX_MOD_PORT_SPORT && params->baudrate >= 400000) { +#if defined(STM32F2) || defined(STM32F4) // one-bit if (g_eeGeneral.uartSampleMode == UART_SAMPLE_MODE_ONEBIT) { if (drv->setHWOption) drv->setHWOption(d->ctx, ETX_HWOption_ONEBIT); } +#endif } // setup polarity diff --git a/radio/src/storage/yaml/yaml_datastructs_pa01.cpp b/radio/src/storage/yaml/yaml_datastructs_pa01.cpp index ff953a026..4cf06b8c7 100644 --- a/radio/src/storage/yaml/yaml_datastructs_pa01.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_pa01.cpp @@ -407,7 +407,6 @@ static const struct YamlNode struct_RadioData[] = { YAML_STRING("ownerRegistrationID", 8), YAML_CUSTOM("rotEncDirection",r_rotEncDirection,nullptr), YAML_UNSIGNED( "rotEncMode", 3 ), - YAML_SIGNED( "uartSampleMode", 2 ), YAML_UNSIGNED( "stickDeadZone", 3 ), YAML_SIGNED( "imuMax", 8 ), YAML_SIGNED( "imuOffset", 8 ), diff --git a/radio/src/storage/yaml/yaml_datastructs_st16.cpp b/radio/src/storage/yaml/yaml_datastructs_st16.cpp index 01d8a3f61..3255a773f 100644 --- a/radio/src/storage/yaml/yaml_datastructs_st16.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_st16.cpp @@ -407,7 +407,6 @@ static const struct YamlNode struct_RadioData[] = { YAML_STRING("ownerRegistrationID", 8), YAML_CUSTOM("rotEncDirection",r_rotEncDirection,nullptr), YAML_UNSIGNED( "rotEncMode", 3 ), - YAML_SIGNED( "uartSampleMode", 2 ), YAML_UNSIGNED( "stickDeadZone", 3 ), YAML_SIGNED( "imuMax", 8 ), YAML_SIGNED( "imuOffset", 8 ), diff --git a/radio/src/storage/yaml/yaml_datastructs_t15pro.cpp b/radio/src/storage/yaml/yaml_datastructs_t15pro.cpp index 01d8a3f61..3255a773f 100644 --- a/radio/src/storage/yaml/yaml_datastructs_t15pro.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_t15pro.cpp @@ -407,7 +407,6 @@ static const struct YamlNode struct_RadioData[] = { YAML_STRING("ownerRegistrationID", 8), YAML_CUSTOM("rotEncDirection",r_rotEncDirection,nullptr), YAML_UNSIGNED( "rotEncMode", 3 ), - YAML_SIGNED( "uartSampleMode", 2 ), YAML_UNSIGNED( "stickDeadZone", 3 ), YAML_SIGNED( "imuMax", 8 ), YAML_SIGNED( "imuOffset", 8 ), diff --git a/radio/src/storage/yaml/yaml_datastructs_tx15.cpp b/radio/src/storage/yaml/yaml_datastructs_tx15.cpp index 01d8a3f61..3255a773f 100644 --- a/radio/src/storage/yaml/yaml_datastructs_tx15.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_tx15.cpp @@ -407,7 +407,6 @@ static const struct YamlNode struct_RadioData[] = { YAML_STRING("ownerRegistrationID", 8), YAML_CUSTOM("rotEncDirection",r_rotEncDirection,nullptr), YAML_UNSIGNED( "rotEncMode", 3 ), - YAML_SIGNED( "uartSampleMode", 2 ), YAML_UNSIGNED( "stickDeadZone", 3 ), YAML_SIGNED( "imuMax", 8 ), YAML_SIGNED( "imuOffset", 8 ),