comparison code_part1/OSTC_code_asm_part1/surfmode.asm @ 416:3abf9d7dafae

diabling uart module when no USB is attached
author heinrichsweikamp
date Mon, 18 Jul 2011 09:44:25 +0200
parents 6f7965ec5f49
children 38b38b105782
comparison
equal deleted inserted replaced
415:d022c62a1df5 416:3abf9d7dafae
29 movff lo,char_I_const_ppO2 ; reset to standard mode, OSTC assumes Air breathing at the surface! 29 movff lo,char_I_const_ppO2 ; reset to standard mode, OSTC assumes Air breathing at the surface!
30 30
31 call PLED_brightness_full ;max. brightness 31 call PLED_brightness_full ;max. brightness
32 32
33 call I2CReset 33 call I2CReset
34 call enable_rs232
35 call PLED_boot 34 call PLED_boot
36 call PLED_serial ; Show OSTC serial and firmware version 35 call PLED_serial ; Show OSTC serial and firmware version
37 call PLED_clock ; display time 36 call PLED_clock ; display time
38 call update_date ; display date 37 call update_date ; display date
39 movff last_surfpressure_30min+0,int_I_pres_respiration+0 ; copy surface air pressure to deco routine 38 movff last_surfpressure_30min+0,int_I_pres_respiration+0 ; copy surface air pressure to deco routine
326 btfsc cv_active 325 btfsc cv_active
327 bra show_cv_active 326 bra show_cv_active
328 327
329 bsf TRISC,1 ; CHRG_OUT high impedance 328 bsf TRISC,1 ; CHRG_OUT high impedance
330 329
331 ; Charger inactive or ready 330 ; -> Charger inactive or ready
331
332 ; Disable when no USB power is attached
333 btfsc RCSTA,7 ; RS232 already disabled
334 call disable_rs232 ; No, disable UART module
335
332 btfss charge_done ; charge done? 336 btfss charge_done ; charge done?
333 bra test_charger2 ; No, add incomplete cycle! 337 bra test_charger2 ; No, add incomplete cycle!
334 338
335 ; Yes, store all data for complete cycle 339 ; Yes, store all data for complete cycle
336 bcf charge_started ; Clear flag 340 bcf charge_started ; Clear flag
394 movff temp2,EEDATA 398 movff temp2,EEDATA
395 write_int_eeprom d'51' ; write byte stored in EEDATA 399 write_int_eeprom d'51' ; write byte stored in EEDATA
396 return 400 return
397 401
398 show_cv_active: ; CV mode 402 show_cv_active: ; CV mode
403 ; Enable only when USB power attached
404 btfss RCSTA,7 ; RS232 already enabled?
405 call enable_rs232 ; No, start UART module
399 bsf LED_red 406 bsf LED_red
400 WAITMS d'100' 407 WAITMS d'100'
401 bcf LED_red 408 bcf LED_red
402 WAITMS d'100' 409 WAITMS d'100'
403 bsf LED_red 410 bsf LED_red
404 bsf charge_done ; Charge cycle finished 411 bsf charge_done ; Charge cycle finished
405 return 412 return
406 413
407 show_cc_active: ; CC mode 414 show_cc_active: ; CC mode
415 ; Enable only when USB power attached
416 btfss RCSTA,7 ; RS232 already enabled?
417 call enable_rs232 ; No, start UART module
408 bsf LED_red 418 bsf LED_red
409 bsf charge_started ; Charger started in CC mode 419 bsf charge_started ; Charger started in CC mode
410 bcf charge_done ; Charge cycle not finished 420 bcf charge_done ; Charge cycle not finished
411 return 421 return
412 422