+ public static int[] get_values(String line, String label) throws NumberFormatException, ParseException {
+ if (line.startsWith(label)) {
+ String tail = line.substring(label.length()).trim();
+ String[] tokens = tail.split("\\s+");
+ if (tokens.length > 1) {
+ int[] values = new int[2];
+ values[0] = Integer.parseInt(tokens[0]);
+ values[1] = Integer.parseInt(tokens[1]);
+ return values;
+ }
+ }
+ throw new ParseException("mismatch", 0);
+ }
+
+ public int log_space() {
+ if (log_space != AltosLib.MISSING)
+ return log_space;
+
+ if (storage_size != AltosLib.MISSING) {
+ int space = storage_size;
+
+ if (storage_erase_unit != AltosLib.MISSING && use_flash_for_config())
+ space -= storage_erase_unit;
+
+ if (space != AltosLib.MISSING)
+ return space;
+ }
+ return 0;