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
|
123
|
45 STRCAT " ("
|
0
|
46 read_int_eeprom d'52' ; Get complete cycles
|
|
47 movff EEDATA,lo
|
|
48 read_int_eeprom d'53'
|
|
49 movff EEDATA,hi
|
|
50 bsf leftbind
|
|
51 output_16
|
123
|
52 STRCAT_PRINT ")"
|
0
|
53
|
|
54 WIN_TOP .65
|
|
55 lfsr FSR2,letter
|
|
56 OUTPUTTEXT .117 ; Last Complete at:
|
|
57 read_int_eeprom d'47' ; Month
|
|
58 movff EEDATA,convert_value_temp+0
|
|
59 read_int_eeprom d'48' ; Day
|
|
60 movff EEDATA,convert_value_temp+1
|
|
61 read_int_eeprom d'49' ; Year
|
|
62 movff EEDATA,convert_value_temp+2
|
|
63 call PLED_convert_date ; coverts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
|
|
64 call word_processor
|
|
65
|
|
66 WIN_TOP .95
|
|
67 lfsr FSR2,letter
|
|
68 OUTPUTTEXT .118 ; Lowest Battery:
|
|
69 read_int_eeprom d'40' ; Batt LOW
|
|
70 movff EEDATA,lo
|
|
71 read_int_eeprom d'41' ; Batt HIGH
|
|
72 movff EEDATA,hi
|
|
73 movlw d'1'
|
|
74 movwf ignore_digits
|
|
75 bsf leftbind
|
|
76 output_16dp d'2'
|
|
77 bcf leftbind
|
123
|
78 STRCAT_PRINT "V"
|
0
|
79
|
|
80 WIN_TOP .125
|
|
81 lfsr FSR2,letter
|
|
82 OUTPUTTEXT .119 ; Lowest Battery at:
|
|
83 read_int_eeprom d'42' ; Month
|
|
84 movff EEDATA,convert_value_temp+0
|
|
85 read_int_eeprom d'43' ; Day
|
|
86 movff EEDATA,convert_value_temp+1
|
|
87 read_int_eeprom d'44' ; Year
|
|
88 movff EEDATA,convert_value_temp+2
|
|
89 call PLED_convert_date ; coverts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
|
|
90 call word_processor
|
|
91
|
|
92 WIN_TOP .155
|
|
93 lfsr FSR2,letter
|
|
94 OUTPUTTEXT .120 ; Temp min:
|
|
95 read_int_eeprom d'54' ; TEMP_min LOW
|
|
96 movff EEDATA,lo
|
|
97 read_int_eeprom d'55' ; TEMP_min HIGH
|
|
98 movff EEDATA,hi
|
|
99 movlw d'3'
|
|
100 movwf ignore_digits
|
|
101 bsf leftbind ; left orientated output
|
|
102 output_16dp d'2'
|
|
103 bcf leftbind
|
123
|
104 STRCAT "° ("
|
0
|
105 read_int_eeprom d'56' ; Month
|
|
106 movff EEDATA,convert_value_temp+0
|
|
107 read_int_eeprom d'57' ; Day
|
|
108 movff EEDATA,convert_value_temp+1
|
|
109 read_int_eeprom d'58' ; Year
|
|
110 movff EEDATA,convert_value_temp+2
|
|
111 call PLED_convert_date ; coverts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
|
123
|
112 STRCAT_PRINT ") "
|
0
|
113
|
|
114 WIN_TOP .185
|
|
115 lfsr FSR2,letter
|
|
116 OUTPUTTEXT .121 ; Temp max:
|
|
117 read_int_eeprom d'59' ; TEMP_max LOW
|
|
118 movff EEDATA,lo
|
|
119 read_int_eeprom d'60' ; TEMP_max HIGH
|
|
120 movff EEDATA,hi
|
|
121 movlw d'3'
|
|
122 movwf ignore_digits
|
|
123 bsf leftbind ; left orientated output
|
|
124 output_16dp d'2'
|
|
125 bcf leftbind
|
123
|
126 STRCAT "° ("
|
0
|
127 read_int_eeprom d'61' ; Month
|
|
128 movff EEDATA,convert_value_temp+0
|
|
129 read_int_eeprom d'62' ; Day
|
|
130 movff EEDATA,convert_value_temp+1
|
|
131 read_int_eeprom d'63' ; Year
|
|
132 movff EEDATA,convert_value_temp+2
|
|
133 call PLED_convert_date ; coverts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
|
123
|
134 STRCAT_PRINT ") "
|
0
|
135
|
|
136 bcf switch_left
|
|
137 bcf switch_right
|
|
138 bcf menubit2
|
|
139 menu_battery_state_loop:
|
|
140 call check_switches_logbook
|
|
141
|
|
142 btfsc menubit2
|
|
143 bra menu_battery_state_exit ; Exit
|
|
144
|
|
145 btfsc divemode
|
|
146 goto restart ; dive started!
|
|
147
|
|
148 btfsc onesecupdate
|
|
149 call timeout_surfmode
|
|
150
|
|
151 btfsc onesecupdate
|
|
152 call set_dive_modes
|
|
153
|
|
154 bcf onesecupdate ; 1 sec. functions done
|
|
155
|
|
156 btfsc sleepmode
|
|
157 bra menu_battery_state_exit
|
|
158
|
|
159 bra menu_battery_state_loop
|
|
160
|
|
161 menu_battery_state_exit: ; exit...
|
|
162 movlw d'3'
|
|
163 movwf menupos
|
|
164 goto more_menu2
|