changeset 377:be71e563ac09 64kByte Logbook

First gas can be reset to 0m, test for timer1 race condition
author heinrichsweikamp
date Mon, 13 Jun 2011 07:45:59 +0200
parents ed26990716fe
children 51baf8777b73
files code_part1/OSTC_code_asm_part1/MAIN.ASM code_part1/OSTC_code_asm_part1/isr.asm code_part1/OSTC_code_asm_part1/menu_gassetup.asm
diffstat 3 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/MAIN.ASM	Sun Jun 12 21:27:07 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/MAIN.ASM	Mon Jun 13 07:45:59 2011 +0200
@@ -68,6 +68,10 @@
 		btfsc	INTCON3,INT1IF				; switch right
 		call	switch_right_int
 
+; Test for race condition
+		btfsc	PIR1,TMR1IF					;Timer1 INT (external 32.768kHz Clock)
+		call	timer1int
+
 		movff   prod_temp+1,PRODH
 		movff   prod_temp+0,PRODL
 		movff	wreg_temp,WREG				;restore working register
--- a/code_part1/OSTC_code_asm_part1/isr.asm	Sun Jun 12 21:27:07 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/isr.asm	Mon Jun 13 07:45:59 2011 +0200
@@ -395,7 +395,8 @@
 		return
 		clrf		hours
 		incf		day,F
-		movff		time_correction_value,secs			; Correct too slow clock
+; Test for race condition
+;		movff		time_correction_value,secs			; Correct too slow clock
 						
 check_date:
 		movff		month,isr_divB		; new month?
--- a/code_part1/OSTC_code_asm_part1/menu_gassetup.asm	Sun Jun 12 21:27:07 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/menu_gassetup.asm	Mon Jun 13 07:45:59 2011 +0200
@@ -903,10 +903,13 @@
 	cpfslt	lo
 	movwf	lo					; limit to 99m
 
+	btfsc	second_FA			; Is first gas?
+	clrf	lo					; Yes, set to 0m
+
 	movf	decodata+0,W		; read current value 
 	addlw	d'28'				; offset in memory
 	movwf	EEADR
-	call	read_eeprom			; Low-value
+;	call	read_eeprom			; Low-value
 	movff	lo,EEDATA			; write result
 	call	write_eeprom		; save result in EEPROM