# HG changeset patch
# User heinrichsweikamp
# Date 1397680269 -7200
# Node ID 7ca1105751c7795d345ac47261ec330f05b04aa0
# Parent 917393caf55916358acdabbf75c3800f1fbdebac
add sensor calibration option (PC only), some cleanup
diff -r 917393caf559 -r 7ca1105751c7 doc/ostc3_interface.odt
Binary file doc/ostc3_interface.odt has changed
diff -r 917393caf559 -r 7ca1105751c7 src/changelog.txt
--- a/src/changelog.txt Tue Apr 15 15:08:16 2014 +0200
+++ b/src/changelog.txt Wed Apr 16 22:31:09 2014 +0200
@@ -2,6 +2,7 @@
BUGFIX: No average depth for end-of-dive portion (<1m)
BUGFIX: Show "CC Diluents" in logbook instead of OC Gas List
NEW: automatic compass gain makes calibration quicker
+CHANGE: Battery percent setpoints adjusted to worst case current consumption
New in 1.24:
CHANGE: Minor french translation
diff -r 917393caf559 -r 7ca1105751c7 src/comm.asm
--- a/src/comm.asm Tue Apr 15 15:08:16 2014 +0200
+++ b/src/comm.asm Wed Apr 16 22:31:09 2014 +0200
@@ -627,7 +627,7 @@
call rs232_get_byte
btfsc rs232_recieve_overflow ; Got byte?
return ; No, abort!
- rcall comm_check_day ; Check day
+ call comm_check_day ; Check day
call rs232_get_byte
btfsc rs232_recieve_overflow ; Got byte?
return ; No, abort!
@@ -920,6 +920,8 @@
bra comm_read_date_format ; RCREG1=0x33
dcfsnz WREG
bra comm_read_compass_gain ; RCREG1=0x34
+ dcfsnz WREG
+ bra comm_read_pressure_adjust ; RCREG1=0x35
@@ -1142,6 +1144,10 @@
movff opt_compass_gain, TXREG1
rcall comm_read_setting_wait ; Wait for UART
bra comm_download_mode0 ; Done. Loop with timeout reset
+comm_read_pressure_adjust:
+ movff opt_pressure_adjust, TXREG1
+ rcall comm_read_setting_wait ; Wait for UART
+ bra comm_download_mode0 ; Done. Loop with timeout reset
;-----------------------------------------------------------------------------
@@ -1259,6 +1265,8 @@
bra comm_write_date_format ; RCREG1=0x33
dcfsnz WREG
bra comm_write_compass_gain ; RCREG1=0x34
+ dcfsnz WREG
+ bra comm_write_pressure_adjust ; RCREG1=0x35
comm_write_unused:
comm_write_abort:
@@ -1493,6 +1501,10 @@
call rs232_get_byte
movff RCREG1, opt_compass_gain
bra comm_write_abort ; Done. Loop with timeout reset
+comm_write_pressure_adjust:
+ call rs232_get_byte
+ movff RCREG1, opt_pressure_adjust
+ bra comm_write_abort ; Done. Loop with timeout reset
;-----------------------------------------------------------------------------
diff -r 917393caf559 -r 7ca1105751c7 src/ms5541.asm
--- a/src/ms5541.asm Tue Apr 15 15:08:16 2014 +0200
+++ b/src/ms5541.asm Wed Apr 16 22:31:09 2014 +0200
@@ -138,6 +138,37 @@
movlw HIGH(.1000)
addwfc isr_xC+2,F
+ ; Add opt_pressure_adjust to result (SIGNED!)
+ movff opt_pressure_adjust,isr_xC+0
+
+ btfss isr_xC+0,7 ; <0?
+ bra pressure_extra_add ; No
+ ; Yes
+ comf isr_xC+0,F
+ incf isr_xC+0,F
+ ; Check for max. of 20mbar
+ movlw .21
+ cpfslt isr_xC+0
+ clrf isr_xC+0
+ ; Subtract
+ movf isr_xC+0,W
+ subwf isr_xC+1,F
+ movlw .0
+ subwfb isr_xC+2,F
+ bra pressure_extra_common
+
+pressure_extra_add:
+ ; Check for max. of 20mbar
+ movlw .21
+ cpfslt isr_xC+0
+ clrf isr_xC+0
+ ; Add
+ movf isr_xC+0,W
+ addwf isr_xC+1,F
+ movlw .0
+ addwfc isr_xC+2,F
+
+pressure_extra_common:
banksel common
btfss simulatormode_active ; are we in simulator mode?
bra calc_compensation_2 ; no
diff -r 917393caf559 -r 7ca1105751c7 src/options.asm
--- a/src/options.asm Tue Apr 15 15:08:16 2014 +0200
+++ b/src/options.asm Wed Apr 16 22:31:09 2014 +0200
@@ -618,7 +618,8 @@
OPTION_UINT8 oDil5Depth, .0, .100, .0, tMeters, .84, char_I_dil_change+4
OPTION_STRING oName, opt_name_length, tDefName, .85, opt_name
; opt_name from 85 to 145
- OPTION_ENUM8 oColorSetDive, 4, 0, tColorSetName0, .146, opt_dive_color_scheme ; Color scheme divemode
+ OPTION_ENUM8 oColorSetDive, 4, 0, tColorSetName0, .146, opt_dive_color_scheme ; Color scheme divemode
+ OPTION_UINT8 oPressureAdjust, .0,.255, .0, -1, .147, opt_pressure_adjust ; SIGNED int (-20/+20mbar max.)
; Set Time/Set Date
OPTION_UINT8 oSetHours, .0, .23, .0, 0, -1, hours
diff -r 917393caf559 -r 7ca1105751c7 src/ostc3.inc
--- a/src/ostc3.inc Tue Apr 15 15:08:16 2014 +0200
+++ b/src/ostc3.inc Wed Apr 16 22:31:09 2014 +0200
@@ -150,11 +150,11 @@
#DEFINE color_code_battery_low .10 ; [%]
#DEFINE battery_show_level .24 ; [%]
-; 3,6V battery sensing data points at 55mA load
-#DEFINE lithium_36v_75 .3100 ; [mV]
-#DEFINE lithium_36v_50 .3000 ; [mV]
-#DEFINE lithium_36v_25 .2900 ; [mV]
-#DEFINE lithium_36v_10 .2600 ; [mV]
+; 3,6V battery sensing data points at 70mA load
+#DEFINE lithium_36v_75 .3000 ; [mV]
+#DEFINE lithium_36v_50 .2900 ; [mV]
+#DEFINE lithium_36v_25 .2600 ; [mV]
+#DEFINE lithium_36v_10 .2500 ; [mV]
#DEFINE current_sleepmode .62
#DEFINE current_backlight_multi .115 ; *CCPR1L+current_backlight_offset
@@ -515,6 +515,7 @@
opt_compass_gain res 1 ; 0-7 (230LSB/Gauss to 1370LSB/Gaus)
opt_sampling_rate res 1 ; =1: 10s, =0: 2s
opt_dive_color_scheme res 1 ; 0-3
+opt_pressure_adjust res 1 ; SIGNED int (two's complement), -20/+20mbar max.
;-----------------------------EEPROM DATA ------------------------------------
; Automatic reset of all options when this is changed:
diff -r 917393caf559 -r 7ca1105751c7 src/text_spanish.inc
--- a/src/text_spanish.inc Tue Apr 15 15:08:16 2014 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,277 +0,0 @@
-;=============================================================================
-;
-; File text_spanish.asm
-;
-; Spanish texts translation file.
-;
-; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
-;=============================================================================
-
-; Basic texts
- TCODE tNo, "No" ; No
- TCODE tYes, "Yes" ; Yes = No + 1
-
-; Surface-mode texts
- TCODE tBeta, "beta" ; beta
- TCODE tMenu, "