diff code_part1/OSTC_code_asm_part1/simulator.asm @ 341:2144f19fa1eb

BUGFIX protect against ISR changing pressure/temperature while reading it.
author JeanDo
date Fri, 20 May 2011 00:48:30 +0200
parents 21a0f7393468
children 797e2ac42d24
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/simulator.asm	Fri May 20 00:39:05 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/simulator.asm	Fri May 20 00:48:30 2011 +0200
@@ -132,8 +132,9 @@
 
 	movff	xC+0,sim_pressure+0
 	movff	xC+1,sim_pressure+1
-	
-	movff	sim_pressure+0,amb_pressure+0	; override readings with simulator values
+
+    ; This override is done in ISR too, but do it right now also:	
+	movff	sim_pressure+0,amb_pressure+0
 	movff	sim_pressure+1,amb_pressure+1
 
 	bcf		menubit2
@@ -345,7 +346,8 @@
 	DISPLAYTEXT	.12                     ; "Wait..."
 	WIN_INVERT	.0
 
-	movff	sim_pressure+0,amb_pressure+0	; override readings with simulator values
+    ; This override is done in ISR too, but do it right now also:	
+	movff	sim_pressure+0,amb_pressure+0
 	movff	sim_pressure+1,amb_pressure+1
 
 	call	divemode_check_decogases    ; Checks for decogases and sets the gases