uint8_t ao_force_freq;
#endif
+#ifndef HAS_CONFIG_SAVE
+#define HAS_CONFIG_SAVE HAS_EEPROM
+#endif
+
#ifndef AO_CONFIG_DEFAULT_APRS_INTERVAL
#define AO_CONFIG_DEFAULT_APRS_INTERVAL 0
#endif
#define AO_CONFIG_DEFAULT_IGNITE_MODE AO_IGNITE_MODE_DUAL
#define AO_CONFIG_DEFAULT_PAD_ORIENTATION AO_PAD_ORIENTATION_ANTENNA_UP
#define AO_CONFIG_DEFAULT_PYRO_TIME AO_MS_TO_TICKS(50)
-#if HAS_EEPROM
+#if HAS_CONFIG_SAVE
#ifndef USE_INTERNAL_FLASH
#error Please define USE_INTERNAL_FLASH
#endif
#define AO_CONFIG_DEFAULT_APRS_SSID (ao_serial_number % 10)
#define AO_CONFIG_DEFAULT_RADIO_RATE AO_RADIO_RATE_38400
-#if HAS_EEPROM
+#if HAS_CONFIG_SAVE
static void
_ao_config_put(void)
{
if (ao_config_loaded)
return;
-#if HAS_EEPROM
+#if HAS_CONFIG_SAVE
/* Yes, I know ao_storage_read calls ao_storage_setup,
* but ao_storage_setup *also* sets ao_storage_config, which we
* need before calling ao_storage_read here
#endif
}
-#if FLIGHT_LOG_APPEND
+#if FLIGHT_LOG_APPEND && HAS_CONFIG_SAVE
void
ao_config_log_fix_append(void)
{
printf("Pad orientation: %d\n", ao_config.pad_orientation);
}
-#ifndef AO_ACCEL_INVERT
-#define AO_ACCEL_INVERT 0x7fff
-#endif
-
static void
ao_config_pad_orientation_set(void)
{
return;
_ao_config_edit_start();
if (ao_config.pad_orientation != r) {
- int16_t t;
+ accel_t t;
t = ao_config.accel_plus_g;
- ao_config.accel_plus_g = AO_ACCEL_INVERT - ao_config.accel_minus_g;
- ao_config.accel_minus_g = AO_ACCEL_INVERT - t;
+ ao_config.accel_plus_g = ao_data_accel_invert(ao_config.accel_minus_g);
+ ao_config.accel_minus_g = ao_data_accel_invert(t);
}
ao_config.pad_orientation = r;
_ao_config_edit_finish();
static void
ao_config_show(void);
-#if HAS_EEPROM
+#if HAS_CONFIG_SAVE
static void
ao_config_save(void);
#endif
#endif
{ "s\0Show",
ao_config_show, 0 },
-#if HAS_EEPROM
+#if HAS_CONFIG_SAVE
{ "w\0Write to eeprom",
ao_config_save, 0 },
#endif
#endif
}
-#if HAS_EEPROM
+#if HAS_CONFIG_SAVE
static void
ao_config_save(void)
{