From b98f75dbcccd40c8cbf32c3bfd21bd6f5648b861 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 27 Mar 2012 22:54:17 -0700 Subject: 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 --- altosui/AltosConfig.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'altosui/AltosConfig.java') 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); -- cgit v1.2.3