annotate code_part1/OSTC_code_asm_part1/menu_reset.asm @ 57:152fbe7f121d

small update simulator
author heinrichsweikamp
date Tue, 03 Aug 2010 21:42:43 +0200
parents 985607cfb813
children fee7c62b4de1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
2 ; OSTC - diving computer code
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
3 ; Copyright (C) 2008 HeinrichsWeikamp GbR
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
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
22 ; last updated: 08/08/31
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
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
30 menu_reset:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
31 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
32 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
33
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
34 call PLED_ClearScreen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
35 call PLED_reset_menu_mask
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
36
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
37 menu_reset2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
38 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
39 bcf sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
40 bcf menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
41 bcf menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
42 bsf menubit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
43 bsf cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
44 call PLED_reset_menu_mask
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
45 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
46 bcf switch_left
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
47 bcf switch_right
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
48 menu_reset_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
49 call check_switches_menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
50 btfsc menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
51 bra do_menu_reset ; call submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
52 btfss menubit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
53 bra menu ; exit setup menu and return to main menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
54 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
55 call timeout_surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
56 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
57 call set_dive_modes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
58 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
59 call test_charger ; check if charger IC is active
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
60 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
61 call get_battery_voltage ; get battery voltage
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
62 bcf onesecupdate ; End of one second tasks
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
63 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
64 goto menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
65 btfsc divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
66 goto restart ; exit menu, restart and enter divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
67 bra menu_reset_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
68 do_menu_reset: ; calls submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
69 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
70 bra do_menu_reset_exit ; Cancel, exit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
71 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
72 bra do_menu_reset_all ; Reset all settings
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
73 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
74 bra do_menu_reset_logbook ; Reset Logbook Memory!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
75 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
76 bra do_menu_reset_reboot ; Reboot OSTC
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
77 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
78 bra do_menu_reset_decodata ; Reset Decodata
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
79 do_menu_reset_exit:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
80 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
81 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
82 bra menu2 ; exit...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
83
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
84
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
85 do_menu_reset_reboot:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
86 call PLED_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
87 movwf menupos ; Used as temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
88 tstfsz menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
89 bra do_menu_reset_reboot2 ; Delete now!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
90 bra do_menu_reset_exit ; Cancel!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
91
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
92 do_menu_reset_reboot2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
93 call PLED_DisplayOff ; Power-down OLED
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
94 movlw b'00000000' ; Bit6: PPL Disable
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
95 movwf OSCTUNE
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
96 movlw b'01111110' ; 8MHz
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
97 movwf OSCCON
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
98 reset
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
99 goto 0x00000 ; restart to 0x00000
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
100
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
101 do_menu_reset_logbook:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
102 call PLED_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
103 movwf menupos ; Used as temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
104 tstfsz menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
105 bra do_menu_reset_logbook2 ; Delete Logbook now!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
106 bra do_menu_reset_exit ; Cancel!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
107
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
108 do_menu_reset_logbook2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
109 call PLED_ClearScreen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
110 DISPLAYTEXT .25 ; "Reset..."
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
111 call reset_external_eeprom ; delete profile memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
112 bra do_menu_reset_exit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
113
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
114 do_menu_reset_decodata:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
115 call PLED_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
116 movwf menupos ; Used as temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
117 tstfsz menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
118 bra do_menu_reset_decodata2 ; Reset Deco Data now!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
119 bra do_menu_reset_exit ; Cancel!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
120
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
121 do_menu_reset_decodata2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
122 ; reset deco data
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
123 call PLED_ClearScreen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
124 DISPLAYTEXT .25 ; "Reset..."
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
125 movff amb_pressure+0,int_I_pres_respiration+0 ; copy surface air pressure to deco routine
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
126 movff amb_pressure+1,int_I_pres_respiration+1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
127 call deco_main_clear_tissue ;
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
128 movlb b'00000001' ; RAM Bank1 selected
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
129 goto restart ; done. quit to surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
130
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
131 do_menu_reset_all:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
132 call PLED_confirmbox ; Returns WREG=0 for Cancel (Or Timeout) and WREG=1 for OK!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
133 movwf menupos ; Used as temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
134 tstfsz menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
135 bra do_menu_reset_all2 ; Reset all now!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
136 bra do_menu_reset_exit ; Cancel!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
137
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
138 do_menu_reset_all2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
139 call PLED_ClearScreen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
140 DISPLAYTEXT .25 ; "Reset..."
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
141
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
142 reset_start:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
143 ; reset deco data
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
144 movff amb_pressure+0,int_I_pres_respiration+0 ; copy surface air pressure to deco routine
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
145 movff amb_pressure+1,int_I_pres_respiration+1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
146 call deco_main_clear_tissue ;
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
147 movlb b'00000001' ; RAM Bank1 selected
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
148
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
149 ; reset gases
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
150 clrf EEADRH ; EEPROM BANK 0 !
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
151
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
152 movlw d'3' ; address of first gas-1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
153 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
154 clrf hi ; He part (default for all gases: 0%)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
155 movlw d'21' ; O2 part (21%)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
156 rcall reset_customfunction ; saves default and current value for gas #1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
157 movlw d'21' ; O2 part (21%)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
158 rcall reset_customfunction ; saves default and current value for gas #2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
159 movlw d'21' ; O2 part (21%)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
160 rcall reset_customfunction ; saves default and current value for gas #3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
161 movlw d'21' ; O2 part (21%)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
162 rcall reset_customfunction ; saves default and current value for gas #4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
163 movlw d'21' ; O2 part (21%)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
164 rcall reset_customfunction ; saves default and current value for gas #5
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
165 movlw d'21' ; O2 part (21%)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
166 rcall reset_customfunction ; saves default and current value for gas #6
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
167
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
168 reset_all_cf:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
169 ; resets all customfunctions to the following default values
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
170 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
171 movwf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
172 write_int_eeprom d'33' ; reset start gas
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
173 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
174 write_int_eeprom d'34' ; reset deco model to ZH-L16
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
175 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
176 write_int_eeprom d'35' ; Do not use O2 Sensor in CC Modes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
177
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
178 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
179 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
180 write_int_eeprom d'39' ; Disable Debugbode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
181 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
182 write_int_eeprom d'90' ; Disable Brightness offset? (Dim=1, Normal = 0)
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
183 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
184 write_int_eeprom d'91' ; Reset Date format to MM/DD/YY
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
185
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
186 movlw d'100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
187 write_int_eeprom d'26' ; Salinity default: 1.00 kg/l
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
188
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
189 movlw b'00011111'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
190 movwf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
191 write_int_eeprom d'27' ; reset active gas flags
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
192
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
193 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
194 write_int_eeprom d'28' ; reset change depth gas #1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
195 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
196 write_int_eeprom d'29' ; reset change depth gas #2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
197 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
198 write_int_eeprom d'30' ; reset change depth gas #3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
199 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
200 write_int_eeprom d'31' ; reset change depth gas #4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
201 clrf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
202 write_int_eeprom d'32' ; reset change depth gas #5
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
203
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
204 movlw d'100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
205 movwf EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
206 write_int_eeprom d'36' ; reset mix1 to ppO2=1.00Bar
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
207 write_int_eeprom d'37' ; reset mix2 to ppO2=1.00Bar
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
208 write_int_eeprom d'38' ; reset mix3 to ppO2=1.00Bar
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
209
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
210 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
211 movwf nofly_time+0 ; Clear nofly time
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
212 clrf nofly_time+1 ; Clear nofly time
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
213
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
214 #DEFINE dive_threshold d'100' ; 8BIT 100cm
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
215 #DEFINE surf_threshold d'30' ; 8BIT 30cm
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
216 #DEFINE diveloop_timeout d'240' ; 8BIT 240s
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
217 #DEFINE surfloop_timeout d'120' ; 8BIT 120s
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
218 #DEFINE premenu_timeout d'5' ; 8BIT 5s
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
219
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
220 #DEFINE minimum_velocity d'7' ; 8BIT 7min/min
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
221 #DEFINE pressure_offset_divemode d'1160' ; 15BIT 1160mBar
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
222 #DEFINE max_surfpressure d'1100' ; 15BIT 1100mBar
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
223 #DEFINE min_gradient_factor d'20' ; 8Bit 20%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
224 #DEFINE oxygen_threshold d'20' ; 8Bit 20%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
225
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
226 #DEFINE dive_menu_timeout d'30' ; 8BIT 30s
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
227 #DEFINE saturation_multiplier d'110' ; 8BIT x1.1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
228 #DEFINE desaturation_multiplier d'90' ; 8BIT x0.9
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
229 #DEFINE nofly_time_ratio d'60' ; 8BIT 60%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
230 #DEFINE gradient_factor_alarm1 d'100' ; 8Bit 100%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
231
43
65d5b0c8da41 New CF48, changed CF15
heinrichsweikamp
parents: 28
diff changeset
232 #DEFINE cns_display_surface d'10' ; 8Bit 10%
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
233 #DEFINE deco_distance_for_sim d'10' ; 8Bit 1m
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
234 #DEFINE ppo2_warning_low d'019' ; 8Bit 0.19 Bar
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
235 #DEFINE ppo2_warning_high d'160' ; 8Bit 1.60 Bar
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
236 #DEFINE ppo2_display_high d'150' ; 8Bit 1.50 Bar
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
237
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
238 #DEFINE sampling_rate d'10' ; 8Bit 10s
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
239 #DEFINE sampling_divisor_temp d'6' ; 8Bit /6
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
240 #DEFINE sampling_divisor_deco d'6' ; 8Bit /6
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
241 #DEFINE sampling_divisor_tank d'0' ; 8Bit never
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
242 #DEFINE sampling_divisor_ppo2 d'0' ; 8Bit never
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
243
45
985607cfb813 1.65beta
heinrichsweikamp
parents: 43
diff changeset
244 #DEFINE sampling_divisor_deco2 d'0' ; 8Bit never
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
245 #DEFINE sampling_divisor_nyu2 d'0' ; 8Bit never
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
246 #DEFINE cns_display_high d'20' ; 8Bit 20%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
247 #DEFINE logbook_offset d'0' ; 15Bit No Offset, but 15Bit value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
248 #DEFINE last_deco_depth d'3' ; 8Bit 3m
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
249 #DEFINE timeout_apnoe_mode d'10' ; 8Bit 10min
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
250 #DEFINE show_voltage_value d'0' ; 1Bit =1 Show value instead of symbol, =0 Show Symbol
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
251
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
252 #DEFINE GF_low_default d'30' ; 8Bit 30%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
253 #DEFINE GF_high_default d'90' ; 8Bit 90%
28
e01e6428d316 CHANGE: Change of color layout (OSTC Mk.2 Only)
heinrichsweikamp
parents: 27
diff changeset
254 #DEFINE color_battery_surface d'199' ; 8Bit Color Battery sign: Deep blue
9
395230c28023 Added CF36: Divemask color
heinrichsweikamp
parents: 3
diff changeset
255 #DEFINE color_standard1 d'255' ; 8Bit Color Standard: White
28
e01e6428d316 CHANGE: Change of color layout (OSTC Mk.2 Only)
heinrichsweikamp
parents: 27
diff changeset
256 #DEFINE color_divemask d'62' ; 8Bit Color Divemask: Light green
25
99512945c7a1 1.61 beta rc2
heinrichsweikamp
parents: 10
diff changeset
257 #DEFINE color_warnings d'224' ; 8Bit Color Warnings: Red
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
258
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
259 #DEFINE show_seconds_divemode d'0' ; 1Bit =1 Show the seconds in Divemode
27
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
260 #DEFINE not_used_cf39_binary d'0' ; 1Bit =1 Flip Display
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
261 #DEFINE not_used_cf40_binary d'0' ; 1Bit =1 Use alternative outputs for ppO2 sensor
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
262 #DEFINE start_with_stopwatch d'0' ; 1Bit =1 start with stopwatch
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
263 #DEFINE blink_gas_divemode d'0' ; 1Bit =1 Show (resetable) average Depth instead of temperature
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
264
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
265 #DEFINE color_warn_depth_mBar d'13000' ; 15Bit Warn depths
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
266 #DEFINE color_warn_cns_percent d'101' ; 8Bit Warn-%
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
267 #DEFINE color_warn_gf_percent d'101' ; 8Bit Warn-%
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
268 #DEFINE color_warn_ppo2_cbar d'161' ; 8Bit ppO2 warn
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
269 #DEFINE color_warn_celocity_mmin d'15' ; 8Bit warn at xx m/min
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
270
43
65d5b0c8da41 New CF48, changed CF15
heinrichsweikamp
parents: 28
diff changeset
271 #DEFINE time_correction_value_default d'42' ; 8Bit Adds to Seconds on Midnight
65d5b0c8da41 New CF48, changed CF15
heinrichsweikamp
parents: 28
diff changeset
272
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
273 movlw d'127' ; address of low byte of first custom function
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
274 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
275 clrf hi ; only required once
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
276 movlw LOW dive_threshold ; 8Bit value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
277 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
278
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
279 movlw LOW surf_threshold
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
280 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
281
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
282 movlw LOW diveloop_timeout
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
283 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
284
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
285 movlw LOW surfloop_timeout
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
286 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
287
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
288 movlw LOW premenu_timeout
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
289 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
290
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
291 movlw LOW minimum_velocity
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
292 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
293
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
294 movlw HIGH pressure_offset_divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
295 movwf hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
296 bsf hi,7 ; 15Bit value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
297 movlw LOW pressure_offset_divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
298 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
299
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
300 movlw HIGH max_surfpressure
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
301 movwf hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
302 bsf hi,7 ; 15Bit value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
303 movlw LOW max_surfpressure
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
304 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
305
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
306 movlw LOW min_gradient_factor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
307 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
308
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
309 movlw LOW oxygen_threshold
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
310 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
311
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
312 movlw LOW dive_menu_timeout
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
313 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
314
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
315 movlw LOW saturation_multiplier
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
316 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
317
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
318 movlw LOW desaturation_multiplier
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
319 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
320
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
321 movlw LOW nofly_time_ratio
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
322 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
323
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
324 movlw LOW gradient_factor_alarm1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
325 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
326
43
65d5b0c8da41 New CF48, changed CF15
heinrichsweikamp
parents: 28
diff changeset
327 movlw LOW cns_display_surface
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
328 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
329
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
330 movlw LOW deco_distance_for_sim
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
331 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
332
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
333 movlw LOW ppo2_warning_low
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
334 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
335
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
336 movlw LOW ppo2_warning_high
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
337 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
338
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
339 movlw LOW ppo2_display_high
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
340 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
341
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
342 movlw LOW sampling_rate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
343 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
344
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
345 movlw LOW sampling_divisor_temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
346 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
347
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
348 movlw LOW sampling_divisor_deco
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
349 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
350
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
351 movlw LOW sampling_divisor_tank
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
352 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
353
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
354 movlw LOW sampling_divisor_ppo2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
355 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
356
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
357 movlw LOW sampling_divisor_deco2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
358 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
359
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
360 movlw LOW sampling_divisor_nyu2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
361 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
362
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
363 movlw LOW cns_display_high
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
364 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
365
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
366 clrf hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
367 bsf hi,7 ; 15Bit value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
368 movlw LOW logbook_offset
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
369 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
370
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
371 movlw LOW last_deco_depth
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
372 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
373
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
374 movlw LOW timeout_apnoe_mode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
375 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
376
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
377 movlw LOW show_voltage_value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
378 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
379
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
380 reset_all_cf_bank1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
381 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
382 movwf EEADRH ; EEPROM BANK 1 !!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
383 movlw d'127' ; address of low byte of first custom function
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
384 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
385 clrf hi ; only required once/bank
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
386
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
387 movlw LOW GF_low_default
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
388 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
389
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
390 movlw LOW GF_high_default
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
391 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
392
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
393 movlw color_battery_surface
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
394 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
395
3
3cf8af30b36e v1.51 beta
heinrichsweikamp
parents: 0
diff changeset
396 movlw color_standard1
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
397 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
398
9
395230c28023 Added CF36: Divemask color
heinrichsweikamp
parents: 3
diff changeset
399 movlw color_divemask
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
400 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
401
25
99512945c7a1 1.61 beta rc2
heinrichsweikamp
parents: 10
diff changeset
402 movlw color_warnings
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
403 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
404
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
405 movlw show_seconds_divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
406 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
407
27
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
408 movlw not_used_cf39_binary
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
409 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
410
27
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
411 movlw not_used_cf40_binary
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
412 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
413
27
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
414 movlw start_with_stopwatch
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
415 rcall reset_customfunction ; saves default and current value
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
416
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
417 movlw blink_gas_divemode
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
418 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
419
27
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
420 movlw HIGH color_warn_depth_mBar
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
421 movwf hi
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
422 bsf hi,7 ; 15Bit value
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
423 movlw LOW color_warn_depth_mBar
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
424 rcall reset_customfunction ; saves default and current value
27
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
425
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
426 movlw color_warn_cns_percent
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
427 rcall reset_customfunction ; saves default and current value
27
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
428
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
429 movlw color_warn_gf_percent
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
430 rcall reset_customfunction ; saves default and current value
27
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
431
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
432 movlw color_warn_ppo2_cbar
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
433 rcall reset_customfunction ; saves default and current value
27
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
434
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
435 movlw color_warn_celocity_mmin
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
436 rcall reset_customfunction ; saves default and current value
27
29341afd2060 NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents: 25
diff changeset
437
43
65d5b0c8da41 New CF48, changed CF15
heinrichsweikamp
parents: 28
diff changeset
438 movlw time_correction_value_default
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
439 rcall reset_customfunction ; saves default and current value
43
65d5b0c8da41 New CF48, changed CF15
heinrichsweikamp
parents: 28
diff changeset
440
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
441 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
442 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
443 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
444 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
445 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
446 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
447 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
448 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
449 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
450 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
451 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
452 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
453 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
454 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
455 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
456 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
457 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
458 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
459 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
460 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
461 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
462 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
463 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
464 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
465 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
466 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
467 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
468 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
469 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
470 rcall reset_customfunction ; saves default and current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
471
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
472 clrf EEADRH ; EEPROM BANK 0 !
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
473
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
474
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
475 ;call reset_external_eeprom ; delete profile memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
476 goto restart ; all reset, quit to surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
477
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
478 reset_customfunction:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
479 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
480 incf EEADR,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
481 movff lo, EEDATA ; Lowbyte Defaul value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
482 call write_eeprom
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
483 incf EEADR,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
484 movff hi, EEDATA ; Highbyte default value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
485 call write_eeprom
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
486 incf EEADR,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
487 movff lo, EEDATA ; Lowbyte current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
488 call write_eeprom
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
489 incf EEADR,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
490 bcf hi,7 ; This bit will only be written for the default value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
491 movff hi, EEDATA ; Highbyte current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
492 call write_eeprom
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
493 clrf hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
494 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
495
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
496
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
497 reset_external_eeprom: ; deletes complete external eeprom!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
498 clrf eeprom_address+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
499 clrf eeprom_address+1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
500
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
501 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
502 movwf temp3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
503 reset_eeprom02:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
504 clrf temp4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
505 reset_eeprom01:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
506 movlw d'64'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
507 movwf temp2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
508 bcf eeprom_blockwrite ; Blockwrite start
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
509 reset_eeprom1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
510 setf ext_ee_temp1 ; byte for Blockwrite....
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
511 movf ext_ee_temp1,W ; So, 1st. Byte of block is fine, too
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
512 call write_external_eeprom_block
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
513 decfsz temp2,F ; 64 Byte done
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
514 bra reset_eeprom1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
515 bsf SSPCON2,PEN ; Stop condition
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
516 call WaitMSSP
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
517 WAITMS d'7'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
518 decfsz temp4,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
519 bra reset_eeprom01 ; do this 256 times
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
520 decfsz temp3,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
521 bra reset_eeprom02 ; and this all 2 times -> 512 *64Bytes = 32KB
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
522
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
523 bcf eeprom_blockwrite ; clear blockwrite flag
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
524
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
525 clrf eeprom_address+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
526 clrf eeprom_address+1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
527
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
528 movlw 0xFD ; With these three bytes the OSTC will find the free area in the EEPROM faster
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
529 call write_external_eeprom
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
530 movlw 0xFD
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
531 call write_external_eeprom
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
532 movlw 0xFE
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
533 call write_external_eeprom
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
534
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
535 clrf eeprom_address+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
536 clrf eeprom_address+1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
537 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
538