Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/menu_battery.asm @ 467:59ff7a1aa1cb 2.01stable
show firmware version in logbook correctly
author | heinrichsweikamp |
---|---|
date | Mon, 03 Oct 2011 09:36:53 +0200 |
parents | 6e57b5bb98ce |
children | cbdcbbc91877 |
rev | line source |
---|---|
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 | |
445 | 78 STRCAT_PRINT TXT_VOLT1 |
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 | |
382
f2d5d93b4ca3
negative temperature in logbook and battery info menu
heinrichsweikamp
parents:
297
diff
changeset
|
99 call PLED_convert_signed_temperature ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required |
0 | 100 movlw d'3' |
101 movwf ignore_digits | |
102 bsf leftbind ; left orientated output | |
103 output_16dp d'2' | |
104 bcf leftbind | |
123 | 105 STRCAT "° (" |
0 | 106 read_int_eeprom d'56' ; Month |
107 movff EEDATA,convert_value_temp+0 | |
108 read_int_eeprom d'57' ; Day | |
109 movff EEDATA,convert_value_temp+1 | |
110 read_int_eeprom d'58' ; Year | |
111 movff EEDATA,convert_value_temp+2 | |
112 call PLED_convert_date ; coverts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2 | |
123 | 113 STRCAT_PRINT ") " |
0 | 114 |
115 WIN_TOP .185 | |
116 lfsr FSR2,letter | |
117 OUTPUTTEXT .121 ; Temp max: | |
118 read_int_eeprom d'59' ; TEMP_max LOW | |
119 movff EEDATA,lo | |
120 read_int_eeprom d'60' ; TEMP_max HIGH | |
121 movff EEDATA,hi | |
382
f2d5d93b4ca3
negative temperature in logbook and battery info menu
heinrichsweikamp
parents:
297
diff
changeset
|
122 call PLED_convert_signed_temperature ; converts lo:hi into signed-short and adds '-' to POSTINC2 if required |
0 | 123 movlw d'3' |
124 movwf ignore_digits | |
125 bsf leftbind ; left orientated output | |
126 output_16dp d'2' | |
127 bcf leftbind | |
123 | 128 STRCAT "° (" |
0 | 129 read_int_eeprom d'61' ; Month |
130 movff EEDATA,convert_value_temp+0 | |
131 read_int_eeprom d'62' ; Day | |
132 movff EEDATA,convert_value_temp+1 | |
133 read_int_eeprom d'63' ; Year | |
134 movff EEDATA,convert_value_temp+2 | |
135 call PLED_convert_date ; coverts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2 | |
123 | 136 STRCAT_PRINT ") " |
0 | 137 |
138 bcf switch_left | |
139 bcf switch_right | |
140 bcf menubit2 | |
141 menu_battery_state_loop: | |
142 call check_switches_logbook | |
143 | |
144 btfsc menubit2 | |
145 bra menu_battery_state_exit ; Exit | |
146 | |
147 btfsc divemode | |
148 goto restart ; dive started! | |
149 | |
150 btfsc onesecupdate | |
151 call timeout_surfmode | |
152 | |
153 btfsc onesecupdate | |
154 call set_dive_modes | |
155 | |
156 bcf onesecupdate ; 1 sec. functions done | |
157 | |
158 btfsc sleepmode | |
159 bra menu_battery_state_exit | |
160 | |
161 bra menu_battery_state_loop | |
162 | |
163 menu_battery_state_exit: ; exit... | |
164 movlw d'3' | |
165 movwf menupos | |
166 goto more_menu2 |