diff options
author | Keith Packard <keithp@keithp.com> | 2012-03-27 22:54:17 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-03-27 22:54:17 -0700 |
commit | b98f75dbcccd40c8cbf32c3bfd21bd6f5648b861 (patch) | |
tree | ba7cdf3caa5b8ff2202514dd5e78d9803dfbd2bb /altosui/AltosConfig.java | |
parent | b6c7ae2c1f8cba7351cd139c49322280d9d3af47 (diff) |
altosui: Sanity check values from device configuration
If someone has down-graded and re up-graded the firmware, the config
entries may be garbage. Sanity check them to avoid crashing the UI.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosConfig.java')
-rw-r--r-- | altosui/AltosConfig.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/altosui/AltosConfig.java b/altosui/AltosConfig.java index 84261ec7..8eb71e1f 100644 --- a/altosui/AltosConfig.java +++ b/altosui/AltosConfig.java @@ -194,7 +194,9 @@ public class AltosConfig implements ActionListener { get_int(line, "Ignite mode:", ignite_mode); get_int(line, "Pad orientation:", pad_orientation); get_int(line, "Radio setting:", radio_setting); - get_int(line, "Frequency:", radio_frequency); + if (get_int(line, "Frequency:", radio_frequency)) + if (radio_frequency.get() < 0) + radio_frequency.set(434550); get_int(line, "Radio enable:", radio_enable); get_int(line, "Storage size:", storage_size); get_int(line, "Storage erase unit:", storage_erase_unit); |