diff src/options.asm @ 133:939f1e83c4c2

BUGFIX: Surface interval was not displayed correctly in some cases NEW: Store tissue load, date and time, surface interval, desat. time and nofly time every hour and reload them after battery change
author heinrichsweikamp
date Mon, 14 Jul 2014 15:17:07 +0200
parents f3062a611eef
children e0b758865e91
line wrap: on
line diff
--- a/src/options.asm	Tue Jul 08 11:39:00 2014 +0200
+++ b/src/options.asm	Mon Jul 14 15:17:07 2014 +0200
@@ -239,7 +239,7 @@
         movlw   LOW(eeprom_serial_save)
         movwf   EEADR
         movlw   HIGH(eeprom_serial_save)
-        movf    EEADRH
+        movwf   EEADRH
         movlw   LOW(eeprom_opt_serial)
         movwf   EEDATA
         call    write_eeprom
@@ -282,11 +282,14 @@
 
         ; One byte to save to eeprom
         movff   INDF1,EEDATA
-        goto    write_eeprom
+        btfss   EEADRH,1                ; EEADR:EEADRH < 512?
+        call    write_eeprom            ; Yes, write
+        return
         
 option_save_string:
         movff   POSTINC1,EEDATA         ; Write one byte
-        call    write_eeprom
+        btfss   EEADRH,1                ; EEADR:EEADRH < 512?
+        call    write_eeprom            ; Yes, write
         infsnz  EEADR,F
         incf    EEADRH,F