comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 494:e9b1f162799d

testing graphical velocity
author heinrichsweikamp
date Mon, 07 Nov 2011 08:39:21 +0100
parents 19b9e19ea4da
children 4c7f7807b250
comparison
equal deleted inserted replaced
493:4b2add2adde3 494:e9b1f162799d
78 btfsc twosecupdate ; two seconds after the last call 78 btfsc twosecupdate ; two seconds after the last call
79 bra diveloop_loop1a2 ; Common Tasks 79 bra diveloop_loop1a2 ; Common Tasks
80 80
81 bsf twosecupdate ; Routines used in the "other second" 81 bsf twosecupdate ; Routines used in the "other second"
82 call calc_average_depth ; calculate average depth 82 call calc_average_depth ; calculate average depth
83 ; call calc_velocity ; calculate vertical velocity and display if > threshold (every two seconds) 83 call calc_velocity ; calculate vertical velocity and display if > threshold (every two seconds)
84 84
85 bra diveloop_loop1x ; Common Tasks 85 bra diveloop_loop1x ; Common Tasks
86 86
87 diveloop_loop1a2: 87 diveloop_loop1a2:
88 bcf twosecupdate 88 bcf twosecupdate
136 call timeout_divemenu ; Yes, so check for timeout divemenu 136 call timeout_divemenu ; Yes, so check for timeout divemenu
137 call set_leds_divemode ; Sets warnings, if required. Also Sets buzzer 137 call set_leds_divemode ; Sets warnings, if required. Also Sets buzzer
138 btfsc enter_error_sleep ; Enter Fatal Error Routine? 138 btfsc enter_error_sleep ; Enter Fatal Error Routine?
139 call fatal_error_sleep ; Yes (In Sleepmode_vxx.asm!) 139 call fatal_error_sleep ; Yes (In Sleepmode_vxx.asm!)
140 140
141 call calc_velocity ; calculate vertical velocity and display if > threshold
142 141
143 bcf onesecupdate ; one seconds update done 142 bcf onesecupdate ; one seconds update done
144 143
145 diveloop_loop3: 144 diveloop_loop3:
146 btfss menubit ; Divemode menu active? 145 btfss menubit ; Divemode menu active?
278 bra calc_deko_divemode2 ; Yes, calculate and display deco data ("first second") 277 bra calc_deko_divemode2 ; Yes, calculate and display deco data ("first second")
279 278
280 bsf twosecupdate ; No, but next second! 279 bsf twosecupdate ; No, but next second!
281 ; Routines used in the "other second" 280 ; Routines used in the "other second"
282 call calc_average_depth ; calculate average depth 281 call calc_average_depth ; calculate average depth
283 ; call calc_velocity ; calculate vertical velocity and display if > threshold (every two seconds) 282 call calc_velocity ; calculate vertical velocity and display if > threshold (every two seconds)
284 283
285 ; Calculate CNS 284 ; Calculate CNS
286 rcall set_actual_ppo2 ; Set char_I_actual_ppO2 285 rcall set_actual_ppo2 ; Set char_I_actual_ppO2
287 clrf WREG 286 clrf WREG
288 movff WREG,char_I_step_is_1min ; Make sure to be in 2sec mode. 287 movff WREG,char_I_step_is_1min ; Make sure to be in 2sec mode.
809 808
810 call sub16 ; sub_c = amb_pressure - last_pressure 809 call sub16 ; sub_c = amb_pressure - last_pressure
811 810
812 movff sub_c+0,xA+0 811 movff sub_c+0,xA+0
813 movff sub_c+1,xA+1 812 movff sub_c+1,xA+1
814 ;movlw d'39' ;77 when called every second.... 813 movlw d'39' ;77 when called every second....
815 movlw d'77' ;77 when called every second....
816 movwf xB+0 814 movwf xB+0
817 clrf xB+1 815 clrf xB+1
818 call mult16x16 ; differential pressure in mbar*77... 816 call mult16x16 ; differential pressure in mbar*77...
819 movff xC+0,divA+0 817 movff xC+0,divA+0
820 movff xC+1,divA+1 818 movff xC+1,divA+1