comparison code_part1/OSTC_code_asm_part1/start.asm @ 521:33abbc08f01e

Minor cleanups for TESTING=1 emulator mode.
author JeanDo
date Fri, 09 Dec 2011 20:43:39 +0100
parents acf4776eec08
children 3091628b2742
comparison
equal deleted inserted replaced
520:acf4776eec08 521:33abbc08f01e
22 ; known bugs: 22 ; known bugs:
23 ; ToDo: 23 ; ToDo:
24 24
25 start: 25 start:
26 movlb b'00000001' ; ram bank 1 selected 26 movlb b'00000001' ; ram bank 1 selected
27 movff STKPTR,temp10 27 movff STKPTR,temp10 ; Save stack pointer, for crash reports.
28 clrf temp10+1 28 clrf temp10+1
29 call init 29 call init
30 btfsc divemode ; Reset from Divemode? 30 btfsc divemode ; Reset from Divemode?
31 call PLED_resetdebugger ; Yes! Something went wrong, show reset informations 31 call PLED_resetdebugger ; Yes! Something went wrong, show reset informations
32 start3: 32 start3:
57 57
58 bsf sleepmode ; Routine only works in sleepmode... 58 bsf sleepmode ; Routine only works in sleepmode...
59 call pressuretest_sleep_fast ; Gets pressure without averaging (faster!) 59 call pressuretest_sleep_fast ; Gets pressure without averaging (faster!)
60 bcf sleepmode ; Normal mode again 60 bcf sleepmode ; Normal mode again
61 61
62 Ifdef TESTING 62 ; Extra power-up reset (JeanDo emulator)
63 movlw LOW(.1000) 63 Ifdef TESTING
64 movwf amb_pressure+0 64 call reset_gases
65 movlw HIGH(.1000) 65 call reset_all_cf
66 movwf amb_pressure+1 66 call reset_external_eeprom
67 Else 67
68 movlw LOW(.1000)
69 movwf amb_pressure+0
70 movlw HIGH(.1000)
71 movwf amb_pressure+1
72 Endif
73
74 ; Get real pressure (if not in emulator mode)
75 Ifndef TESTING
68 SAFE_2BYTE_COPY amb_pressure_avg, amb_pressure ; copy for compatibility 76 SAFE_2BYTE_COPY amb_pressure_avg, amb_pressure ; copy for compatibility
69 Endif 77 Endif
70 78
71 movff amb_pressure+0,last_surfpressure+0 79 movff amb_pressure+0,last_surfpressure+0
72 movff amb_pressure+1,last_surfpressure+1 80 movff amb_pressure+1,last_surfpressure+1
89 movff WREG,char_I_desaturation_multiplier 97 movff WREG,char_I_desaturation_multiplier
90 movff amb_pressure+0,int_I_pres_respiration+0 ; copy for deco routine 98 movff amb_pressure+0,int_I_pres_respiration+0 ; copy for deco routine
91 movff amb_pressure+1,int_I_pres_respiration+1 99 movff amb_pressure+1,int_I_pres_respiration+1
92 movff int_I_pres_respiration+0,int_I_pres_surface+0 ; copy for desat routine 100 movff int_I_pres_respiration+0,int_I_pres_surface+0 ; copy for desat routine
93 movff int_I_pres_respiration+1,int_I_pres_surface+1 101 movff int_I_pres_respiration+1,int_I_pres_surface+1
94
95 ; Extra power-up reset (JeanDo)
96 ifdef TESTING
97 call reset_gases
98 call reset_all_cf
99 endif
100 102
101 call deco_clear_tissue 103 call deco_clear_tissue
102 movlb b'00000001' ; select ram bank 1 104 movlb b'00000001' ; select ram bank 1
103 105
104 call divemode_check_decogases ; Setup N2/He ratio array 106 call divemode_check_decogases ; Setup N2/He ratio array