Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 801:ba084dfa4b36
minor
author | heinrichsweikamp |
---|---|
date | Sat, 11 Oct 2014 11:18:15 +0200 |
parents | 55bd11e07d9f |
children | c50296c3059e |
comparison
equal
deleted
inserted
replaced
800:afcf56ae09e4 | 801:ba084dfa4b36 |
---|---|
62 bsf event_occured ; set global event flag | 62 bsf event_occured ; set global event flag |
63 | 63 |
64 diveloop_loop: ; The diveloop starts here | 64 diveloop_loop: ; The diveloop starts here |
65 btfss onesecupdate ; tasks any new second | 65 btfss onesecupdate ; tasks any new second |
66 bra diveloop_loop3 | 66 bra diveloop_loop3 |
67 | |
68 bcf onesecupdate ; one seconds update, clear flag here in case it's set again in ISR before all tasks are done. | |
67 | 69 |
68 btfsc gauge_mode ; Only in gauge mode | 70 btfsc gauge_mode ; Only in gauge mode |
69 bra diveloop_loop1a ; One Second Tasks in Gauge mode | 71 bra diveloop_loop1a ; One Second Tasks in Gauge mode |
70 btfsc FLAG_apnoe_mode ; Only in apnoe mode | 72 btfsc FLAG_apnoe_mode ; Only in apnoe mode |
71 bra diveloop_loop1b ; One Second Tasks in Apnoe mode | 73 bra diveloop_loop1b ; One Second Tasks in Apnoe mode |
165 btfsc menubit ; is the Dive mode menu displayed? | 167 btfsc menubit ; is the Dive mode menu displayed? |
166 call timeout_divemenu ; Yes, so check for timeout divemenu | 168 call timeout_divemenu ; Yes, so check for timeout divemenu |
167 call set_leds_divemode ; Sets warnings, if required. Also Sets buzzer | 169 call set_leds_divemode ; Sets warnings, if required. Also Sets buzzer |
168 btfsc enter_error_sleep ; Enter Fatal Error Routine? | 170 btfsc enter_error_sleep ; Enter Fatal Error Routine? |
169 call fatal_error_sleep ; Yes (In Sleepmode.asm!) | 171 call fatal_error_sleep ; Yes (In Sleepmode.asm!) |
170 | |
171 bcf onesecupdate ; one seconds update done | |
172 | 172 |
173 diveloop_loop3: | 173 diveloop_loop3: |
174 btfss menubit ; Divemode menu active? | 174 btfss menubit ; Divemode menu active? |
175 call test_switches_divemode ; No, Check switches normal | 175 call test_switches_divemode ; No, Check switches normal |
176 | 176 |
1681 endif | 1681 endif |
1682 | 1682 |
1683 goto surfloop_no_display_init ; and return to surfaceloop | 1683 goto surfloop_no_display_init ; and return to surfaceloop |
1684 | 1684 |
1685 end_dive_common_sim: | 1685 end_dive_common_sim: |
1686 tstfsz surface_interval+0 ; Was interval zero? | |
1687 bra end_dive_common_sim2 ; No | |
1688 tstfsz surface_interval+1 ; Was interval zero? | |
1689 bra end_dive_common_sim2 ; No | |
1690 bra end_dive_common ; Yes, done. | |
1691 | |
1692 end_dive_common_sim2: | |
1686 movf divemins+0,W | 1693 movf divemins+0,W |
1687 addwf surface_interval+0,F | 1694 addwf surface_interval+0,F |
1688 movf divemins+1,W | 1695 movf divemins+1,W |
1689 addwfc surface_interval+1 ; Add simulated divetime to surface interval | 1696 addwfc surface_interval+1 ; Add simulated divetime to surface interval |
1690 bra end_dive_common | 1697 bra end_dive_common |