diff code_part1/OSTC_code_asm_part1/eeprom_rs232.asm @ 720:4452837aff37

Vault date and time during update
author heinrichsweikamp
date Sun, 26 May 2013 11:58:56 +0200
parents 39e02673db4c
children c50296c3059e
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/eeprom_rs232.asm	Thu May 23 21:43:08 2013 +0200
+++ b/code_part1/OSTC_code_asm_part1/eeprom_rs232.asm	Sun May 26 11:58:56 2013 +0200
@@ -249,7 +249,30 @@
 uart_115k_bootloader1:
 	movlw	0xC1
 	cpfseq	RCREG					; 115200Baud Bootloader request?
-	bra		uart_115k_bootloader2	; No, Abort	
+	bra		uart_115k_bootloader2	; No, Abort
+
+; Vault date and time during update
+; EEPROM Bank1
+; Byte 5: =0xAA -> reload time and date in "restart:"
+; Byte 6-11: YYMMDDHHMMSS
+    movlw   .1
+    movwf   EEADRH
+    movff   year,EEDATA
+    write_int_eeprom	d'6'
+    movff   month,EEDATA
+    write_int_eeprom	d'7'
+    movff   day,EEDATA
+    write_int_eeprom	d'8'
+    movff   hours,EEDATA
+    write_int_eeprom	d'9'
+    movff   mins,EEDATA
+    write_int_eeprom	d'10'
+    movff   secs,EEDATA
+    write_int_eeprom	d'11'
+    movlw   0xAA
+    movwf   EEDATA
+    write_int_eeprom	d'5'        ; Set flag
+    clrf    EEADRH
 	DISPLAYTEXTH	d'303'			; Yes, "Please wait!"
 	clrf	INTCON					; Interrupts disabled
 	bcf		PIR1,RCIF				; clear flag