0
|
1
|
|
2 ; OSTC - diving computer code
|
|
3 ; Copyright (C) 2008 HeinrichsWeikamp GbR
|
|
4
|
|
5 ; This program is free software: you can redistribute it and/or modify
|
|
6 ; it under the terms of the GNU General Public License as published by
|
|
7 ; the Free Software Foundation, either version 3 of the License, or
|
|
8 ; (at your option) any later version.
|
|
9
|
|
10 ; This program is distributed in the hope that it will be useful,
|
|
11 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13 ; GNU General Public License for more details.
|
|
14
|
|
15 ; You should have received a copy of the GNU General Public License
|
|
16 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
|
18
|
|
19 ; Submenu battery state
|
|
20 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com
|
|
21 ; written: 05/15/08
|
|
22 ; last updated: 05/15/08
|
|
23 ; known bugs:
|
|
24 ; ToDo:
|
|
25
|
|
26 menu_battery_state:
|
|
27 call PLED_ClearScreen
|
|
28 call PLED_topline_box
|
|
29 WIN_INVERT .1 ; Init new Wordprocessor
|
|
30 DISPLAYTEXT .114 ; Battery Information
|
|
31 WIN_INVERT .0 ; Init new Wordprocessor
|
|
32
|
|
33 WIN_TOP .35
|
|
34 WIN_LEFT .0
|
|
35 WIN_FONT FT_SMALL
|
|
36
|
|
37 lfsr FSR2,letter
|
|
38 OUTPUTTEXT .115 ; Cycles:
|
|
39 read_int_eeprom d'50' ; Get charge cycles
|
|
40 movff EEDATA,lo
|
|
41 read_int_eeprom d'51'
|
|
42 movff EEDATA,hi
|
|
43 bsf leftbind
|
|
44 output_16
|
|
45 movlw ' '
|
|
46 movwf POSTINC2
|
|
47 movlw '('
|
|
48 movwf POSTINC2
|
|
49 read_int_eeprom d'52' ; Get complete cycles
|
|
50 movff EEDATA,lo
|
|
51 read_int_eeprom d'53'
|
|
52 movff EEDATA,hi
|
|
53 bsf leftbind
|
|
54 output_16
|
|
55 movlw ')'
|
|
56 movwf POSTINC2
|
|
57 call word_processor
|
|
58
|
|
59 WIN_TOP .65
|
|
60 lfsr FSR2,letter
|
|
61 OUTPUTTEXT .117 ; Last Complete at:
|
|
62 read_int_eeprom d'47' ; Month
|
|
63 movff EEDATA,convert_value_temp+0
|
|
64 read_int_eeprom d'48' ; Day
|
|
65 movff EEDATA,convert_value_temp+1
|
|
66 read_int_eeprom d'49' ; Year
|
|
67 movff EEDATA,convert_value_temp+2
|
|
68 call PLED_convert_date ; coverts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
|
|
69 call word_processor
|
|
70
|
|
71 WIN_TOP .95
|
|
72 lfsr FSR2,letter
|
|
73 OUTPUTTEXT .118 ; Lowest Battery:
|
|
74 read_int_eeprom d'40' ; Batt LOW
|
|
75 movff EEDATA,lo
|
|
76 read_int_eeprom d'41' ; Batt HIGH
|
|
77 movff EEDATA,hi
|
|
78 movlw d'1'
|
|
79 movwf ignore_digits
|
|
80 bsf leftbind
|
|
81 output_16dp d'2'
|
|
82 bcf leftbind
|
|
83 movlw 'V'
|
|
84 movwf POSTINC2
|
|
85 call word_processor
|
|
86
|
|
87 WIN_TOP .125
|
|
88 lfsr FSR2,letter
|
|
89 OUTPUTTEXT .119 ; Lowest Battery at:
|
|
90 read_int_eeprom d'42' ; Month
|
|
91 movff EEDATA,convert_value_temp+0
|
|
92 read_int_eeprom d'43' ; Day
|
|
93 movff EEDATA,convert_value_temp+1
|
|
94 read_int_eeprom d'44' ; Year
|
|
95 movff EEDATA,convert_value_temp+2
|
|
96 call PLED_convert_date ; coverts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
|
|
97 call word_processor
|
|
98
|
|
99 WIN_TOP .155
|
|
100 lfsr FSR2,letter
|
|
101 OUTPUTTEXT .120 ; Temp min:
|
|
102 read_int_eeprom d'54' ; TEMP_min LOW
|
|
103 movff EEDATA,lo
|
|
104 read_int_eeprom d'55' ; TEMP_min HIGH
|
|
105 movff EEDATA,hi
|
|
106 movlw d'3'
|
|
107 movwf ignore_digits
|
|
108 bsf leftbind ; left orientated output
|
|
109 output_16dp d'2'
|
|
110 bcf leftbind
|
|
111 movlw '°'
|
|
112 movwf POSTINC2
|
|
113 movlw ' '
|
|
114 movwf POSTINC2
|
|
115 movlw '('
|
|
116 movwf POSTINC2
|
|
117 read_int_eeprom d'56' ; Month
|
|
118 movff EEDATA,convert_value_temp+0
|
|
119 read_int_eeprom d'57' ; Day
|
|
120 movff EEDATA,convert_value_temp+1
|
|
121 read_int_eeprom d'58' ; Year
|
|
122 movff EEDATA,convert_value_temp+2
|
|
123 call PLED_convert_date ; coverts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
|
|
124 movlw ')'
|
|
125 movwf POSTINC2
|
|
126 movlw ' '
|
|
127 movwf POSTINC2
|
|
128 call word_processor
|
|
129
|
|
130 WIN_TOP .185
|
|
131 lfsr FSR2,letter
|
|
132 OUTPUTTEXT .121 ; Temp max:
|
|
133 read_int_eeprom d'59' ; TEMP_max LOW
|
|
134 movff EEDATA,lo
|
|
135 read_int_eeprom d'60' ; TEMP_max HIGH
|
|
136 movff EEDATA,hi
|
|
137 movlw d'3'
|
|
138 movwf ignore_digits
|
|
139 bsf leftbind ; left orientated output
|
|
140 output_16dp d'2'
|
|
141 bcf leftbind
|
|
142 movlw '°'
|
|
143 movwf POSTINC2
|
|
144 movlw ' '
|
|
145 movwf POSTINC2
|
|
146 movlw '('
|
|
147 movwf POSTINC2
|
|
148 read_int_eeprom d'61' ; Month
|
|
149 movff EEDATA,convert_value_temp+0
|
|
150 read_int_eeprom d'62' ; Day
|
|
151 movff EEDATA,convert_value_temp+1
|
|
152 read_int_eeprom d'63' ; Year
|
|
153 movff EEDATA,convert_value_temp+2
|
|
154 call PLED_convert_date ; coverts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
|
|
155 movlw ')'
|
|
156 movwf POSTINC2
|
|
157 movlw ' '
|
|
158 movwf POSTINC2
|
|
159 call word_processor
|
|
160
|
|
161 menu_battery_state5:
|
|
162 btfss SWITCH2
|
|
163 bra menu_battery_state5
|
|
164
|
|
165 bcf switch_left
|
|
166 bcf switch_right
|
|
167 bcf menubit2
|
|
168 menu_battery_state_loop:
|
|
169 call check_switches_logbook
|
|
170
|
|
171 btfsc menubit2
|
|
172 bra menu_battery_state_exit ; Exit
|
|
173
|
|
174 btfsc divemode
|
|
175 goto restart ; dive started!
|
|
176
|
|
177 btfsc onesecupdate
|
|
178 call timeout_surfmode
|
|
179
|
|
180 btfsc onesecupdate
|
|
181 call set_dive_modes
|
|
182
|
|
183 bcf onesecupdate ; 1 sec. functions done
|
|
184
|
|
185 btfsc sleepmode
|
|
186 bra menu_battery_state_exit
|
|
187
|
|
188 bra menu_battery_state_loop
|
|
189
|
|
190 menu_battery_state_exit: ; exit...
|
|
191 movlw d'3'
|
|
192 movwf menupos
|
|
193 goto more_menu2
|