# HG changeset patch # User heinrichsweikamp # Date 1310975065 -7200 # Node ID 3abf9d7dafae8b5a1be2e57d9093d2e3062ceb02 # Parent d022c62a1df58658f75cbd5f8364f67e69137293 diabling uart module when no USB is attached diff -r d022c62a1df5 -r 3abf9d7dafae code_part1/OSTC_code_asm_part1/divemode.asm --- a/code_part1/OSTC_code_asm_part1/divemode.asm Sun Jul 17 17:23:25 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/divemode.asm Mon Jul 18 09:44:25 2011 +0200 @@ -383,40 +383,6 @@ btfss gaslist_active,4 ; Apply depth? clrf EEDATA ; No, clear! movff EEDATA,char_I_deco_gas_change+4 ; Yes! - -; Debugger -; call enable_rs232 -; movff char_I_deco_He_ratio+4,TXREG -; call rs232_wait_tx ; wait for UART -; movff char_I_deco_N2_ratio+4,TXREG -; call rs232_wait_tx ; wait for UART -; movff char_I_deco_He_ratio+3,TXREG -; call rs232_wait_tx ; wait for UART -; movff char_I_deco_N2_ratio+3,TXREG -; call rs232_wait_tx ; wait for UART -; movff char_I_deco_He_ratio+2,TXREG -; call rs232_wait_tx ; wait for UART -; movff char_I_deco_N2_ratio+2,TXREG -; call rs232_wait_tx ; wait for UART -; movff char_I_deco_He_ratio+1,TXREG -; call rs232_wait_tx ; wait for UART -; movff char_I_deco_N2_ratio+1,TXREG -; call rs232_wait_tx ; wait for UART -; movff char_I_deco_He_ratio,TXREG -; call rs232_wait_tx ; wait for UART -; movff char_I_deco_N2_ratio,TXREG -; call rs232_wait_tx ; wait for UART -; movff char_I_deco_gas_change5,TXREG -; call rs232_wait_tx ; wait for UART -; movff char_I_deco_gas_change4,TXREG -; call rs232_wait_tx ; wait for UART -; movff char_I_deco_gas_change3,TXREG -; call rs232_wait_tx ; wait for UART -; movff char_I_deco_gas_change2,TXREG -; call rs232_wait_tx ; wait for UART -; movff char_I_deco_gas_change,TXREG -; call rs232_wait_tx ; wait for UART - return ;----------------------------------------------------------------------------- diff -r d022c62a1df5 -r 3abf9d7dafae code_part1/OSTC_code_asm_part1/menu_logbook.asm --- a/code_part1/OSTC_code_asm_part1/menu_logbook.asm Sun Jul 17 17:23:25 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/menu_logbook.asm Mon Jul 18 09:44:25 2011 +0200 @@ -29,7 +29,6 @@ menu_logbook: bcf return_from_profileview ; clear some flags -;call enable_rs232 menu_logbook1: bcf logbook_header_drawn call PLED_ClearScreen ; Clear screen diff -r d022c62a1df5 -r 3abf9d7dafae code_part1/OSTC_code_asm_part1/surfmode.asm --- a/code_part1/OSTC_code_asm_part1/surfmode.asm Sun Jul 17 17:23:25 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/surfmode.asm Mon Jul 18 09:44:25 2011 +0200 @@ -31,7 +31,6 @@ call PLED_brightness_full ;max. brightness call I2CReset - call enable_rs232 call PLED_boot call PLED_serial ; Show OSTC serial and firmware version call PLED_clock ; display time @@ -328,7 +327,12 @@ bsf TRISC,1 ; CHRG_OUT high impedance - ; Charger inactive or ready + ; -> Charger inactive or ready + + ; Disable when no USB power is attached + btfsc RCSTA,7 ; RS232 already disabled + call disable_rs232 ; No, disable UART module + btfss charge_done ; charge done? bra test_charger2 ; No, add incomplete cycle! @@ -396,6 +400,9 @@ return show_cv_active: ; CV mode + ; Enable only when USB power attached + btfss RCSTA,7 ; RS232 already enabled? + call enable_rs232 ; No, start UART module bsf LED_red WAITMS d'100' bcf LED_red @@ -405,6 +412,9 @@ return show_cc_active: ; CC mode + ; Enable only when USB power attached + btfss RCSTA,7 ; RS232 already enabled? + call enable_rs232 ; No, start UART module bsf LED_red bsf charge_started ; Charger started in CC mode bcf charge_done ; Charge cycle not finished