feat(radio): refactor of switch handling to better support customisable switches (#6095)

Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
Co-authored-by: 3djc <3djc@gh.com>
Co-authored-by: elecpower <elecpower@users.noreply.github.com>
This commit is contained in:
philmoz
2025-07-28 12:59:22 +10:00
committed by GitHub
co-authored by philmoz 3djc elecpower
parent 28833f42e6
commit 0c8c39b134
155 changed files with 4538 additions and 2306 deletions
+5 -2
View File
@@ -181,6 +181,7 @@ const char * loadRadioSettings()
#endif
adcCalibDefaults();
generalDefaultSwitches();
const char* error = loadRadioSettingsYaml(true);
if (!error) {
@@ -191,8 +192,6 @@ const char * loadRadioSettings()
return error;
}
struct yaml_checksummer_ctx {
FRESULT result;
uint16_t checksum;
@@ -341,6 +340,10 @@ const char * readModelYaml(const char * filename, uint8_t * buffer, uint32_t siz
memset(buffer,0,size);
if (init_model) {
#if defined(FUNCTION_SWITCHES)
extern void initCustomSwitches();
initCustomSwitches();
#endif
auto md = reinterpret_cast<ModelData*>(buffer);
#if defined(FLIGHT_MODES) && defined(GVARS)
// reset GVars to default values