- if (year != 0 && month != 0 && day != 0)
- eeprom_name = new AltosFile(year, month, day, flights.config_data.serial, flight, "eeprom");
- else
- eeprom_name = new AltosFile(flights.config_data.serial, flight, "eeprom");
+ AltosGPS gps = state.gps;
+
+ if (gps != null &&
+ gps.year != AltosLib.MISSING &&
+ gps.month != AltosLib.MISSING &&
+ gps.day != AltosLib.MISSING)
+ {
+ eeprom_name = new AltosFile(gps.year, gps.month, gps.day,
+ state.serial, state.flight, "eeprom");
+ } else
+ eeprom_name = new AltosFile(state.serial, state.flight, "eeprom");