Mercurial > public > hwos_code
comparison src/isr.asm @ 176:3fdafedc24af
surface pressure copy in simulator
author | heinrichsweikamp |
---|---|
date | Mon, 06 Oct 2014 23:47:08 +0200 |
parents | df449e5b1c81 |
children | 39f6c07ce2f6 |
comparison
equal
deleted
inserted
replaced
174:932e91074bdb | 176:3fdafedc24af |
---|---|
426 isr_sensor_state2_5: | 426 isr_sensor_state2_5: |
427 movff amb_pressure+0,last_pressure+0 ; Copy for compare | 427 movff amb_pressure+0,last_pressure+0 ; Copy for compare |
428 movff amb_pressure+1,last_pressure+1 | 428 movff amb_pressure+1,last_pressure+1 |
429 | 429 |
430 clrf sensor_state_counter ; Then reset State counter | 430 clrf sensor_state_counter ; Then reset State counter |
431 banksel common ; flag2 is in Bank1 | |
431 btfss simulatormode_active ; are we in simulator mode? | 432 btfss simulatormode_active ; are we in simulator mode? |
432 bra comp_air_pressure ; no | 433 bra comp_air_pressure ; no |
433 comp_air_pressure0: | 434 ; Always set pressure_refresh flag in simulator mode |
435 bsf pressure_refresh ; Yes | |
436 banksel isr_backup ; Back to Bank0 ISR data | |
434 movlw LOW d'1000' ; yes, so simulate 1000mbar surface pressure | 437 movlw LOW d'1000' ; yes, so simulate 1000mbar surface pressure |
435 movwf last_surfpressure+0 | 438 movwf last_surfpressure+0 |
436 movlw HIGH d'1000' | 439 movlw HIGH d'1000' |
437 movwf last_surfpressure+1 | 440 movwf last_surfpressure+1 |
438 ; Always set pressure_refresh flag in simulator mode | 441 |
439 banksel common ; flag1 is in Bank1 | 442 comp_air_pressure: |
440 bsf pressure_refresh ; Yes | |
441 banksel isr_backup ; Back to Bank0 ISR data | 443 banksel isr_backup ; Back to Bank0 ISR data |
442 | |
443 comp_air_pressure: | |
444 movf last_surfpressure+0,W ; compensate airpressure | 444 movf last_surfpressure+0,W ; compensate airpressure |
445 subwf amb_pressure+0,W | 445 subwf amb_pressure+0,W |
446 movwf rel_pressure+0 ; rel_pressure stores depth! | 446 movwf rel_pressure+0 ; rel_pressure stores depth! |
447 | 447 |
448 movf last_surfpressure+1,W | 448 movf last_surfpressure+1,W |
660 | 660 |
661 clrf samplesecs ; clear counter... | 661 clrf samplesecs ; clear counter... |
662 bsf store_sample ; ...and set bit for profile storage | 662 bsf store_sample ; ...and set bit for profile storage |
663 isr_divemode_1sec2: | 663 isr_divemode_1sec2: |
664 ; Increase re-setable average depth divetime counter | 664 ; Increase re-setable average depth divetime counter |
665 incf average_divesecs+0,F ; increase stopwatch registers | 665 infsnz average_divesecs+0,F ; increase stopwatch registers |
666 btfsc STATUS,Z | |
667 incf average_divesecs+1,F ; increase stopwatch registers | 666 incf average_divesecs+1,F ; increase stopwatch registers |
668 ; Increase total divetime (Regardless of start_dive_threshold) | 667 ; Increase total divetime (Regardless of start_dive_threshold) |
669 infsnz total_divetime_seconds+0,F | 668 infsnz total_divetime_seconds+0,F |
670 incf total_divetime_seconds+1,F ; Total dive time (Regardless of start_dive_threshold) | 669 incf total_divetime_seconds+1,F ; Total dive time (Regardless of start_dive_threshold) |
671 | 670 |