int_ref storage_size;
int_ref storage_erase_unit;
int_ref stored_flight;
+ int_ref radio_enable;
string_ref version;
string_ref product;
string_ref callsign;
config_ui.set_radio_calibration(radio_calibration.get());
config_ui.set_radio_frequency(frequency());
config_ui.set_flight_log_max_enabled(stored_flight.get() < 0);
+ config_ui.set_radio_enable(radio_enable.get());
config_ui.set_flight_log_max_limit(log_limit());
config_ui.set_flight_log_max(flight_log_max.get());
config_ui.set_ignite_mode(ignite_mode.get());
get_int(line, "Ignite mode:", ignite_mode);
get_int(line, "Pad orientation:", pad_orientation);
get_int(line, "Radio setting:", radio_setting);
+ get_int(line, "Radio enable:", radio_enable);
get_int(line, "Storage size:", storage_size);
get_int(line, "Storage erase unit:", storage_erase_unit);
get_int(line, "flight", stored_flight);
serial_line.printf("c c %s\n", callsign.get());
if (flight_log_max.get() != 0)
serial_line.printf("c l %d\n", flight_log_max.get());
+ if (radio_enable.get() >= 0)
+ serial_line.printf("c e %d\n", radio_enable.get());
if (ignite_mode.get() >= 0)
serial_line.printf("c i %d\n", ignite_mode.get());
if (pad_orientation.get() >= 0)
radio_calibration.set(config_ui.radio_calibration());
set_frequency(config_ui.radio_frequency());
flight_log_max.set(config_ui.flight_log_max());
+ if (radio_enable.get() >= 0)
+ radio_enable.set(config_ui.radio_enable());
if (ignite_mode.get() >= 0)
ignite_mode.set(config_ui.ignite_mode());
if (pad_orientation.get() >= 0)
radio_channel = new int_ref(0);
radio_setting = new int_ref(0);
radio_calibration = new int_ref(1186611);
+ radio_enable = new int_ref(-1);
flight_log_max = new int_ref(0);
ignite_mode = new int_ref(-1);
pad_orientation = new int_ref(-1);
JLabel frequency_label;
JLabel radio_calibration_label;
JLabel radio_frequency_label;
+ JLabel radio_enable_label;
JLabel flight_log_max_label;
JLabel ignite_mode_label;
JLabel pad_orientation_label;
JComboBox apogee_delay_value;
AltosFreqList radio_frequency_value;
JTextField radio_calibration_value;
+ JRadioButton radio_enable_value;
JComboBox flight_log_max_value;
JComboBox ignite_mode_value;
JComboBox pad_orientation_value;
radio_calibration_value.setEnabled(false);
pane.add(radio_calibration_value, c);
- /* Callsign */
+ /* Radio Enable */
c = new GridBagConstraints();
c.gridx = 0; c.gridy = 7;
c.gridwidth = 4;
c.anchor = GridBagConstraints.LINE_START;
c.insets = il;
c.ipady = 5;
+ radio_enable_label = new JLabel("Telemetry/RDF Enable:");
+ pane.add(radio_enable_label, c);
+
+ c = new GridBagConstraints();
+ c.gridx = 4; c.gridy = 7;
+ c.gridwidth = 4;
+ c.fill = GridBagConstraints.HORIZONTAL;
+ c.weightx = 1;
+ c.anchor = GridBagConstraints.LINE_START;
+ c.insets = ir;
+ c.ipady = 5;
+ radio_enable_value = new JRadioButton("Enabled");
+ radio_enable_value.addItemListener(this);
+ pane.add(radio_enable_value, c);
+
+ /* Callsign */
+ c = new GridBagConstraints();
+ c.gridx = 0; c.gridy = 8;
+ c.gridwidth = 4;
+ c.fill = GridBagConstraints.NONE;
+ c.anchor = GridBagConstraints.LINE_START;
+ c.insets = il;
+ c.ipady = 5;
callsign_label = new JLabel("Callsign:");
pane.add(callsign_label, c);
c = new GridBagConstraints();
- c.gridx = 4; c.gridy = 7;
+ c.gridx = 4; c.gridy = 8;
c.gridwidth = 4;
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1;
/* Flight log max */
c = new GridBagConstraints();
- c.gridx = 0; c.gridy = 8;
+ c.gridx = 0; c.gridy = 9;
c.gridwidth = 4;
c.fill = GridBagConstraints.NONE;
c.anchor = GridBagConstraints.LINE_START;
pane.add(flight_log_max_label, c);
c = new GridBagConstraints();
- c.gridx = 4; c.gridy = 8;
+ c.gridx = 4; c.gridy = 9;
c.gridwidth = 4;
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1;
/* Ignite mode */
c = new GridBagConstraints();
- c.gridx = 0; c.gridy = 9;
+ c.gridx = 0; c.gridy = 10;
c.gridwidth = 4;
c.fill = GridBagConstraints.NONE;
c.anchor = GridBagConstraints.LINE_START;
pane.add(ignite_mode_label, c);
c = new GridBagConstraints();
- c.gridx = 4; c.gridy = 9;
+ c.gridx = 4; c.gridy = 10;
c.gridwidth = 4;
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1;
/* Pad orientation */
c = new GridBagConstraints();
- c.gridx = 0; c.gridy = 10;
+ c.gridx = 0; c.gridy = 11;
c.gridwidth = 4;
c.fill = GridBagConstraints.NONE;
c.anchor = GridBagConstraints.LINE_START;
pane.add(pad_orientation_label, c);
c = new GridBagConstraints();
- c.gridx = 4; c.gridy = 10;
+ c.gridx = 4; c.gridy = 11;
c.gridwidth = 4;
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1;
/* Buttons */
c = new GridBagConstraints();
- c.gridx = 0; c.gridy = 11;
+ c.gridx = 0; c.gridy = 12;
c.gridwidth = 2;
c.fill = GridBagConstraints.NONE;
c.anchor = GridBagConstraints.LINE_START;
save.setActionCommand("Save");
c = new GridBagConstraints();
- c.gridx = 2; c.gridy = 11;
+ c.gridx = 2; c.gridy = 12;
c.gridwidth = 2;
c.fill = GridBagConstraints.NONE;
c.anchor = GridBagConstraints.CENTER;
reset.setActionCommand("Reset");
c = new GridBagConstraints();
- c.gridx = 4; c.gridy = 11;
+ c.gridx = 4; c.gridy = 12;
c.gridwidth = 2;
c.fill = GridBagConstraints.NONE;
c.anchor = GridBagConstraints.CENTER;
reboot.setActionCommand("Reboot");
c = new GridBagConstraints();
- c.gridx = 6; c.gridy = 11;
+ c.gridx = 6; c.gridy = 12;
c.gridwidth = 2;
c.fill = GridBagConstraints.NONE;
c.anchor = GridBagConstraints.LINE_END;
return Integer.parseInt(radio_calibration_value.getText());
}
+ public void set_radio_enable(int new_radio_enable) {
+ if (new_radio_enable >= 0)
+ radio_enable_value.setSelected(new_radio_enable > 0);
+ else {
+ radio_enable_value.setSelected(true);
+ radio_enable_value.setEnabled(false);
+ }
+ }
+
+ public int radio_enable() {
+ if (radio_enable_value.isEnabled())
+ return radio_enable_value.isSelected() ? 1 : 0;
+ else
+ return -1;
+ }
+
public void set_callsign(String new_callsign) {
callsign_value.setText(new_callsign);
}
ao_config.pad_orientation = AO_CONFIG_DEFAULT_PAD_ORIENTATION;
if (ao_config.minor < 7)
ao_config.radio_setting = ao_config.radio_cal;
+ if (ao_config.minor < 8)
+ ao_config.radio_enable = TRUE;
ao_config.minor = AO_CONFIG_MINOR;
ao_config_dirty = 1;
}
ao_radio_recv_abort();
}
+void
+ao_config_radio_enable_show(void) __reentrant
+{
+ printf("Radio enable: %d\n", ao_config.radio_enable);
+}
+
+void
+ao_config_radio_enable_set(void) __reentrant
+{
+ ao_cmd_decimal();
+ if (ao_cmd_status != ao_cmd_success)
+ return;
+ _ao_config_edit_start();
+ ao_config.radio_enable = ao_cmd_lex_i;
+ _ao_config_edit_finish();
+}
+
struct ao_config_var {
__code char *str;
void (*set)(void) __reentrant;
ao_config_radio_channel_set, ao_config_radio_channel_show },
{ "c <call>\0Callsign (8 char max)",
ao_config_callsign_set, ao_config_callsign_show },
+ { "R <setting>\0Radio freq control (freq = 434.550 * setting/cal)",
+ ao_config_radio_setting_set, ao_config_radio_setting_show },
+ { "e <0 disable, 1 enable>\0Enable telemetry and RDF",
+ ao_config_radio_enable_set, ao_config_radio_enable_show },
#if HAS_ACCEL
{ "a <+g> <-g>\0Accel calib (0 for auto)",
ao_config_accel_calibrate_set,ao_config_accel_calibrate_show },
{ "o <0 antenna up, 1 antenna down>\0Set pad orientation",
ao_config_pad_orientation_set,ao_config_pad_orientation_show },
#endif
- { "R <setting>\0Radio freq control (freq = 434.550 * setting/cal)",
- ao_config_radio_setting_set, ao_config_radio_setting_show },
{ "s\0Show",
ao_config_show, 0 },
#if HAS_EEPROM