changeset 522:e33a8ac4b660

New ASSERT_BANK1 macro for software proofing.
author JeanDo
date Fri, 09 Dec 2011 20:43:43 +0100
parents 33abbc08f01e
children 48bbb1a81027
files code_part1/OSTC_code_asm_part1/definitions.asm code_part1/OSTC_code_asm_part1/divemode.asm code_part1/OSTC_code_asm_part1/wait.asm
diffstat 3 files changed, 21 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/definitions.asm	Fri Dec 09 20:43:39 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/definitions.asm	Fri Dec 09 20:43:43 2011 +0100
@@ -358,6 +358,21 @@
 desaturation_time_buffer res 2	; buffer for desat time
 total_divetime_seconds	res 2	; counts dive seconds regardless of CF01 (18h max.)
 
+ASSERT_BANK1    MACRO   tag
+    Ifdef   __DEBUG
+        local @end
+        movlw   1
+        xorwf   BSR,W
+        bz      @end
+        
+        movlw   low(tag)
+        movff   WREG,temp10+0
+        movlw   high(tag)
+        movff   WREG,temp10+0
+        call    PLED_resetdebugger
+@end:
+    Endif
+    ENDM
 ;=============================================================================
 ; C-code Routines
 ; PART 2
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Fri Dec 09 20:43:39 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Fri Dec 09 20:43:43 2011 +0100
@@ -303,9 +303,9 @@
 
 ; Copy all gases to char_I_deco_N2_ratio and char_I_deco_He_ratio
 divemode_check_decogases:               ; CALLed from Simulator, too
-	clrf    EEADRH                      ; Make sure to select eeprom bank 0
-	
-;;;; FIXME BANK1 ???
+    ASSERT_BANK1    .10001              ; Just make sure everything is correct.
+
+	clrf    EEADRH                      ; Make sure to select eeprom bank 0	
 
     read_int_eeprom		d'7'			; Read He ratio
     movff	EEDATA,char_I_deco_He_ratio+0	; And copy into hold register
--- a/code_part1/OSTC_code_asm_part1/wait.asm	Fri Dec 09 20:43:39 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/wait.asm	Fri Dec 09 20:43:43 2011 +0100
@@ -18,7 +18,7 @@
 ; ToDo: 
 	
 ; ==========================================================
-; 	WAIT 10 MICROSECONDS  -  16 MHZ
+; 	WAIT 10 MICROSECONDS  -  16 Mhz and 32 Mhz
 ; ==========================================================
 
 	IFDEF	SPEED_16MHz
@@ -88,8 +88,9 @@
 			call 	WAITMSX
 			endm
 
-WAITMSX		movwf	waitms_temp			; Holds number of ms to wait
+WAITMSX     movwf	waitms_temp			; Holds number of ms to wait
 
+            ASSERT_BANK1    .10002      ; Make sure we are in bank1
     Ifdef TESTING
             return                      ; In emulation, just skips waits
     Endif