Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/simulator.asm @ 262:a9f8c87dda06
Quick fix for non-stopping simulator
author | heinrichsweikamp |
---|---|
date | Mon, 11 Apr 2011 11:23:00 +0200 |
parents | d995e220ddac |
children | 27c9bb14b008 |
comparison
equal
deleted
inserted
replaced
261:9d4ab7c96885 | 262:a9f8c87dda06 |
---|---|
384 movlw d'1' | 384 movlw d'1' |
385 movff WREG,char_I_step_is_1min ; 1 minute mode | 385 movff WREG,char_I_step_is_1min ; 1 minute mode |
386 | 386 |
387 simulator_calc_deco_loop2: | 387 simulator_calc_deco_loop2: |
388 call PLED_simulator_data | 388 call PLED_simulator_data |
389 btg LED_red | |
390 | 389 |
391 call divemode_check_decogases ; Checks for decogases and sets the gases | 390 call divemode_check_decogases ; Checks for decogases and sets the gases |
392 call divemode_prepare_flags_for_deco | 391 call divemode_prepare_flags_for_deco |
393 | 392 |
394 call deco_calc_hauptroutine ; calc_tissue | 393 call deco_calc_hauptroutine ; calc_tissue |
399 bra simulator_calc_deco_loop2 | 398 bra simulator_calc_deco_loop2 |
400 | 399 |
401 movlw d'0' | 400 movlw d'0' |
402 movff WREG,char_I_step_is_1min ; 2 second deco mode | 401 movff WREG,char_I_step_is_1min ; 2 second deco mode |
403 | 402 |
403 movlw d'30' | |
404 movwf timeout_counter2 ; timeout used as temp here | |
404 simulator_calc_deco2: | 405 simulator_calc_deco2: |
405 btg LED_red | |
406 | 406 |
407 call divemode_check_decogases ; Checks for decogases and sets the gases | 407 call divemode_check_decogases ; Checks for decogases and sets the gases |
408 call divemode_prepare_flags_for_deco | 408 call divemode_prepare_flags_for_deco |
409 | 409 |
410 call deco_calc_hauptroutine ; calc_tissue | 410 call deco_calc_hauptroutine ; calc_tissue |
411 movlb b'00000001' ; rambank 1 selected | 411 movlb b'00000001' ; rambank 1 selected |
412 | |
413 dcfsnz timeout_counter2,F ; Abort loop (max. 30 tries)? | |
414 bra simulator_calc_deco3 ; Yes... | |
412 | 415 |
413 movff char_O_deco_status,WREG | 416 movff char_O_deco_status,WREG |
414 tstfsz WREG ; deco_status=0 if decompression calculation done | 417 tstfsz WREG ; deco_status=0 if decompression calculation done |
415 bra simulator_calc_deco2 ; Not finished | 418 bra simulator_calc_deco2 ; Not finished |
416 | 419 |
420 simulator_calc_deco3: | |
417 ; Finished | 421 ; Finished |
418 bsf LED_red | |
419 | |
420 call simulator_restore_tissue_data ; Restore 32 floats "pre_tissue" from bank3 | 422 call simulator_restore_tissue_data ; Restore 32 floats "pre_tissue" from bank3 |
421 | 423 |
422 bcf simulatormode_active ; normal simulator mode | 424 bcf simulatormode_active ; normal simulator mode |
423 bcf standalone_simulator ; Standalone Simulator active | 425 bcf standalone_simulator ; Standalone Simulator active |
424 | 426 |
425 WAITMS d'250' | 427 WAITMS d'250' |
426 WAITMS d'250' | 428 WAITMS d'250' |
427 WAITMS d'250' ; Wait for Pressure Sensor to get real pressure again... | 429 WAITMS d'250' ; Wait for Pressure Sensor to get real pressure again... |
428 | 430 |
429 bcf LED_red | |
430 | |
431 movlw d'5' ; Pre-Set Cursor to "Show Decoplan" | 431 movlw d'5' ; Pre-Set Cursor to "Show Decoplan" |
432 movwf menupos | 432 movwf menupos |
433 movff char_I_bottom_time,logbook_temp1; restore bottom time. | 433 movff char_I_bottom_time,logbook_temp1; restore bottom time. |
434 bra menu_simulator1 ; Done. | 434 bra menu_simulator1 ; Done. |
435 | 435 |