Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/menu_battery.asm @ 635:5ad7e8280d8f
Spanish update
author | heinrichsweikamp |
---|---|
date | Tue, 18 Sep 2012 09:02:27 +0200 |
parents | e7b675c28896 |
children | 6e456a6398e0 |
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 |
621 | 54 WIN_TOP .63 |
0 | 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 | |
621 | 66 WIN_TOP .91 |
0 | 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 |
621 | 80 WIN_TOP .119 |
0 | 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 | |
621 | 92 WIN_TOP .147 |
0 | 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 |
621 | 115 WIN_TOP .175 |
0 | 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 ") " |
576 | 137 |
621 | 138 WIN_TOP .203 |
139 lfsr FSR2,letter | |
140 OUTPUTTEXT .228 ; Total Dives: | |
141 read_int_eeprom d'2' ; Total dives low | |
142 movff EEDATA,lo | |
143 read_int_eeprom d'3' ; Total dives high | |
144 movff EEDATA,hi | |
145 bsf leftbind ; left orientated output | |
146 output_16 | |
147 STRCAT_PRINT "" | |
148 | |
576 | 149 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! |
0 | 150 bcf menubit2 |
151 menu_battery_state_loop: | |
152 call check_switches_logbook | |
153 | |
154 btfsc menubit2 | |
155 bra menu_battery_state_exit ; Exit | |
156 | |
157 btfsc onesecupdate | |
575 | 158 call menu_check_dive_and_timeout ; "Goto restart" or sets sleepmode flag |
0 | 159 |
160 bcf onesecupdate ; 1 sec. functions done | |
161 | |
162 btfsc sleepmode | |
163 bra menu_battery_state_exit | |
164 | |
165 bra menu_battery_state_loop | |
166 | |
167 menu_battery_state_exit: ; exit... | |
168 movlw d'3' | |
169 movwf menupos | |
170 goto more_menu2 |