+#if HAS_EEPROM
+void
+ao_config_log_show(void) __reentrant
+{
+ printf("Max flight log: %d kB\n", (int16_t) (ao_config.flight_log_max >> 10));
+}
+
+void
+ao_config_log_set(void) __reentrant
+{
+ uint16_t block = (uint16_t) (ao_storage_block >> 10);
+ uint16_t config = (uint16_t) (ao_storage_config >> 10);
+
+ ao_cmd_decimal();
+ if (ao_cmd_status != ao_cmd_success)
+ return;
+ if (ao_log_present())
+ printf("Storage must be empty before changing log size\n");
+ else if (block > 1024 && (ao_cmd_lex_i & (block - 1)))
+ printf("Flight log size must be multiple of %d kB\n", block);
+ else if (ao_cmd_lex_i > config)
+ printf("Flight log max %d kB\n", config);
+ else {
+ ao_mutex_get(&ao_config_mutex);
+ _ao_config_get();
+ ao_config.flight_log_max = (uint32_t) ao_cmd_lex_i << 10;
+ ao_config_dirty = 1;
+ ao_mutex_put(&ao_config_mutex);
+ ao_config_log_show();
+ }
+}
+#endif /* HAS_EEPROM */
+
+#if HAS_IGNITE
+void
+ao_config_ignite_mode_show(void) __reentrant
+{
+ printf("Ignite mode: %d\n", ao_config.ignite_mode);
+}
+
+void
+ao_config_ignite_mode_set(void) __reentrant
+{
+ ao_cmd_decimal();
+ if (ao_cmd_status != ao_cmd_success)
+ return;
+ ao_mutex_get(&ao_config_mutex);
+ _ao_config_get();
+ ao_config.ignite_mode = ao_cmd_lex_i;
+ ao_config_dirty = 1;
+ ao_mutex_put(&ao_config_mutex);
+ ao_config_ignite_mode_show();
+}
+#endif
+
+#if HAS_ACCEL
+void
+ao_config_pad_orientation_show(void) __reentrant
+{
+ printf("Pad orientation: %d\n", ao_config.pad_orientation);
+}
+
+void
+ao_config_pad_orientation_set(void) __reentrant
+{
+ ao_cmd_decimal();
+ if (ao_cmd_status != ao_cmd_success)
+ return;
+ ao_mutex_get(&ao_config_mutex);
+ _ao_config_get();
+ ao_cmd_lex_i &= 1;
+ if (ao_config.pad_orientation != ao_cmd_lex_i) {
+ uint16_t t;
+ t = ao_config.accel_plus_g;
+ ao_config.accel_plus_g = 0x7fff - ao_config.accel_minus_g;
+ ao_config.accel_minus_g = 0x7fff - t;
+ }
+ ao_config.pad_orientation = ao_cmd_lex_i;
+ ao_config_dirty = 1;
+ ao_mutex_put(&ao_config_mutex);
+ ao_config_pad_orientation_show();
+}
+#endif
+
+void
+ao_config_radio_setting_show(void) __reentrant
+{
+ printf("Radio setting: %ld\n", ao_config.radio_setting);
+}
+
+void
+ao_config_radio_setting_set(void) __reentrant
+{
+ ao_cmd_decimal();
+ if (ao_cmd_status != ao_cmd_success)
+ return;
+ ao_mutex_get(&ao_config_mutex);
+ _ao_config_get();
+ ao_config.radio_setting = ao_cmd_lex_u32;
+ ao_config_dirty = 1;
+ ao_mutex_put(&ao_config_mutex);
+ ao_config_radio_setting_show();
+ ao_radio_recv_abort();
+}
+