annotate code_part1/OSTC_code_asm_part1/menu_settime.asm @ 145:8bda2452a532

FIX bad mix icon when active gas in not G1.
author JeanDo
date Sun, 09 Jan 2011 11:45:20 +0100
parents 6a94f96e9cea
children f5e9db793dd3
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 "Set Time"
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
20 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
21 ; written: 5/19/06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
22 ; last updated: 080904
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
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
27 menu_settime:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
28 call PLED_ClearScreen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
29
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
30 bcf set_minutes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
31 bcf menubit4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
32 bcf cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
33 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
34 bcf menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
35 bcf menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
36 bcf sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
37 bcf set_year
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
38 bcf set_day
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
39 bcf set_month
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
40 clrf menupos2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
41
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
42 call PLED_topline_box
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
43 WIN_INVERT .1 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
44 DISPLAYTEXT .29 ; Set Time
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
45 WIN_INVERT .0 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
46 DISPLAYTEXT .22 ; Time:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
47 DISPLAYTEXT .23 ; Date:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
48
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
49 call set_time_refresh
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
50
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
51 DISPLAYTEXT .24 ; Set Hours
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
52
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
53 bcf switch_left
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
54 bcf switch_right
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
55
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
56 settime_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
57 btfsc switch_left
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
58 call add_hours_or_minutes_or_date
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
59
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
60 btfsc switch_right
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
61 call set_time_next_or_exit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
62
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
63 btfsc menubit4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
64 bra set_time_done
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
65
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
66 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
67 call timeout_surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
68
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
69 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
70 call set_dive_modes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
71
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
72 bcf onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
73
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
74 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
75 bra exit_settime
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
76
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
77 btfsc divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
78 goto restart
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
79
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
80 bra settime_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
81
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
82 set_time_refresh:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
83 WIN_LEFT .70
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
84 WIN_TOP .65
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
85 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
86 movff hours,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
87 output_99x
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 53
diff changeset
88 PUTC ':'
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
89 movff mins,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
90 output_99x
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 53
diff changeset
91 STRCAT_PRINT " "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
92
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
93 set_date_refresh:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
94 WIN_LEFT .70
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
95 WIN_TOP .95
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
96 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
97 movff month,convert_value_temp+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
98 movff day,convert_value_temp+1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
99 movff year,convert_value_temp+2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
100 call PLED_convert_date ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 53
diff changeset
101 STRCAT_PRINT " "
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 53
diff changeset
102 return
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
103
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
104 set_time_done: ; Check date
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
105 movff month,lo ; new month
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
106 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
107 movlw .31
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
108 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
109 movlw .28
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
110 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
111 movlw .31
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
112 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
113 movlw .30
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
114 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
115 movlw .31
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
116 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
117 movlw .30
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
118 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
119 movlw .31
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
120 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
121 movlw .31
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
122 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
123 movlw .30
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
124 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
125 movlw .31
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
126 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
127 movlw .30
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
128 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
129 movlw .31
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
130 cpfsgt day ; day ok?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
131 bra set_time_done2 ; OK
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
132 movlw .1 ; not OK, set to 1st
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
133 movwf day
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
134
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
135 set_time_done2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
136 WIN_LEFT .32
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
137 WIN_TOP .155
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
138 movlw d'8'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
139 movwf temp1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
140 call PLED_display_clear_common_y1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
141
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
142 movlw d'5'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
143 movwf wait_temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
144 clrf secs
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
145 bcf onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
146
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
147 set_time_done_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
148 btfss onesecupdate
50
heinrichsweikamp
parents: 0
diff changeset
149 bra set_time_done_loop
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
150 bcf onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
151
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
152 call set_date_refresh
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
153
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
154 WIN_LEFT .70
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
155 WIN_TOP .65
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
156 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
157 movff hours,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
158 output_99x
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 53
diff changeset
159 PUTC ':'
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
160 movff mins,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
161 output_99x
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 53
diff changeset
162 PUTC ':'
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
163 movff secs,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
164 output_99x
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 53
diff changeset
165 STRCAT_PRINT " "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
166
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
167 decfsz wait_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
168 bra set_time_done_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
169 exit_settime: ;Exit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
170 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
171 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
172 goto more_menu2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
173
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
174
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
175 set_time_next_or_exit:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
176 btfsc set_year
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
177 bsf menubit4 ; quit settime
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
178 incf menupos2,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
179 movff menupos2,menupos3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
180
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
181 dcfsnz menupos3,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
182 bsf set_minutes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
183 dcfsnz menupos3,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
184 bsf set_month
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
185 dcfsnz menupos3,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
186 bsf set_day
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
187 dcfsnz menupos3,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
188 bsf set_year
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
189
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
190 WIN_LEFT .32
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
191 WIN_TOP .155
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 53
diff changeset
192 call PLED_standard_color
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
193 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
194 OUTPUTTEXT .94 ; Set
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
195
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
196 movff menupos2,menupos3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
197 decfsz menupos3,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
198 bra set_time_next_or_exit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
199 OUTPUTTEXT .90 ; Minutes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
200 bra set_time_next_or_exit5
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
201 set_time_next_or_exit2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
202 decfsz menupos3,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
203 bra set_time_next_or_exit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
204 OUTPUTTEXT .91 ; Month
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
205 bra set_time_next_or_exit5
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
206 set_time_next_or_exit3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
207 decfsz menupos3,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
208 bra set_time_next_or_exit4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
209 OUTPUTTEXT .92 ; Day
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
210 bra set_time_next_or_exit5
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
211 set_time_next_or_exit4:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
212 OUTPUTTEXT .93 ; Year
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
213
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
214 set_time_next_or_exit5:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
215 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
216 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
217 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
218
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
219 add_hours_or_minutes_or_date:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
220 bcf switch_right
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
221 clrf secs
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
222
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
223 btfsc set_year
50
heinrichsweikamp
parents: 0
diff changeset
224 bra add_year
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
225
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
226 btfsc set_day
50
heinrichsweikamp
parents: 0
diff changeset
227 bra add_day
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
228
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
229 btfsc set_month
50
heinrichsweikamp
parents: 0
diff changeset
230 bra add_month
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
231
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
232 btfsc set_minutes
50
heinrichsweikamp
parents: 0
diff changeset
233 bra add_minutes
heinrichsweikamp
parents: 0
diff changeset
234 ; Increase hours
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
235 add_hours:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
236 incf hours,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
237 movlw d'23'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
238 cpfsgt hours
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
239 bra set_time_refresh_x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
240 clrf hours
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
241 bra set_time_refresh_x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
242 add_minutes:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
243 incf mins,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
244 movlw d'59'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
245 cpfsgt mins
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
246 bra set_time_refresh_x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
247 clrf mins
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
248 bra set_time_refresh_x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
249 add_day:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
250 incf day,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
251 movlw d'31'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
252 cpfsgt day
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
253 bra set_time_refresh_x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
254 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
255 movwf day
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
256 bra set_time_refresh_x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
257 add_month:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
258 incf month,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
259 movlw d'12'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
260 cpfsgt month
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
261 bra set_time_refresh_x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
262 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
263 movwf month
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
264 bra set_time_refresh_x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
265 add_year:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
266 incf year,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
267 movlw d'20' ; calendar until 2020
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
268 cpfsgt year
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
269 bra set_time_refresh_x
53
263348f83485 1.70 cleaning the code
heinrichsweikamp
parents: 50
diff changeset
270 movlw d'10'
263348f83485 1.70 cleaning the code
heinrichsweikamp
parents: 50
diff changeset
271 movwf year ; Set Year to 2010
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
272
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
273 set_time_refresh_x:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
274 call set_time_refresh
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
275 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
276 return