comparison code_part1/OSTC_code_asm_part1/menu_reset.asm @ 411:e6e1b89b7c3e

BUGFIX: CNS was not cleared with a "Reset Deco"
author heinrichsweikamp
date Tue, 12 Jul 2011 20:21:57 +0200
parents ab962c4b19d6
children b2c9cc018671
comparison
equal deleted inserted replaced
410:c6f9eb123b85 411:e6e1b89b7c3e
288 288
289 do_menu_reset_decodata2: 289 do_menu_reset_decodata2:
290 ; reset deco data 290 ; reset deco data
291 call PLED_ClearScreen 291 call PLED_ClearScreen
292 DISPLAYTEXT .25 ; "Reset..." 292 DISPLAYTEXT .25 ; "Reset..."
293
293 SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration ; copy surface air pressure to deco routine 294 SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration ; copy surface air pressure to deco routine
294 call deco_clear_tissue 295 call deco_clear_tissue ; Reset Decodata
295 movlb b'00000001' ; RAM Bank1 selected 296 movlb b'00000001' ; select ram bank 1
297 call deco_calc_desaturation_time ; calculate desaturation time
298 movlb b'00000001' ; select ram bank 1
299 call deco_clear_CNS_fraction ; clear CNS
300 movlb b'00000001' ; select ram bank 1
296 goto restart ; done. quit to surfmode 301 goto restart ; done. quit to surfmode
297 302
298 do_menu_reset_all: 303 do_menu_reset_all:
299 call PLED_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK! 304 call PLED_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK!
300 movwf menupos ; Used as temp 305 movwf menupos ; Used as temp
307 DISPLAYTEXT .25 ; "Reset..." 312 DISPLAYTEXT .25 ; "Reset..."
308 313
309 reset_start: 314 reset_start:
310 ; reset deco data 315 ; reset deco data
311 SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration ; copy surface air pressure to deco routine 316 SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration ; copy surface air pressure to deco routine
312 call deco_clear_tissue 317 call deco_clear_tissue ; Reset Decodata
313 movlb b'00000001' ; RAM Bank1 selected 318 movlb b'00000001' ; select ram bank 1
319 call deco_calc_desaturation_time ; calculate desaturation time
320 movlb b'00000001' ; select ram bank 1
321 call deco_clear_CNS_fraction ; clear CNS
322 movlb b'00000001' ; select ram bank 1
314 323
315 ; reset gases 324 ; reset gases
316 clrf EEADRH ; EEPROM BANK 0 ! 325 clrf EEADRH ; EEPROM BANK 0 !
317 326
318 movlw d'3' ; address of first gas-1 327 movlw d'3' ; address of first gas-1