annotate code_part1/OSTC_code_asm_part1/menu_reset.asm @ 838:2750099bf5bb

3.15 release
author heinrichsweikamp
date Tue, 19 Jan 2021 12:57:23 +0100
parents 69bc5feca5da
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1
815
2a0e5d884fc3 BUGFIX: Fix licence in German
heinrichsweikamp
parents: 807
diff changeset
2 ; OSTC Mk.2, 2N and 2C - diving computer code
807
c50296c3059e BUGFIX: Divetime had unwanted "." behind the minutes
heinrichsweikamp
parents: 791
diff changeset
3 ; Copyright (C) 2015 HeinrichsWeikamp GbR
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
5 ; This program is free software: you can redistribute it and/or modify
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
6 ; it under the terms of the GNU General Public License as published by
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
7 ; the Free Software Foundation, either version 3 of the License, or
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
8 ; (at your option) any later version.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
9
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
10 ; This program is distributed in the hope that it will be useful,
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
11 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
12 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
13 ; GNU General Public License for more details.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
14
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
15 ; You should have received a copy of the GNU General Public License
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
16 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
17
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
18
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
19 ; Menu "Reset all"
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
20 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
21 ; written: 10/30/05
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
22 ; last updated: 10/12/08 by JD Gascuel at free.fr
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
23 ; known bugs:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
24 ; ToDo:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
25
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
26 ; routines to reset external EEPROM (currently inactvated!)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
27 ; routines to reset custom function, gases and decompression values
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
28 ; does not reset clock
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
29
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
30 ;=============================================================================
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
31 ; CF default values
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
32 ;
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
33
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
34 ; Macro to check values, and construct PROM CF default table.
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
35 ; If in types mode, set flags into hi. If not, clear it.
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
36 CF_DEFAULT macro type, default, min, max
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
37 noexpand
99
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
38 CFn set 1+CFn
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
39 if (type) == CF_INT15
99
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
40 if HIGH (default) > .127
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
41 error CF#v(CFn) "15bit default too big: ", default
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
42 endif
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
43 if (min)>0 && (max>min)
99
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
44 error CF#v(CFn) "15bit defaults cannot have both MIN & MAX flags"
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
45 endif
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
46 if HIGH(min) > .127
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
47 error CF#v(CFn) "15bit MIN value too big: ", min
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
48 endif
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
49 if HIGH(max) > .127
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
50 error CF#v(CFn) "15bit MAX value too big: ", max
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
51 endif
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
52
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
53 ifdef NO_CF_TYPES
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
54 DB LOW (default), HIGH(default) + 0x80
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
55 else
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
56 DB LOW (default), HIGH(default) + 0x80
99
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
57 if (max) > (min)
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
58 DB LOW(max), HIGH(max) + 0x80
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
59 else
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
60 DB LOW(min), HIGH(min)
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
61 endif
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
62 endif
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
63 else
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
64 ; Basic sanity check for 8bit values:
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
65 if HIGH(default) > 0
99
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
66 error CF#v(CFn) "8bit default too big: ", default
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
67 endif
355
f49d6f0fc870 Allow negatif CF:
JeanDo
parents: 341
diff changeset
68 if type & CF_NEG
f49d6f0fc870 Allow negatif CF:
JeanDo
parents: 341
diff changeset
69 if HIGH(-min) != 0
f49d6f0fc870 Allow negatif CF:
JeanDo
parents: 341
diff changeset
70 error CF#v(CFn) "8bit negativ min too big: ", min
f49d6f0fc870 Allow negatif CF:
JeanDo
parents: 341
diff changeset
71 endif
f49d6f0fc870 Allow negatif CF:
JeanDo
parents: 341
diff changeset
72 else
f49d6f0fc870 Allow negatif CF:
JeanDo
parents: 341
diff changeset
73 if HIGH(min) != 0
f49d6f0fc870 Allow negatif CF:
JeanDo
parents: 341
diff changeset
74 error CF#v(CFn) "8bit min too big: ", min
f49d6f0fc870 Allow negatif CF:
JeanDo
parents: 341
diff changeset
75 endif
f49d6f0fc870 Allow negatif CF:
JeanDo
parents: 341
diff changeset
76 endif
f49d6f0fc870 Allow negatif CF:
JeanDo
parents: 341
diff changeset
77 if HIGH(max) != 0
99
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
78 error CF#v(CFn) "8bit max too big: ", max
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
79 endif
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
80 if ((type)==CF_BOOL) && ( (default)>1 )
99
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
81 error CF#v(CFn) "BOOL default too big: ", default
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
82 endif
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
83 if ((type)==CF_BOOL) && ( (min)>0 || (max)>0 )
99
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
84 error CF#v(CFn) "BOOL cannot have min/max"
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
85 endif
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
87 ifdef NO_CF_TYPES
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
88 DB LOW(default), 0
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
89 else
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
90 local typeFlags
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
91 typeFlags set type
355
f49d6f0fc870 Allow negatif CF:
JeanDo
parents: 341
diff changeset
92 if (min)!=0
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
93 typeFlags set type + CF_MIN
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
94 endif
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
95 if (max)>(min)
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
96 typeFlags set typeFlags + CF_MAX
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
97 endif
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
98 DB LOW(default), (typeFlags), LOW(min), LOW(max)
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
99 endif
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
100 endif
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
101 expand
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
102 endm
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
103
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
104 ; Starting at CF0
99
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
105 CFn set -1
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
106
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
107 ; resets all customfunctions to the following default values
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
108 cf_default_table0:
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
109 ;---- BANK0 custom function defaults -------------------------------------
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
110 ; DEFAULT MIN MAX
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
111 CF_DEFAULT CF_CENTI, d'100', d'50', d'250' ; CF00 dive_threshold 100cm
621
e7b675c28896 2.29beta release
heinrichsweikamp
parents: 619
diff changeset
112 CF_DEFAULT CF_CENTI, d'75', d'20', d'100' ; CF01 surf_threshold 75cm
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
113 CF_DEFAULT CF_INT15, d'240', d'0', d'600' ; CF02 diveloop_timeout 240s
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
114 CF_DEFAULT CF_SEC, d'120', d'30', d'240' ; CF03 surfloop_timeout 120s
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
115 CF_DEFAULT CF_SEC, d'5', d'1', d'30' ; CF04 premenu_timeout 5s
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
116
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
117 CF_DEFAULT CF_INT8, d'7', d'3', d'18' ; CF05 minimum_velocity 7min/min
398
ab962c4b19d6 Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents: 392
diff changeset
118 CF_DEFAULT CF_INT15, d'1160',d'950', 0 ; pressure_offset_divemode 1160mbar
ab962c4b19d6 Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents: 392
diff changeset
119 CF_DEFAULT CF_INT15, d'1080',d'1080', 0 ; max_surfpressure 1080mbar
105
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 100
diff changeset
120 CF_DEFAULT CF_PERCENT, d'20', d'1', d'99' ; min_gradient_factor 20%
173
4a7a778d9e49 CF09 limits
heinrichsweikamp
parents: 169
diff changeset
121 CF_DEFAULT CF_PERCENT, d'20', d'1', d'22' ; oxygen_threshold 22%
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
122
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
123 CF_DEFAULT CF_SEC, d'45', d'5', d'60' ; CF10 dive_menu_timeout 45s
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
124 CF_DEFAULT CF_PERCENT, d'110', d'110', d'200' ; saturation_multiplier x1.10
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
125 CF_DEFAULT CF_PERCENT, d'90', d'50', d'90' ; desaturation_multiplier x0.90
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
126 CF_DEFAULT CF_PERCENT, d'60', d'60', d'100' ; nofly_time_ratio 60%
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
127 CF_DEFAULT CF_PERCENT, d'100', d'50', d'100' ; gradient_factor_alarm1 100%
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
128
588
29b0a47249c5 CF16 update max for warning
heinrichsweikamp
parents: 587
diff changeset
129 CF_DEFAULT CF_PERCENT, d'10', d'0', d'100' ; CF15 cns_display_surface 10%
29b0a47249c5 CF16 update max for warning
heinrichsweikamp
parents: 587
diff changeset
130 CF_DEFAULT CF_DECI, d'10', d'0', d'20' ; CF16 deco_distance_for_sim 1m
677
683e7d821678 Set CF17 (ppo2_warning_low) low level to 0.16bar
heinrichsweikamp
parents: 675
diff changeset
131 CF_DEFAULT CF_CENTI, d'019', d'16', d'021' ; ppo2_warning_low 0.19 bar
398
ab962c4b19d6 Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents: 392
diff changeset
132 CF_DEFAULT CF_CENTI, d'160', d'0', d'160' ; ppo2_warning_high 1.60 bar
ab962c4b19d6 Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents: 392
diff changeset
133 CF_DEFAULT CF_CENTI, d'140', d'0', d'150' ; ppo2_display_high 1.40 bar
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
134
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
135 CF_DEFAULT CF_INT8, d'10', d'1', d'120' ; CF20 sampling_rate 10s
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
136 CF_DEFAULT CF_INT8, d'6', d'0', d'15' ; sampling_divisor_temp /6
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
137 CF_DEFAULT CF_INT8, d'6', d'0', d'15' ; sampling_divisor_deco /6
374
6ee9c849ad92 GF profile. GF and Decotype in Logbok
Heinrichsweikamp
parents: 361
diff changeset
138 CF_DEFAULT CF_INT8, d'6', d'0', d'15' ; sampling_divisor_gf /6
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
139 CF_DEFAULT CF_INT8, d'0', d'0', d'15' ; sampling_divisor_ppo2 never
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
140
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
141 CF_DEFAULT CF_INT8, d'0', d'0', d'15' ; CF25 sampling_divisor_deco2 never
374
6ee9c849ad92 GF profile. GF and Decotype in Logbok
Heinrichsweikamp
parents: 361
diff changeset
142 CF_DEFAULT CF_INT8, d'12', d'0', d'15' ; sampling_divisor_cns /12
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
143 CF_DEFAULT CF_PERCENT, d'20', d'5', d'75' ; cns_display_high 20%
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
144 CF_DEFAULT CF_INT15, d'0', d'0', 0 ; logbook_offset No Offset, but 15Bit value
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
145 CF_DEFAULT CF_INT8, d'3', d'2', d'6' ; last_deco_depth 3m
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
146
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
147 CF_DEFAULT CF_SEC, d'10', d'1', d'15' ; CF30 timeout_apnoe_mode 10min
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
148 CF_DEFAULT CF_BOOL, d'0', 0, 0 ; CF31 show_voltage_value =1 Show value instead of symbol, =0 Show Symbol
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
149
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
150 ;---- BANK1 custom function defaults -------------------------------------
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
151 cf_default_table1:
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
152 ; DEFAULT MIN MAX
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
153 CF_DEFAULT CF_PERCENT, d'30', d'5', d'90' ; CF32 GF_low_default 30%
666
3282581fe178 Allow gf switch
heinrichsweikamp
parents: 621
diff changeset
154 CF_DEFAULT CF_PERCENT, d'85', d'30', d'95' ; CF33 GF_high_default 85%
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
155 CF_DEFAULT CF_COLOR, d'199', 0, 0 ; CF34 color_battery_surface Color Battery sign: Deep blue
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
156 CF_DEFAULT CF_COLOR, d'255', 0, 0 ; CF35 color_standard1 Color Standard: White
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
157 CF_DEFAULT CF_COLOR, d'62', 0, 0 ; CF36 color_divemask Color Divemask: Light green
99
39d325b2a5f9 FIX bad warning for 15bits CF values
JeanDo
parents: 98
diff changeset
158
492
19b9e19ea4da +CHANGE: Velocity display updated every second
heinrichsweikamp
parents: 478
diff changeset
159 CF_DEFAULT CF_COLOR, d'224', 0, 0 ; CF37 color_warnings Color Warnings: Red
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
160 CF_DEFAULT CF_BOOL, d'0', 0, 0 ; CF38 show_seconds_divemode =1 Show the seconds in Divemode
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
161 CF_DEFAULT CF_BOOL, 0, 0, 0 ; CF39 Adjust SetPoint if Diluent ppO2 > SetPoint
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
162 CF_DEFAULT CF_BOOL, d'1', 0, 0 ; CF40 warn_ceiling_divemode =1 Warn ceiling violation in divemode
680
c6220d340684 Removed "Mix type" Icons and CF43
heinrichsweikamp
parents: 677
diff changeset
163 CF_DEFAULT CF_BOOL, d'1', 0, 0 ; CF41 unused
128
4c588c3d1f12 Saturation graphs in customview divemode
JeanDo
parents: 125
diff changeset
164
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
165 CF_DEFAULT CF_BOOL, d'1', 0, 0 ; CF42 blink_gas_divemode =1 blink better gas
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
166 CF_DEFAULT CF_INT15, d'13000', 0, d'13000' ; CF43 color_warn_depth_mbar Warn depths
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
167 CF_DEFAULT CF_PERCENT, d'101', d'50', d'101' ; CF44 color_warn_cns_percent Warn-%
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
168 CF_DEFAULT CF_PERCENT, d'101', d'50', d'101' ; CF45 color_warn_gf_percent Warn-%
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
169 CF_DEFAULT CF_CENTI, d'161', d'100', d'161' ; CF46 color_warn_ppo2_cbar ppO2 warn
128
4c588c3d1f12 Saturation graphs in customview divemode
JeanDo
parents: 125
diff changeset
170
492
19b9e19ea4da +CHANGE: Velocity display updated every second
heinrichsweikamp
parents: 478
diff changeset
171 CF_DEFAULT CF_INT8, d'15', d'7', d'20' ; CF47 color_warn_celocity_mmin warn at xx m/min
19b9e19ea4da +CHANGE: Velocity display updated every second
heinrichsweikamp
parents: 478
diff changeset
172 CF_DEFAULT CF_SEC+CF_NEG,d'0', -d'120' ,d'120' ; CF48 time_correction_value_default Adds to Seconds on Midnight
476
7779bfa89171 Cave bailout prediction.
JeanDo
parents: 464
diff changeset
173 CF_DEFAULT CF_BOOL, d'0', 0, 0 ; CF49 Show Altimeter in surface mode
129
06c4899ddb4b Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents: 125
diff changeset
174 CF_DEFAULT CF_BOOL, d'0', 0, 0 ; CF50 Show Log-Marker
06c4899ddb4b Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents: 125
diff changeset
175 CF_DEFAULT CF_BOOL, d'1', 0, 0 ; CF51 Show Stopwatch
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
176
324
a86c9d1219ce ppO2 diluent (flush) color coded
Heinrichsweikamp
parents: 312
diff changeset
177 CF_DEFAULT CF_BOOL, d'0', 0, 0 ; CF52 Show Tissue Graph in Divemode
129
06c4899ddb4b Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents: 125
diff changeset
178 CF_DEFAULT CF_BOOL, d'0', 0, 0 ; CF53 Show Laeding Tissue in Divemode
197
f15e804ff67f Gas switch delay
JeanDo
parents: 173
diff changeset
179 CF_DEFAULT CF_BOOL, d'0', 0, 0 ; CF54 Display shallowest stop first
574
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
180 CF_DEFAULT CF_INT8, d'0', d'0', d'10' ; CF55 Gas switch additional delay
478
fd8266b511cc New SAC (CF56/CF57) in 5..50 l/min range (no more decimal).
JeanDo
parents: 476
diff changeset
181 CF_DEFAULT CF_INT8, d'20', d'5', d'50' ; CF56 Bottom gas usage (SAC l/min)
224
49c90c5d9603 Gas usage
JeanDo
parents: 197
diff changeset
182
478
fd8266b511cc New SAC (CF56/CF57) in 5..50 l/min range (no more decimal).
JeanDo
parents: 476
diff changeset
183 CF_DEFAULT CF_INT8, d'20', d'5', d'50' ; CF57 Ascent/deco gas usage (SAC l/min)
312
b7e4e74c0e17 New @5 variant: compute TTS if staying some extra time (CF58) at current depth.
JeanDo
parents: 309
diff changeset
184 CF_DEFAULT CF_INT8, d'0', d'0', d'10' ; CF58 TTS for extra time at current depth [min]
476
7779bfa89171 Cave bailout prediction.
JeanDo
parents: 464
diff changeset
185 CF_DEFAULT CF_INT15, d'0', d'0', d'7000' ; CF59 Cave conso warning [l]
781
9635f6276c3e Graphical velocity on by default
heinrichsweikamp
parents: 692
diff changeset
186 CF_DEFAULT CF_BOOL, 1, 0, 0 ; CF60 Show Graphical ascend speed indicator
552
44e9b961f156 Compute ppO2 for pSCR diving
heinrichsweikamp
parents: 517
diff changeset
187 CF_DEFAULT CF_BOOL, 0, 0, 0 ; CF61 Show pSCR ppO2
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
188
552
44e9b961f156 Compute ppO2 for pSCR diving
heinrichsweikamp
parents: 517
diff changeset
189 CF_DEFAULT CF_PERCENT, .4, .0, .100 ; CF62 pSCR O2 Drop
44e9b961f156 Compute ppO2 for pSCR diving
heinrichsweikamp
parents: 517
diff changeset
190 CF_DEFAULT CF_INT8, .10, .0, .100 ; CF63 pSCR counterlung ratio
609
bbf5e1506c39 2.27beta
heinrichsweikamp
parents: 605
diff changeset
191
bbf5e1506c39 2.27beta
heinrichsweikamp
parents: 605
diff changeset
192 ;---- BANK2 custom function defaults -------------------------------------
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
193 cf_default_table2:
692
82f71a73f450 indicate first gas in surfacemode
heinrichsweikamp
parents: 685
diff changeset
194 CF_DEFAULT CF_COLOR, d'103', 0, 0 ; CF64 color_inactive Color inactive: grey
598
f3735da18809 NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents: 588
diff changeset
195 CF_DEFAULT CF_BOOL, 0, 0, 0 ; CF65 Show safety stop
619
85e8e1501fd8 New CF66: Show GF in NDL (If GF > CF08)
heinrichsweikamp
parents: 618
diff changeset
196 CF_DEFAULT CF_BOOL, 0, 0, 0 ; CF66 Show GF in NDL (If GF > CF08)
666
3282581fe178 Allow gf switch
heinrichsweikamp
parents: 621
diff changeset
197 CF_DEFAULT CF_PERCENT, d'30', d'5', d'90' ; CF67 aGF_low_default 30%
3282581fe178 Allow gf switch
heinrichsweikamp
parents: 621
diff changeset
198 CF_DEFAULT CF_PERCENT, d'90', d'30', d'95' ; CF68 aGF_high_default 90%
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
199
666
3282581fe178 Allow gf switch
heinrichsweikamp
parents: 621
diff changeset
200 CF_DEFAULT CF_BOOL, 0, 0, 0 ; CF69 Allow GF change (Between GF and aGF)
675
0211d9b9f0ca NEW: CF70: Safety Stop Duration [s]
heinrichsweikamp
parents: 670
diff changeset
201 CF_DEFAULT CF_SEC, d'180', d'10', d'250' ; CF70 Safety Stop Duration [s]
0211d9b9f0ca NEW: CF70: Safety Stop Duration [s]
heinrichsweikamp
parents: 670
diff changeset
202 CF_DEFAULT CF_DECI, d'51', d'30', d'65' ; CF71 Safety Stop Start Depth [dm]
0211d9b9f0ca NEW: CF70: Safety Stop Duration [s]
heinrichsweikamp
parents: 670
diff changeset
203 CF_DEFAULT CF_DECI, d'29', d'25', d'50' ; CF72 Safety Stop End Depth [dm]
0211d9b9f0ca NEW: CF70: Safety Stop Duration [s]
heinrichsweikamp
parents: 670
diff changeset
204 CF_DEFAULT CF_DECI, d'101', d'75', d'201' ; CF73 Safety Stop Reset Depth [dm]
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
205
791
a652b0ff4dcf NEW: CF74: Battery Timeout [min] - Battery symbol will blink if the OSTC was
heinrichsweikamp
parents: 781
diff changeset
206 CF_DEFAULT CF_INT15, d'1800',d'0', d'3600' ; CF74 Battery Timeout [min]
574
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
207 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF75 unused
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
208 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF76 unused
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
209 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF77 unused
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
210 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF78 unused
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
211
574
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
212 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF79 unused
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
213 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF80 unused
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
214 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF81 unused
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
215 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF82 unused
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
216 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF83 unused
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
217
574
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
218 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF84 unused
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
219 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF85 unused
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
220 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF86 unused
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
221 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF87 unused
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
222 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF88 unused
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
223
574
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
224 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF89 unused
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
225 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF90 unused
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
226 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF91 unused
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
227 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF92 unused
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
228 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF93 unused
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
229
574
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
230 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF94 unused
101fec6a6137 New Custom Functions III menu (CF64-CF95)
heinrichsweikamp
parents: 573
diff changeset
231 CF_DEFAULT CF_INT8, d'0', d'0', d'0' ; CF95 unused
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
232 cf_default_table3:
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
233 ;=============================================================================
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
234
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
235 menu_reset:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
236 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
237 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
238
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 680
diff changeset
239 call DISP_ClearScreen
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 680
diff changeset
240 call DISP_reset_menu_mask
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
241
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
242 menu_reset2:
576
ab2686087bce faster font display, code cleaning
heinrichsweikamp
parents: 574
diff changeset
243 call menu_pre_loop_common ; Clear some menu flags, timeout and switches
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 680
diff changeset
244 call DISP_reset_menu_mask
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 680
diff changeset
245 call DISP_menu_cursor
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
246 menu_reset_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
247 call check_switches_menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
248 btfsc menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
249 bra do_menu_reset ; call submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
250 btfss menubit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
251 bra menu ; exit setup menu and return to main menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
252 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
253 call timeout_surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
254 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
255 call set_dive_modes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
256 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
257 call test_charger ; check if charger IC is active
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
258 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
259 call get_battery_voltage ; get battery voltage
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
260 bcf onesecupdate ; End of one second tasks
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
261 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
262 goto menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
263 btfsc divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
264 goto restart ; exit menu, restart and enter divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
265 bra menu_reset_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
266 do_menu_reset: ; calls submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
267 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
268 bra do_menu_reset_exit ; Cancel, exit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
269 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
270 bra do_menu_reset_all ; Reset all settings
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
271 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
272 bra do_menu_reset_logbook ; Reset Logbook Memory!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
273 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
274 bra do_menu_reset_reboot ; Reboot OSTC
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
275 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
276 bra do_menu_reset_decodata ; Reset Decodata
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
277 do_menu_reset_exit:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
278 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
279 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
280 bra menu2 ; exit...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
281
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
282
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
283 do_menu_reset_reboot:
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 680
diff changeset
284 call DISP_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK!
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
285 movwf menupos ; Used as temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
286 tstfsz menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
287 bra do_menu_reset_reboot2 ; Delete now!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
288 bra do_menu_reset_exit ; Cancel!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
289
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
290 do_menu_reset_reboot2:
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 680
diff changeset
291 call DISP_DisplayOff ; Power-down DISPLAY
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
292 movlw b'00000000' ; Bit6: PPL Disable
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
293 movwf OSCTUNE
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
294 movlw b'01111110' ; 8MHz
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
295 movwf OSCCON
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
296 reset
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
297 goto 0x00000 ; restart to 0x00000
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
298
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
299 do_menu_reset_logbook:
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 680
diff changeset
300 call DISP_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK!
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
301 movwf menupos ; Used as temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
302 tstfsz menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
303 bra do_menu_reset_logbook2 ; Delete Logbook now!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
304 bra do_menu_reset_exit ; Cancel!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
305
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
306 do_menu_reset_logbook2:
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 680
diff changeset
307 call DISP_ClearScreen
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
308 setf win_color1 ; Make sure to display in white color.
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
309 setf win_color2
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
310 DISPLAYTEXT .25 ; "Reset..."
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
311 call reset_external_eeprom ; delete profile memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
312 bra do_menu_reset_exit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
313
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
314 do_menu_reset_decodata:
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 680
diff changeset
315 call DISP_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK!
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
316 movwf menupos ; Used as temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
317 tstfsz menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
318 bra do_menu_reset_decodata2 ; Reset Deco Data now!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
319 bra do_menu_reset_exit ; Cancel!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
320
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
321 do_menu_reset_decodata2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
322 ; reset deco data
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 680
diff changeset
323 call DISP_ClearScreen
425
a76c5a3e9e96 Minor cleanups
JeanDo
parents: 422
diff changeset
324 DISPLAYTEXT .25 ; "Reset..."
411
e6e1b89b7c3e BUGFIX: CNS was not cleared with a "Reset Deco"
heinrichsweikamp
parents: 398
diff changeset
325
341
2144f19fa1eb BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents: 324
diff changeset
326 SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration ; copy surface air pressure to deco routine
411
e6e1b89b7c3e BUGFIX: CNS was not cleared with a "Reset Deco"
heinrichsweikamp
parents: 398
diff changeset
327 call deco_clear_tissue ; Reset Decodata
e6e1b89b7c3e BUGFIX: CNS was not cleared with a "Reset Deco"
heinrichsweikamp
parents: 398
diff changeset
328 call deco_calc_desaturation_time ; calculate desaturation time
e6e1b89b7c3e BUGFIX: CNS was not cleared with a "Reset Deco"
heinrichsweikamp
parents: 398
diff changeset
329 call deco_clear_CNS_fraction ; clear CNS
e6e1b89b7c3e BUGFIX: CNS was not cleared with a "Reset Deco"
heinrichsweikamp
parents: 398
diff changeset
330 movlb b'00000001' ; select ram bank 1
412
b2c9cc018671 small cleanup
heinrichsweikamp
parents: 411
diff changeset
331 clrf nofly_time+0 ; Reset NoFly
b2c9cc018671 small cleanup
heinrichsweikamp
parents: 411
diff changeset
332 clrf nofly_time+1 ; Reset NoFly
b2c9cc018671 small cleanup
heinrichsweikamp
parents: 411
diff changeset
333 bcf nofly_active ; Clear flag
422
193520542496 fix ram banking in "Reset all"
heinrichsweikamp
parents: 412
diff changeset
334 goto restart ; done. quit to surfmode
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
335
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
336 do_menu_reset_all:
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 680
diff changeset
337 call DISP_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK!
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
338 movwf menupos ; Used as temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
339 tstfsz menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
340 bra do_menu_reset_all2 ; Reset all now!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
341 bra do_menu_reset_exit ; Cancel!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
342
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
343 do_menu_reset_all2:
681
6e456a6398e0 Hardware4 support
heinrichsweikamp
parents: 680
diff changeset
344 call DISP_ClearScreen
507
ed51a7a89d9a minor cleanups for TESTING mode
JeanDo
parents: 492
diff changeset
345 DISPLAYTEXT .25 ; "Reset..."
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
346
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
347 reset_start:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
348 ; reset deco data
341
2144f19fa1eb BUGFIX protect against ISR changing pressure/temperature while reading it.
JeanDo
parents: 324
diff changeset
349 SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration ; copy surface air pressure to deco routine
411
e6e1b89b7c3e BUGFIX: CNS was not cleared with a "Reset Deco"
heinrichsweikamp
parents: 398
diff changeset
350 call deco_clear_tissue ; Reset Decodata
e6e1b89b7c3e BUGFIX: CNS was not cleared with a "Reset Deco"
heinrichsweikamp
parents: 398
diff changeset
351 call deco_calc_desaturation_time ; calculate desaturation time
e6e1b89b7c3e BUGFIX: CNS was not cleared with a "Reset Deco"
heinrichsweikamp
parents: 398
diff changeset
352 call deco_clear_CNS_fraction ; clear CNS
422
193520542496 fix ram banking in "Reset all"
heinrichsweikamp
parents: 412
diff changeset
353 movlb b'00000001' ; select ram bank 1
412
b2c9cc018671 small cleanup
heinrichsweikamp
parents: 411
diff changeset
354 clrf nofly_time+0 ; Reset NoFly
b2c9cc018671 small cleanup
heinrichsweikamp
parents: 411
diff changeset
355 clrf nofly_time+1 ; Reset NoFly
b2c9cc018671 small cleanup
heinrichsweikamp
parents: 411
diff changeset
356 bcf nofly_active ; Clear flag
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
357
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
358 ; reset gases
464
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
359 rcall reset_gases
507
ed51a7a89d9a minor cleanups for TESTING mode
JeanDo
parents: 492
diff changeset
360 rcall reset_all_cf
ed51a7a89d9a minor cleanups for TESTING mode
JeanDo
parents: 492
diff changeset
361 goto restart ; all reset, quit to surfmode
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
362
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
363 reset_all_cf:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
364 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
365 movwf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
366 write_int_eeprom d'33' ; reset start gas
670
92e1690ecc84 2.57beta release
heinrichsweikamp
parents: 666
diff changeset
367 movlw d'4' ; Default is L16-GF OC
92e1690ecc84 2.57beta release
heinrichsweikamp
parents: 666
diff changeset
368 movwf EEDATA
92e1690ecc84 2.57beta release
heinrichsweikamp
parents: 666
diff changeset
369 write_int_eeprom d'34' ; reset deco model
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
370 clrf EEDATA
309
2f21f7a77608 moved cf warning to upper right corner
heinrichsweikamp
parents: 306
diff changeset
371 write_int_eeprom d'35' ; unused in Mk.2
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
372
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
373 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
374 write_int_eeprom d'39' ; Disable Debugbode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
375 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
376 write_int_eeprom d'90' ; Disable Brightness offset? (Dim=1, Normal = 0)
140
87a53efbb5ba "beta" shown for beta versions
heinrichsweikamp
parents: 138
diff changeset
377
87a53efbb5ba "beta" shown for beta versions
heinrichsweikamp
parents: 138
diff changeset
378 movlw d'1'
157
heinrichsweikamp
parents: 140
diff changeset
379 movwf EEDATA
140
87a53efbb5ba "beta" shown for beta versions
heinrichsweikamp
parents: 138
diff changeset
380 write_int_eeprom d'91' ; Reset Date format to DD.MM.YY
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
381
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
382 movlw d'100'
157
heinrichsweikamp
parents: 140
diff changeset
383 movwf EEDATA
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
384 write_int_eeprom d'26' ; Salinity default: 1.00 kg/l
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
385
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
386 movlw b'00011111'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
387 movwf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
388 write_int_eeprom d'27' ; reset active gas flags
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
389
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
390 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
391 write_int_eeprom d'28' ; reset change depth gas #1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
392 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
393 write_int_eeprom d'29' ; reset change depth gas #2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
394 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
395 write_int_eeprom d'30' ; reset change depth gas #3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
396 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
397 write_int_eeprom d'31' ; reset change depth gas #4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
398 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
399 write_int_eeprom d'32' ; reset change depth gas #5
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
400
255
1efd59d689f8 small change in the set time menu, default setpoints set to 0.8, 1.0 and 1.2Bar
heinrichsweikamp
parents: 229
diff changeset
401 movlw d'80'
1efd59d689f8 small change in the set time menu, default setpoints set to 0.8, 1.0 and 1.2Bar
heinrichsweikamp
parents: 229
diff changeset
402 movwf EEDATA
398
ab962c4b19d6 Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents: 392
diff changeset
403 write_int_eeprom d'36' ; reset mix1 to ppO2=0.80bar
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
404 movlw d'100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
405 movwf EEDATA
398
ab962c4b19d6 Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents: 392
diff changeset
406 write_int_eeprom d'37' ; reset mix2 to ppO2=1.00bar
255
1efd59d689f8 small change in the set time menu, default setpoints set to 0.8, 1.0 and 1.2Bar
heinrichsweikamp
parents: 229
diff changeset
407 movlw d'120'
1efd59d689f8 small change in the set time menu, default setpoints set to 0.8, 1.0 and 1.2Bar
heinrichsweikamp
parents: 229
diff changeset
408 movwf EEDATA
398
ab962c4b19d6 Fixing issue 50, correct "Bar" to "bar" in texts and comments
heinrichsweikamp
parents: 392
diff changeset
409 write_int_eeprom d'38' ; reset mix3 to ppO2=1.20bar
817
e49a35ab7394 auto-SP work, auto-SP data stored in EEADR 116-119
heinrichsweikamp
parents: 815
diff changeset
410 ; Change depths to zero
e49a35ab7394 auto-SP work, auto-SP data stored in EEADR 116-119
heinrichsweikamp
parents: 815
diff changeset
411 clrf EEDATA
e49a35ab7394 auto-SP work, auto-SP data stored in EEADR 116-119
heinrichsweikamp
parents: 815
diff changeset
412 write_int_eeprom d'117'
e49a35ab7394 auto-SP work, auto-SP data stored in EEADR 116-119
heinrichsweikamp
parents: 815
diff changeset
413 write_int_eeprom d'118'
e49a35ab7394 auto-SP work, auto-SP data stored in EEADR 116-119
heinrichsweikamp
parents: 815
diff changeset
414 write_int_eeprom d'119'
e49a35ab7394 auto-SP work, auto-SP data stored in EEADR 116-119
heinrichsweikamp
parents: 815
diff changeset
415 ; SP Mode (Manual)
e49a35ab7394 auto-SP work, auto-SP data stored in EEADR 116-119
heinrichsweikamp
parents: 815
diff changeset
416 write_int_eeprom d'116'
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
417
229
85ea09d3b9d8 Nofly should not be reset after dive simulation (bug BB18).
JeanDo
parents: 224
diff changeset
418 clrf nofly_time+0 ; Clear nofly time
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
419 clrf nofly_time+1 ; Clear nofly time
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
420
605
c3336f944e53 reset CFIII properly
heinrichsweikamp
parents: 598
diff changeset
421 reset_all_cf_bank0:
c3336f944e53 reset CFIII properly
heinrichsweikamp
parents: 598
diff changeset
422 clrf EEADRH ; EEPROM BANK 0
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
423 movlw d'127' ; address of low byte of first custom function
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
424 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
425
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
426 movlw LOW cf_default_table0 ; Load PROM pointer.
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
427 movwf TBLPTRL,A
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
428 movlw HIGH cf_default_table0
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
429 movwf TBLPTRH,A
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
430 movlw UPPER cf_default_table0
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
431 movwf TBLPTRU,A
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
432
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
433 cf_bank0_loop:
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
434 ; Did we already read 32 (decimal) words or double-words (with types) ?
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
435 movf TBLPTRL,W
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
436 sublw LOW (cf_default_table1)
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
437 bz reset_all_cf_bank1
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
438 rcall reset_customfunction ; saves default and current value
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
439 bra cf_bank0_loop
83
3e351e25f5d1 adding anti-aliased fonts frame and merging some patches from Jeando
heinrichsweikamp
parents: 79
diff changeset
440
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
441 reset_all_cf_bank1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
442 movlw d'1'
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
443 movwf EEADRH ; EEPROM BANK 1
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
444 movlw d'127' ; address of low byte of first custom function
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
445 movwf EEADR
609
bbf5e1506c39 2.27beta
heinrichsweikamp
parents: 605
diff changeset
446
bbf5e1506c39 2.27beta
heinrichsweikamp
parents: 605
diff changeset
447 movlw LOW cf_default_table1 ; Load PROM pointer.
bbf5e1506c39 2.27beta
heinrichsweikamp
parents: 605
diff changeset
448 movwf TBLPTRL,A
bbf5e1506c39 2.27beta
heinrichsweikamp
parents: 605
diff changeset
449 movlw HIGH cf_default_table1
bbf5e1506c39 2.27beta
heinrichsweikamp
parents: 605
diff changeset
450 movwf TBLPTRH,A
bbf5e1506c39 2.27beta
heinrichsweikamp
parents: 605
diff changeset
451 movlw UPPER cf_default_table1
bbf5e1506c39 2.27beta
heinrichsweikamp
parents: 605
diff changeset
452 movwf TBLPTRU,A
bbf5e1506c39 2.27beta
heinrichsweikamp
parents: 605
diff changeset
453
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
454
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
455 cf_bank1_loop:
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
456 ; Did we already read another 32 (decimal) words or double-words ?
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
457 movf TBLPTRL,W
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
458 sublw LOW (cf_default_table2)
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
459 bz reset_all_cf_bank2
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
460 rcall reset_customfunction ; saves default and current value
79
69c462400279 Making CF edition esier
JeanDo
parents: 69
diff changeset
461 bra cf_bank1_loop
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
462
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
463 reset_all_cf_bank2:
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
464 movlw d'2'
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
465 movwf EEADRH ; EEPROM BANK 2
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
466 movlw d'127' ; address of low byte of first custom function
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
467 movwf EEADR
609
bbf5e1506c39 2.27beta
heinrichsweikamp
parents: 605
diff changeset
468
bbf5e1506c39 2.27beta
heinrichsweikamp
parents: 605
diff changeset
469 movlw LOW cf_default_table2 ; Load PROM pointer.
bbf5e1506c39 2.27beta
heinrichsweikamp
parents: 605
diff changeset
470 movwf TBLPTRL,A
bbf5e1506c39 2.27beta
heinrichsweikamp
parents: 605
diff changeset
471 movlw HIGH cf_default_table2
bbf5e1506c39 2.27beta
heinrichsweikamp
parents: 605
diff changeset
472 movwf TBLPTRH,A
bbf5e1506c39 2.27beta
heinrichsweikamp
parents: 605
diff changeset
473 movlw UPPER cf_default_table2
bbf5e1506c39 2.27beta
heinrichsweikamp
parents: 605
diff changeset
474 movwf TBLPTRU,A
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
475
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
476 cf_bank2_loop:
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
477 ; Did we already read another 32 (decimal) words or double-words ?
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
478 movf TBLPTRL,W
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
479 sublw LOW (cf_default_table3)
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
480 bz cf_bank2_end
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
481 rcall reset_customfunction ; saves default and current value
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
482 bra cf_bank2_loop
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
483
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
484 cf_bank2_end:
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
485 clrf EEADRH ; EEPROM BANK 0
507
ed51a7a89d9a minor cleanups for TESTING mode
JeanDo
parents: 492
diff changeset
486 return
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
487
464
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
488 reset_gases:
573
77c8ff191cd7 Preparations for third bank of Custom Functions
heinrichsweikamp
parents: 552
diff changeset
489 clrf EEADRH ; EEPROM BANK 0
464
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
490
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
491 movlw d'3' ; address of first gas-1
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
492 movwf EEADR
677
683e7d821678 Set CF17 (ppo2_warning_low) low level to 0.16bar
heinrichsweikamp
parents: 675
diff changeset
493 clrf hi ; He part (default for all gases and diluents: 0%)
683e7d821678 Set CF17 (ppo2_warning_low) low level to 0.16bar
heinrichsweikamp
parents: 675
diff changeset
494 movlw .21
683e7d821678 Set CF17 (ppo2_warning_low) low level to 0.16bar
heinrichsweikamp
parents: 675
diff changeset
495 movwf lo ; O2 part (default for all gases and diluents: 21%)
464
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
496 rcall reset_gas ; saves current value for gas #1
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
497 rcall reset_gas ; saves default value for gas #1
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
498 rcall reset_gas ; saves current value for gas #2
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
499 rcall reset_gas ; saves default value for gas #2
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
500 rcall reset_gas ; saves current value for gas #3
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
501 rcall reset_gas ; saves default value for gas #3
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
502 rcall reset_gas ; saves current value for gas #4
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
503 rcall reset_gas ; saves default value for gas #4
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
504 rcall reset_gas ; saves current value for gas #5
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
505 rcall reset_gas ; saves default value for gas #5
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
506 rcall reset_gas ; saves current value for gas #6
677
683e7d821678 Set CF17 (ppo2_warning_low) low level to 0.16bar
heinrichsweikamp
parents: 675
diff changeset
507
685
aebb6d039249 Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents: 681
diff changeset
508 movlw d'94' ; address of first diluent-1
677
683e7d821678 Set CF17 (ppo2_warning_low) low level to 0.16bar
heinrichsweikamp
parents: 675
diff changeset
509 movwf EEADR
683e7d821678 Set CF17 (ppo2_warning_low) low level to 0.16bar
heinrichsweikamp
parents: 675
diff changeset
510 rcall reset_gas ; saves current value for diluent #1
685
aebb6d039249 Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents: 681
diff changeset
511 rcall reset_gas ; saves default value for diluent #1
677
683e7d821678 Set CF17 (ppo2_warning_low) low level to 0.16bar
heinrichsweikamp
parents: 675
diff changeset
512 rcall reset_gas ; saves current value for diluent #2
685
aebb6d039249 Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents: 681
diff changeset
513 rcall reset_gas ; saves default value for diluent #2
677
683e7d821678 Set CF17 (ppo2_warning_low) low level to 0.16bar
heinrichsweikamp
parents: 675
diff changeset
514 rcall reset_gas ; saves current value for diluent #3
685
aebb6d039249 Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents: 681
diff changeset
515 rcall reset_gas ; saves default value for diluent #3
677
683e7d821678 Set CF17 (ppo2_warning_low) low level to 0.16bar
heinrichsweikamp
parents: 675
diff changeset
516 rcall reset_gas ; saves current value for diluent #4
685
aebb6d039249 Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents: 681
diff changeset
517 rcall reset_gas ; saves default value for diluent #4
677
683e7d821678 Set CF17 (ppo2_warning_low) low level to 0.16bar
heinrichsweikamp
parents: 675
diff changeset
518 rcall reset_gas ; saves current value for diluent #5
685
aebb6d039249 Use 4byte in EEPROM for diluents (Same as OC gases)
heinrichsweikamp
parents: 681
diff changeset
519 rcall reset_gas ; saves default value for diluent #5
677
683e7d821678 Set CF17 (ppo2_warning_low) low level to 0.16bar
heinrichsweikamp
parents: 675
diff changeset
520
683e7d821678 Set CF17 (ppo2_warning_low) low level to 0.16bar
heinrichsweikamp
parents: 675
diff changeset
521 movlw .1
683e7d821678 Set CF17 (ppo2_warning_low) low level to 0.16bar
heinrichsweikamp
parents: 675
diff changeset
522 movwf EEDATA
683e7d821678 Set CF17 (ppo2_warning_low) low level to 0.16bar
heinrichsweikamp
parents: 675
diff changeset
523 write_int_eeprom .33 ; First Gas (1-5)
829
69bc5feca5da BUGFIX: "First Diluent" and "SP Mode" used same EEPROM location
heinrichsweikamp
parents: 817
diff changeset
524 write_int_eeprom .115 ; First Diluent (1-5)
464
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
525 return
6ad9af3a5771 Fix reset gas from 2.0stable
heinrichsweikamp
parents: 459
diff changeset
526
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
527 ; Write WREG:lo twice, w/o any type clearing, pre-incrementing EEADR
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
528 reset_gas:
459
770456638c66 fix reset gas with non-initialised eeprom
heinrichsweikamp
parents: 425
diff changeset
529 incf EEADR,F
677
683e7d821678 Set CF17 (ppo2_warning_low) low level to 0.16bar
heinrichsweikamp
parents: 675
diff changeset
530 movff lo, EEDATA ; O2 value
459
770456638c66 fix reset gas with non-initialised eeprom
heinrichsweikamp
parents: 425
diff changeset
531 call write_eeprom
770456638c66 fix reset gas with non-initialised eeprom
heinrichsweikamp
parents: 425
diff changeset
532 incf EEADR,F
677
683e7d821678 Set CF17 (ppo2_warning_low) low level to 0.16bar
heinrichsweikamp
parents: 675
diff changeset
533 movff hi, EEDATA ; He value
459
770456638c66 fix reset gas with non-initialised eeprom
heinrichsweikamp
parents: 425
diff changeset
534 call write_eeprom
770456638c66 fix reset gas with non-initialised eeprom
heinrichsweikamp
parents: 425
diff changeset
535 return
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
536
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
537 reset_customfunction:
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
538 tblrd*+
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
539 movff TABLAT, lo ; Low byte in lo,
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
540 tblrd*+
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
541 movff TABLAT, hi ; High byte in hi
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
542
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
543 ifndef NO_CF_TYPES
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
544 tblrd*+ ; Skip advanced min/max values.
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
545 tblrd*+
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
546 btfss hi,7 ; In EEPROM, just clear all types,
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
547 clrf hi ; to keep external program compat (jdivelog etc.)
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
548 bcf hi,7
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
549 endif
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
550
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
551 ; Manage the default/value tuple
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
552 rcall reset_eeprom_value ; First pair, untouched.
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
553 bcf hi,7 ; Just clear type bit.
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
554 bra reset_eeprom_value ; Second pair, cleared
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
555
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
556 ; Write the two bytes lo:hi into EEPROM
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
557 reset_eeprom_value:
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
558 incf EEADR,F
384
904863f96582 Work-Around for "Reset all" overwriting 0x00 to 0x04 in EEPROM Bank1
heinrichsweikamp
parents: 374
diff changeset
559 movff lo, EEDATA ; Lowbyte Default value
904863f96582 Work-Around for "Reset all" overwriting 0x00 to 0x04 in EEPROM Bank1
heinrichsweikamp
parents: 374
diff changeset
560
904863f96582 Work-Around for "Reset all" overwriting 0x00 to 0x04 in EEPROM Bank1
heinrichsweikamp
parents: 374
diff changeset
561 movlw d'127' ; Work-around to prevent writing at EEPROM 0x00 to 0x04
904863f96582 Work-Around for "Reset all" overwriting 0x00 to 0x04 in EEPROM Bank1
heinrichsweikamp
parents: 374
diff changeset
562 cpfslt EEADR ; EEADR > 127?
904863f96582 Work-Around for "Reset all" overwriting 0x00 to 0x04 in EEPROM Bank1
heinrichsweikamp
parents: 374
diff changeset
563 call write_eeprom ; Yes, write!
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
564
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
565 incf EEADR,F
86
b40a0a6284da adding custom functions with limits (jeando)
heinrichsweikamp
parents: 83
diff changeset
566 movff hi, EEDATA ; Highbyte default value
384
904863f96582 Work-Around for "Reset all" overwriting 0x00 to 0x04 in EEPROM Bank1
heinrichsweikamp
parents: 374
diff changeset
567
904863f96582 Work-Around for "Reset all" overwriting 0x00 to 0x04 in EEPROM Bank1
heinrichsweikamp
parents: 374
diff changeset
568 movlw d'127' ; Work-around to prevent writing at EEPROM 0x00 to 0x04
904863f96582 Work-Around for "Reset all" overwriting 0x00 to 0x04 in EEPROM Bank1
heinrichsweikamp
parents: 374
diff changeset
569 cpfslt EEADR ; EEADR > 127?
904863f96582 Work-Around for "Reset all" overwriting 0x00 to 0x04 in EEPROM Bank1
heinrichsweikamp
parents: 374
diff changeset
570 call write_eeprom ; Yes, write!
904863f96582 Work-Around for "Reset all" overwriting 0x00 to 0x04 in EEPROM Bank1
heinrichsweikamp
parents: 374
diff changeset
571 return
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
572
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
573 reset_external_eeprom: ; deletes complete external eeprom!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
574 clrf eeprom_address+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
575 clrf eeprom_address+1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
576
350
7250ca7c8d24 64kByte logbook (Still incompatible to existing PC software)
heinrichsweikamp
parents: 341
diff changeset
577 movlw d'4'
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
578 movwf temp3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
579 reset_eeprom02:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
580 clrf temp4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
581 reset_eeprom01:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
582 movlw d'64'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
583 movwf temp2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
584 bcf eeprom_blockwrite ; Blockwrite start
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
585 reset_eeprom1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
586 setf ext_ee_temp1 ; byte for Blockwrite....
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
587 movf ext_ee_temp1,W ; So, 1st. Byte of block is fine, too
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
588 call write_external_eeprom_block
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
589 decfsz temp2,F ; 64 Byte done
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
590 bra reset_eeprom1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
591 bsf SSPCON2,PEN ; Stop condition
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
592 call WaitMSSP
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
593 WAITMS d'7'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
594 decfsz temp4,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
595 bra reset_eeprom01 ; do this 256 times
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
596 decfsz temp3,F
350
7250ca7c8d24 64kByte logbook (Still incompatible to existing PC software)
heinrichsweikamp
parents: 341
diff changeset
597 bra reset_eeprom02 ; and this all 4 times -> 1024 *64Bytes = 64KB
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
598
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
599 bcf eeprom_blockwrite ; clear blockwrite flag
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
600
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
601 clrf eeprom_address+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
602 clrf eeprom_address+1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
603
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
604 movlw 0xFD ; With these three bytes the OSTC will find the free area in the EEPROM faster
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
605 call write_external_eeprom
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
606 movlw 0xFD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
607 call write_external_eeprom
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
608 movlw 0xFE
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
609 call write_external_eeprom
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
610
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
611 clrf eeprom_address+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
612 clrf eeprom_address+1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
613 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
614