comparison code_part1/OSTC_code_asm_part1/surfmode.asm @ 21:73014f788032

1.60 stable rc1
author heinrichsweikamp
date Wed, 21 Apr 2010 17:37:30 +0200
parents 01510acaeb11
children 65d5b0c8da41
comparison
equal deleted inserted replaced
20:8824446f7241 21:73014f788032
81 clrf last_temperature+1 81 clrf last_temperature+1
82 82
83 movlw d'5' 83 movlw d'5'
84 movwf timeout_counter ; reload counter 84 movwf timeout_counter ; reload counter
85 85
86 call clear_LEDusb 86 bcf LED_blue
87 call clear_LEDy 87 bcf LED_red
88 bcf simulatormode_active ; Quit simulator mode (if active) 88 bcf simulatormode_active ; Quit simulator mode (if active)
89 bcf standalone_simulator ; Quit simulator mode (if active) 89 bcf standalone_simulator ; Quit simulator mode (if active)
90 WIN_TOP .0 90 WIN_TOP .0
91 WIN_LEFT .0 91 WIN_LEFT .0
92 WIN_FONT FT_SMALL 92 WIN_FONT FT_SMALL
227 tstfsz nofly_time+0 ; =0? 227 tstfsz nofly_time+0 ; =0?
228 return 228 return
229 tstfsz nofly_time+1 ; =0? 229 tstfsz nofly_time+1 ; =0?
230 return 230 return
231 bcf nofly_active ; Clear flag 231 bcf nofly_active ; Clear flag
232 call clear_LEDnofly 232 bcf LED_blue
233 incf nofly_time+0,F ; =1 233 incf nofly_time+0,F ; =1
234 return 234 return
235 235
236 calc_surface_interval: 236 calc_surface_interval:
237 movff int_O_desaturation_time+0,lo ; divide by 60... 237 movff int_O_desaturation_time+0,lo ; divide by 60...
251 addwfc surface_interval+1,F 251 addwfc surface_interval+1,F
252 return 252 return
253 253
254 set_leds_surfmode: 254 set_leds_surfmode:
255 btfsc nofly_active 255 btfsc nofly_active
256 call toggle_LEDnofly 256 btg LED_blue
257 return 257 return
258 258
259 calc_deko_surfmode: 259 calc_deko_surfmode:
260 call set_LEDg 260 bsf LED_red
261 ostc_debug 'I' ; Sends debug-information to screen if debugmode active 261 ostc_debug 'I' ; Sends debug-information to screen if debugmode active
262 262
263 movff last_surfpressure+0,int_I_pres_surface+0 ; copy surface air pressure to deco routine 263 movff last_surfpressure+0,int_I_pres_surface+0 ; copy surface air pressure to deco routine
264 movff last_surfpressure+1,int_I_pres_surface+1 264 movff last_surfpressure+1,int_I_pres_surface+1
265 clrf wait_temp ; Use as buffer 265 clrf wait_temp ; Use as buffer
278 movff wait_temp,char_I_desaturation_multiplier 278 movff wait_temp,char_I_desaturation_multiplier
279 279
280 call deco_main_calc_wo_deco_step_1_m ; calculate deco in surface mode 280 call deco_main_calc_wo_deco_step_1_m ; calculate deco in surface mode
281 movlb b'00000001' ; select ram bank 1 281 movlb b'00000001' ; select ram bank 1
282 ostc_debug 'J' ; Sends debug-information to screen if debugmode active 282 ostc_debug 'J' ; Sends debug-information to screen if debugmode active
283 call clear_LEDg 283 bcf LED_red
284 return 284 return
285 285
286 286
287 test_charger: 287 test_charger:
288 bcf TRISC,1 ; CHRG_OUT output 288 bcf TRISC,1 ; CHRG_OUT output
377 movff temp2,EEDATA 377 movff temp2,EEDATA
378 write_int_eeprom d'51' ; write byte stored in EEDATA 378 write_int_eeprom d'51' ; write byte stored in EEDATA
379 return 379 return
380 380
381 show_cv_active: ; CV mode 381 show_cv_active: ; CV mode
382 call set_LEDr 382 bsf LED_red
383 WAITMS d'100' 383 WAITMS d'100'
384 call clear_LEDr 384 bcf LED_red
385 WAITMS d'100' 385 WAITMS d'100'
386 call set_LEDr 386 bsf LED_red
387 bsf charge_done ; Charge cycle finished 387 bsf charge_done ; Charge cycle finished
388 return 388 return
389 389
390 show_cc_active: ; CC mode 390 show_cc_active: ; CC mode
391 call set_LEDr 391 bsf LED_red
392 bsf charge_started ; Charger started in CC mode 392 bsf charge_started ; Charger started in CC mode
393 bcf charge_done ; Charge cycle not finished 393 bcf charge_done ; Charge cycle not finished
394 return 394 return
395 395
396 396