annotate code_part1/OSTC_code_asm_part1/menu_settime.asm @ 6:ee55e8d66102

build included
author heinrichsweikamp
date Mon, 15 Feb 2010 16:08:56 +0100
parents 96a35aeda5f2
children c97c5514b165
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
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
88 movlw ':'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
89 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
90 movff mins,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
91 output_99x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
92 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
93 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
94 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
95 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
96 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
97
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
98 set_date_refresh:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
99 WIN_LEFT .70
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
100 WIN_TOP .95
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
101 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
102 movff month,convert_value_temp+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
103 movff day,convert_value_temp+1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
104 movff year,convert_value_temp+2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
105 call PLED_convert_date ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
106 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
107 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
108 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
109 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
110 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
111 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
112
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
113
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
114 set_time_done: ; Check date
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
115 movff month,lo ; new month
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
116 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
117 movlw .31
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
118 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
119 movlw .28
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 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
131 movlw .31
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
132 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
133 movlw .30
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
134 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
135 movlw .31
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
136 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
137 movlw .30
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
138 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
139 movlw .31
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
140 cpfsgt day ; day ok?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
141 bra set_time_done2 ; OK
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
142 movlw .1 ; not OK, set to 1st
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
143 movwf day
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
144
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
145 set_time_done2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
146 WIN_LEFT .32
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
147 WIN_TOP .155
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
148 movlw d'8'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
149 movwf temp1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
150 call PLED_display_clear_common_y1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
151
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
152 movlw d'5'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
153 movwf wait_temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
154 clrf secs
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
155 bcf onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
156
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
157 set_time_done_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
158 btfss onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
159 bra set_time_done_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
160 bcf onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
161
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
162 call set_date_refresh
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
163
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
164 WIN_LEFT .70
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
165 WIN_TOP .65
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
166 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
167 movff hours,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
168 output_99x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
169 movlw ':'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
170 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
171 movff mins,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
172 output_99x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
173 movlw ':'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
174 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
175 movff secs,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
176 output_99x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
177 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
178 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
179 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
180
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
181 decfsz wait_temp,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
182 bra set_time_done_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
183 exit_settime: ;Exit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
184 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
185 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
186 goto more_menu2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
187
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
188
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
189 set_time_next_or_exit:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
190 btfsc set_year
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
191 bsf menubit4 ; quit settime
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
192 incf menupos2,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
193 movff menupos2,menupos3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
194
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
195 dcfsnz menupos3,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
196 bsf set_minutes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
197 dcfsnz menupos3,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
198 bsf set_month
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
199 dcfsnz menupos3,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
200 bsf set_day
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
201 dcfsnz menupos3,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
202 bsf set_year
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
203
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
204 WIN_LEFT .32
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
205 WIN_TOP .155
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
206 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
207 OUTPUTTEXT .94 ; Set
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
208
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
209 movff menupos2,menupos3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
210 decfsz menupos3,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
211 bra set_time_next_or_exit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
212 OUTPUTTEXT .90 ; Minutes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
213 bra set_time_next_or_exit5
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
214 set_time_next_or_exit2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
215 decfsz menupos3,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
216 bra set_time_next_or_exit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
217 OUTPUTTEXT .91 ; Month
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
218 bra set_time_next_or_exit5
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
219 set_time_next_or_exit3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
220 decfsz menupos3,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
221 bra set_time_next_or_exit4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
222 OUTPUTTEXT .92 ; Day
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
223 bra set_time_next_or_exit5
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
224 set_time_next_or_exit4:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
225 OUTPUTTEXT .93 ; Year
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
226
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
227 set_time_next_or_exit5:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
228 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
229 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
230 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
231
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
232
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
233 add_hours_or_minutes_or_date:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
234 bcf switch_right
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
235 clrf secs
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
236
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
237 btfsc set_year
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
238 bra add_year
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
239
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
240 btfsc set_day
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
241 bra add_day
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
242
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
243 btfsc set_month
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
244 bra add_month
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
245
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
246 btfsc set_minutes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
247 bra add_minutes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
248 ; Also Stunden erhöhen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
249 add_hours:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
250 incf hours,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
251 movlw d'23'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
252 cpfsgt hours
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
253 bra set_time_refresh_x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
254 clrf hours
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
255 bra set_time_refresh_x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
256 add_minutes:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
257 incf mins,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
258 movlw d'59'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
259 cpfsgt mins
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
260 bra set_time_refresh_x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
261 clrf mins
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
262 bra set_time_refresh_x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
263 add_day:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
264 incf day,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
265 movlw d'31'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
266 cpfsgt day
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
267 bra set_time_refresh_x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
268 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
269 movwf day
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
270 bra set_time_refresh_x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
271 add_month:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
272 incf month,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
273 movlw d'12'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
274 cpfsgt month
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
275 bra set_time_refresh_x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
276 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
277 movwf month
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
278 bra set_time_refresh_x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
279 add_year:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
280 incf year,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
281 movlw d'20' ; calendar until 2020
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
282 cpfsgt year
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
283 bra set_time_refresh_x
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
284 movlw d'8'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
285 movwf year ; Set Year to 2008
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
286
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
287 set_time_refresh_x:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
288 call set_time_refresh
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
289 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
290 return