changeset 720:4452837aff37

Vault date and time during update
author heinrichsweikamp
date Sun, 26 May 2013 11:58:56 +0200
parents ad5ab9910820
children a5d44fb115a8
files code_part1/OSTC_code_asm_part1/adc_rtc.asm code_part1/OSTC_code_asm_part1/changelog.txt code_part1/OSTC_code_asm_part1/divemode.asm code_part1/OSTC_code_asm_part1/eeprom_rs232.asm code_part1/OSTC_code_asm_part1/interface.asm code_part1/OSTC_code_asm_part1/menu_logbook.asm code_part1/OSTC_code_asm_part1/outputs.asm code_part1/OSTC_code_asm_part1/start.asm code_part1/OSTC_code_asm_part1/surfmode.asm docu/ostc_interface_description.odt
diffstat 10 files changed, 60 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/adc_rtc.asm	Thu May 23 21:43:08 2013 +0200
+++ b/code_part1/OSTC_code_asm_part1/adc_rtc.asm	Sun May 26 11:58:56 2013 +0200
@@ -236,9 +236,9 @@
 	movwf	mins
 	movlw	.12
 	movwf	hours
-	movlw	.11
+	movlw	.1
 	movwf	day
-	movlw	.2
+	movlw	.5
 	movwf	month
 	movlw	.13
 	movwf	year
--- a/code_part1/OSTC_code_asm_part1/changelog.txt	Thu May 23 21:43:08 2013 +0200
+++ b/code_part1/OSTC_code_asm_part1/changelog.txt	Sun May 26 11:58:56 2013 +0200
@@ -1,6 +1,7 @@
 New in 2.64:
 BETA Version - Do NOT use for diving!
 CHANGE: "ostc3-style" menu titles
+NEW: Vault date and time during update
 
 New in 2.63:
 BETA Version - Do NOT use for diving!
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Thu May 23 21:43:08 2013 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Sun May 26 11:58:56 2013 +0200
@@ -1650,7 +1650,7 @@
 		call	simulator_restore_tissue_data		; Yes!
 	endif
 
-	goto	surfloop					; and return to surfaceloop
+	goto	surfloop_no_display_init	; and return to surfaceloop
 
 timeout_divemode:
 	btfss	realdive					; Dive longer then one minute
--- 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
--- a/code_part1/OSTC_code_asm_part1/interface.asm	Thu May 23 21:43:08 2013 +0200
+++ b/code_part1/OSTC_code_asm_part1/interface.asm	Sun May 26 11:58:56 2013 +0200
@@ -223,7 +223,7 @@
 	WAITMS	d'250'
 	bcf			LED_blue
 	bsf			PIE1,RCIE					; Interrupt for RS232
-	goto		surfloop					; back to surfacemode
+	goto		surfloop_no_display_init	; back to surfacemode
 
 send_internal_eeprom1:
 	movwf		EEADRH						; Point to Bank "WREG"
--- a/code_part1/OSTC_code_asm_part1/menu_logbook.asm	Thu May 23 21:43:08 2013 +0200
+++ b/code_part1/OSTC_code_asm_part1/menu_logbook.asm	Sun May 26 11:58:56 2013 +0200
@@ -1446,7 +1446,6 @@
 
 logbook_convert_64k:						; Converts <1.91 logbook (32kB) to 64kB variant
 	call	DISPLAY_boot
-	call	DISP_ClearScreen		; Clear screen
 	movlw	color_red
     call	DISP_set_color			; Set to Red
 	DISPLAYTEXTH	d'303'			; Please wait!
--- a/code_part1/OSTC_code_asm_part1/outputs.asm	Thu May 23 21:43:08 2013 +0200
+++ b/code_part1/OSTC_code_asm_part1/outputs.asm	Sun May 26 11:58:56 2013 +0200
@@ -297,7 +297,7 @@
     global temp10
 
     movlb   1                       ; For C-code calls
-	call	DISPLAY_boot				; DISP boot
+	call	DISPLAY_boot			; DISP boot
 	call	DISP_standard_color
 	WIN_INVERT	.0					; Init new Wordprocessor
 
--- a/code_part1/OSTC_code_asm_part1/start.asm	Thu May 23 21:43:08 2013 +0200
+++ b/code_part1/OSTC_code_asm_part1/start.asm	Sun May 26 11:58:56 2013 +0200
@@ -163,6 +163,32 @@
 	clrf	EEADRH					; Reset EEADRH
 
 restart:
+    ; check for time/date vault
+    movlw   .1
+    movwf   EEADRH
+    read_int_eeprom .5
+    movlw   0xAA
+    cpfseq  EEDATA                  ; 0xAA in EEPROM Bank1, Byte 5?
+    bra     restart0                        ; No
+
+    movlw   0x00
+    movwf   EEDATA
+    write_int_eeprom	d'5'        ; clear flag
+    read_int_eeprom     .6
+    movff   EEDATA,year
+    read_int_eeprom     .7
+    movff   EEDATA,month
+    read_int_eeprom     .8
+    movff   EEDATA,day
+    read_int_eeprom     .9
+    movff   EEDATA,hours
+    read_int_eeprom     .10
+    movff   EEDATA,mins
+    read_int_eeprom     .11
+    movff   EEDATA,secs
+    call    RTCinit                 ; Check limits
+restart0:
+    clrf    EEADRH
 	movlw	b'00000011'
 	movwf	T3CON					; Timer3 with 32768Hz clock running
 	clrf	TMR3L
--- a/code_part1/OSTC_code_asm_part1/surfmode.asm	Thu May 23 21:43:08 2013 +0200
+++ b/code_part1/OSTC_code_asm_part1/surfmode.asm	Sun May 26 11:58:56 2013 +0200
@@ -24,15 +24,15 @@
 
 surfloop:
 ; Boot tasks for all modes
+	call	DISPLAY_boot
+surfloop_no_display_init:
+    call	DISP_ClearScreen
 	bcf		s_unlock_after_sleep			; Lock sensor results
 	call	restart_set_modes_and_flags		; Sets decomode flags
 	clrf	lo
 	movff	lo,char_I_const_ppO2			; reset to standard mode, OSTC assumes Air breathing at the surface!
-
+	call 	I2CReset
 	call	DISP_brightness_full			; max. brightness
-	
-	call 	I2CReset
-	call	DISPLAY_boot
 	call	DISP_serial						; Show OSTC serial and firmware version
 	call	DISP_clock						; display time
 	call	update_date						; display date
Binary file docu/ostc_interface_description.odt has changed