Mercurial > public > hwos_code
comparison src/divemode.asm @ 111:c61b7a4e317c
Bugfix: CNS in planner
author | heinrichsweikamp |
---|---|
date | Tue, 17 Jun 2014 12:00:20 +0200 |
parents | 223579e905c3 |
children | f3062a611eef |
comparison
equal
deleted
inserted
replaced
110:d39493c786a2 | 111:c61b7a4e317c |
---|---|
231 | 231 |
232 return | 232 return |
233 | 233 |
234 global set_actual_ppo2 | 234 global set_actual_ppo2 |
235 set_actual_ppo2: ; calculate ppO2 in 0.01bar (e.g. 150 = 1.50 bar ppO2) | 235 set_actual_ppo2: ; calculate ppO2 in 0.01bar (e.g. 150 = 1.50 bar ppO2) |
236 btfsc divemode ; in divemode | |
237 bra set_actual_ppo2_dive ; Yes | |
238 ; No, use simulated ambient pressure for char_I_actual_ppO2 | |
239 movff char_I_bottom_depth,WREG | |
240 mullw .100 | |
241 movlw LOW(.1000) | |
242 addwf PRODL,W | |
243 movwf xA+0 | |
244 movlw HIGH(.1000) | |
245 addwfc PRODH,W | |
246 movwf xA+1 ; P_amb in millibar (1000 = 1.00 bar). | |
247 bra set_actual_ppo2_common | |
248 set_actual_ppo2_dive: | |
236 SAFE_2BYTE_COPY amb_pressure, xA ; P_amb in millibar (1000 = 1.00 bar). | 249 SAFE_2BYTE_COPY amb_pressure, xA ; P_amb in millibar (1000 = 1.00 bar). |
250 set_actual_ppo2_common: | |
237 movlw d'10' | 251 movlw d'10' |
238 movwf xB+0 | 252 movwf xB+0 |
239 clrf xB+1 | 253 clrf xB+1 |
240 call div16x16 ; xC=p_amb/10 (100 = 1.00 bar). | 254 call div16x16 ; xC=p_amb/10 (100 = 1.00 bar). |
241 movff xC+0,xA+0 | 255 movff xC+0,xA+0 |