Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/simulator.asm @ 395:0e0cf4701c17
Merge with 64kByte Logbook
author | JeanDo |
---|---|
date | Thu, 23 Jun 2011 01:37:59 +0200 |
parents | a847f416e67e |
children | ab962c4b19d6 |
comparison
equal
deleted
inserted
replaced
369:93c0cb14b0d2 | 395:0e0cf4701c17 |
---|---|
22 ; last updated: 081210 | 22 ; last updated: 081210 |
23 ; known bugs: | 23 ; known bugs: |
24 ; ToDo: | 24 ; ToDo: |
25 | 25 |
26 menu_simulator: | 26 menu_simulator: |
27 movlw d'1' | 27 movlw d'3' |
28 movwf logbook_temp1 ; Bottom time | 28 movwf logbook_temp1 ; Bottom time |
29 movlw d'15' | 29 movlw d'15' |
30 movwf logbook_temp2 ; Max. Depth | 30 movwf logbook_temp2 ; Max. Depth |
31 movlw d'1' | 31 movlw d'1' |
32 movwf menupos | 32 movwf menupos |
33 clrf WREG ; Interval | 33 clrf WREG ; Interval |
34 movff WREG,char_I_dive_interval | 34 movff WREG,char_I_dive_interval |
35 | 35 |
94 movwf menupos | 94 movwf menupos |
95 goto more_menu2 ; exit... | 95 goto more_menu2 ; exit... |
96 | 96 |
97 simulator_inc_interval: | 97 simulator_inc_interval: |
98 movff char_I_dive_interval,PRODL | 98 movff char_I_dive_interval,PRODL |
99 incf PRODL,F | 99 movlw .3 |
100 addwf PRODL,F | |
100 movlw .24*6 ; Max 24h delay. | 101 movlw .24*6 ; Max 24h delay. |
101 cpfslt PRODL | 102 cpfslt PRODL |
102 clrf PRODL | 103 clrf PRODL |
103 movff PRODL,char_I_dive_interval | 104 movff PRODL,char_I_dive_interval |
104 | 105 |
151 movff xC+1,sim_pressure+1 | 152 movff xC+1,sim_pressure+1 |
152 | 153 |
153 ; This override is done in ISR too, but do it right now also: | 154 ; This override is done in ISR too, but do it right now also: |
154 movff sim_pressure+0,amb_pressure+0 | 155 movff sim_pressure+0,amb_pressure+0 |
155 movff sim_pressure+1,amb_pressure+1 | 156 movff sim_pressure+1,amb_pressure+1 |
157 call comp_air_pressure0 ; Make sure to have depth in rel_pressure:2 | |
156 | 158 |
157 bcf menubit2 | 159 bcf menubit2 |
158 bcf menubit3 | 160 bcf menubit3 |
159 bcf menubit | 161 bcf menubit |
160 bcf switch_left | 162 bcf switch_left |
341 movlb 1 | 343 movlb 1 |
342 | 344 |
343 bsf simulatormode_active ; normal simulator mode | 345 bsf simulatormode_active ; normal simulator mode |
344 bsf standalone_simulator ; Standalone Simulator active | 346 bsf standalone_simulator ; Standalone Simulator active |
345 bsf no_sensor_int ; Disable sensor interrupt | 347 bsf no_sensor_int ; Disable sensor interrupt |
346 clrf T3CON ; Restart time3 counter, | 348 clrf T3CON ; Disable timer3 counter, |
347 clrf TMR3L ; so the simu won't stop right away. | 349 clrf TMR3L ; so the simu won't stop right away. |
348 clrf TMR3H | 350 clrf TMR3H |
349 | 351 |
350 call diveloop_boot ; configure gases, etc. | 352 call diveloop_boot ; configure gases, etc. |
351 | 353 |