comparison code_part1/OSTC_code_asm_part1/start.asm @ 507:ed51a7a89d9a

minor cleanups for TESTING mode
author JeanDo
date Sun, 20 Nov 2011 22:52:09 +0100
parents 014b2b1e82dc
children b595569e4bcc
comparison
equal deleted inserted replaced
506:ab819be6193f 507:ed51a7a89d9a
56 clrf surface_interval+1 56 clrf surface_interval+1
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
62 Ifdef TESTING
63 movlw LOW(.1000)
64 movwf amb_pressure+0
65 movlw HIGH(.1000)
66 movwf amb_pressure+1
67 Else
61 SAFE_2BYTE_COPY amb_pressure_avg, amb_pressure ; copy for compatibility 68 SAFE_2BYTE_COPY amb_pressure_avg, amb_pressure ; copy for compatibility
62 69 Endif
63 SAFE_2BYTE_COPY amb_pressure_avg, last_surfpressure 70
64 SAFE_2BYTE_COPY amb_pressure_avg, amb_pressure 71 movff amb_pressure+0,last_surfpressure+0
72 movff amb_pressure+1,last_surfpressure+1
65 movff last_surfpressure+0,last_surfpressure_15min+0 73 movff last_surfpressure+0,last_surfpressure_15min+0
66 movff last_surfpressure+1,last_surfpressure_15min+1 74 movff last_surfpressure+1,last_surfpressure_15min+1
67 movff last_surfpressure+0,last_surfpressure_30min+0 75 movff last_surfpressure+0,last_surfpressure_30min+0
68 movff last_surfpressure+1,last_surfpressure_30min+1 ; Rests all airpressure registers 76 movff last_surfpressure+1,last_surfpressure_30min+1 ; Rests all airpressure registers
69
70 ; Extra power-up reset (JeanDo)
71 ifdef TESTING
72 call do_menu_reset_all2
73 endif
74 77
75 ; reset deco data 78 ; reset deco data
76 ostc_debug '0' ; Sends debug-information to screen if debugmode active 79 ostc_debug '0' ; Sends debug-information to screen if debugmode active
77 80
78 movlw d'79' ; 79% N2 81 movlw d'79' ; 79% N2
82 movff WREG,char_I_step_is_1min ; 2 second deco mode 85 movff WREG,char_I_step_is_1min ; 2 second deco mode
83 GETCUSTOM8 d'11' ; Saturation multiplier % 86 GETCUSTOM8 d'11' ; Saturation multiplier %
84 movff WREG,char_I_saturation_multiplier 87 movff WREG,char_I_saturation_multiplier
85 GETCUSTOM8 d'12' ; Desaturation multiplier % 88 GETCUSTOM8 d'12' ; Desaturation multiplier %
86 movff WREG,char_I_desaturation_multiplier 89 movff WREG,char_I_desaturation_multiplier
87 SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration ; copy for deco routine 90 movff amb_pressure+0,int_I_pres_respiration+0 ; copy for deco routine
88 movff int_I_pres_respiration+0,int_I_pres_surface+0 ; copy for desat routine 91 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
89 movff int_I_pres_respiration+1,int_I_pres_surface+1 93 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
90 100
91 call deco_clear_tissue ; 101 call deco_clear_tissue ;
92 call deco_calc_desaturation_time ; calculate desaturation time 102 call deco_calc_desaturation_time ; calculate desaturation time
93 call deco_clear_CNS_fraction ; clear CNS 103 call deco_clear_CNS_fraction ; clear CNS
94 call calc_deko_surfmode ; calculate desaturation every minute 104 call calc_deko_surfmode ; calculate desaturation every minute
193 call sub16 ; sub_c = sub_a - sub_b 203 call sub16 ; sub_c = sub_a - sub_b
194 btfss neg_flag ; Result negative (Ambient>880mBar)? 204 btfss neg_flag ; Result negative (Ambient>880mBar)?
195 bsf high_altitude_mode ; No, Set Flag! 205 bsf high_altitude_mode ; No, Set Flag!
196 206
197 ; Should we disable sleep (hardware emulator) 207 ; Should we disable sleep (hardware emulator)
208 Ifndef TESTING
198 restart_loop: 209 restart_loop:
199 btfss 0xF81,0,A 210 btfss 0xF81,0,A
200 bra restart_loop 211 bra restart_loop
201 btfss 0xF81,1,A 212 btfss 0xF81,1,A
202 bra restart_loop 213 bra restart_loop
203 movlw 0x80 214 movlw 0x80
204 cpfslt 0xFB3,A 215 cpfslt 0xFB3,A
205 bsf nsm ; NO-SLEEP-MODE : for hardware debugging 216 bsf nsm ; NO-SLEEP-MODE : for hardware debugging
217 Endif
206 218
207 call gassetup_sort_gaslist ; Sorts Gaslist according to change depth 219 call gassetup_sort_gaslist ; Sorts Gaslist according to change depth
208 WIN_TOP .0 220 WIN_TOP .0
209 WIN_LEFT .0 221 WIN_LEFT .0
210 WIN_FONT FT_SMALL 222 WIN_FONT FT_SMALL