diff --git a/config.c b/config.c index 82185c5..3d271fa 100644 --- a/config.c +++ b/config.c @@ -55,6 +55,12 @@ unsigned char config_getParam(unsigned char param, unsigned char *value, unsigne *value = g_eeprom_data.cfg.poll_interval[3]; return 1; #endif + case CFG_PARAM_INVERT_TRIG: + *value = (g_eeprom_data.cfg.flags & FLAG_GC_INVERT_TRIGS) ? 1 : 0; + return 1; + case CFG_PARAM_FULL_SLIDERS: + *value = (g_eeprom_data.cfg.flags & FLAG_GC_FULL_SLIDERS) ? 1 : 0; + return 1; } return 0; @@ -91,6 +97,20 @@ unsigned char config_setParam(unsigned char param, const unsigned char *value) g_eeprom_data.cfg.poll_interval[3] = value[0]; break; #endif + case CFG_PARAM_FULL_SLIDERS: + if (value[0]) { + g_eeprom_data.cfg.flags |= FLAG_GC_FULL_SLIDERS; + } else { + g_eeprom_data.cfg.flags &= ~FLAG_GC_FULL_SLIDERS; + } + break; + case CFG_PARAM_INVERT_TRIG: + if (value[0]) { + g_eeprom_data.cfg.flags |= FLAG_GC_INVERT_TRIGS; + } else { + g_eeprom_data.cfg.flags &= ~FLAG_GC_INVERT_TRIGS; + } + break; default: return 0; } diff --git a/config.h b/config.h index 03ede3d..81b2c2d 100644 --- a/config.h +++ b/config.h @@ -7,8 +7,12 @@ struct eeprom_cfg { uint8_t serial[SERIAL_NUM_LEN]; uint8_t mode; uint8_t poll_interval[NUM_CHANNELS]; + uint32_t flags; }; +#define FLAG_GC_FULL_SLIDERS 1 +#define FLAG_GC_INVERT_TRIGS 2 + void eeprom_app_write_defaults(void); void eeprom_app_ready(void);