# HG changeset patch # User heinrichsweikamp # Date 1409236495 -7200 # Node ID 380a07e4fc15fb291d9e8c30bab4d61aad184254 # Parent 9eba1eb8ca38b532cad44ff10e9c53f996558c30 work on new battery information output diff -r 9eba1eb8ca38 -r 380a07e4fc15 code_part1/OSTC_code_asm_part1/changelog.txt --- a/code_part1/OSTC_code_asm_part1/changelog.txt Mon Aug 11 12:18:48 2014 +0200 +++ b/code_part1/OSTC_code_asm_part1/changelog.txt Thu Aug 28 16:34:55 2014 +0200 @@ -1,6 +1,7 @@ New in 2.94: BETA Version BUGFIX: False bailout flag in logbook +NEW: On-Time counter for better battery information New in 2.93: BETA Version diff -r 9eba1eb8ca38 -r 380a07e4fc15 code_part1/OSTC_code_asm_part1/definitions.asm --- a/code_part1/OSTC_code_asm_part1/definitions.asm Mon Aug 11 12:18:48 2014 +0200 +++ b/code_part1/OSTC_code_asm_part1/definitions.asm Thu Aug 28 16:34:55 2014 +0200 @@ -339,7 +339,7 @@ active_gas res 1 ; Holds number of active gas (1-5) active_diluent res 1 ; Holds number of active diluent (1-5) -debug_char res 6 ; For debugmode +debug_char res 6 ; For debugmode apnoe_mins res 1 ; single descent minutes for Apnoe mode apnoe_secs res 1 ; single descent seconds for Apnoe mode @@ -370,6 +370,7 @@ sim_btm_depth res 1 ; Simulated max depth sim_CNS res 1 ; Backup CNS value during decoplanning. +on_time_seconds res 3 ; Counts on-time seconds since last full charge ASSERT_BANK1 MACRO tag diff -r 9eba1eb8ca38 -r 380a07e4fc15 code_part1/OSTC_code_asm_part1/isr.asm --- a/code_part1/OSTC_code_asm_part1/isr.asm Mon Aug 11 12:18:48 2014 +0200 +++ b/code_part1/OSTC_code_asm_part1/isr.asm Thu Aug 28 16:34:55 2014 +0200 @@ -334,6 +334,16 @@ clrf timer1int_counter1 ; counts to 16 (one second / 62.5ms) bsf onesecupdate ; we have a new second! + btfsc sleepmode ; are we in sleep mode? + bra RTCisr0 ; Yes + + movlw .1 + addwf on_time_seconds+0,F + movlw .0 + addwfc on_time_seconds+1,F + addwfc on_time_seconds+2,F ; Increase counter + +RTCisr0: bcf STATUS,Z ; are we in dive mode? btfss divemode bra RTCisr2 ; No, must be surface or sleepmode diff -r 9eba1eb8ca38 -r 380a07e4fc15 code_part1/OSTC_code_asm_part1/surfmode.asm --- a/code_part1/OSTC_code_asm_part1/surfmode.asm Mon Aug 11 12:18:48 2014 +0200 +++ b/code_part1/OSTC_code_asm_part1/surfmode.asm Thu Aug 28 16:34:55 2014 +0200 @@ -315,6 +315,11 @@ bra test_charger2 ; No, add incomplete cycle! ; Yes, store all data for complete cycle + + clrf on_time_seconds+0 + clrf on_time_seconds+1 + clrf on_time_seconds+2 ; Clear on-time counter + bcf charge_started ; Clear flag bcf charge_done ; Clear flag ; Store incomplete cycles