Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/menu.asm @ 576:ab2686087bce
faster font display, code cleaning
author | heinrichsweikamp |
---|---|
date | Sun, 22 Apr 2012 14:38:10 +0200 |
parents | cbdcbbc91877 |
children | fbd5e2b75a63 |
comparison
equal
deleted
inserted
replaced
575:cbdcbbc91877 | 576:ab2686087bce |
---|---|
32 bcf deco_mode_changed ; Clear flag (Description is only showed once) | 32 bcf deco_mode_changed ; Clear flag (Description is only showed once) |
33 bcf LED_blue | 33 bcf LED_blue |
34 movlw d'1' | 34 movlw d'1' |
35 movwf menupos | 35 movwf menupos |
36 menu2: | 36 menu2: |
37 | |
38 bcf leftbind | |
39 call PLED_ClearScreen | 37 call PLED_ClearScreen |
40 clrf timeout_counter2 | 38 call menu_pre_loop_common ; Clear some menu flags, timeout and switches |
41 bcf sleepmode | |
42 bcf menubit2 | |
43 bcf menubit3 | |
44 bsf menubit | |
45 bsf cursor | |
46 call PLED_menu_mask | 39 call PLED_menu_mask |
47 call PLED_menu_cursor | 40 call PLED_menu_cursor |
48 rcall wait_switches | |
49 | 41 |
50 menu_loop: | 42 menu_loop: |
51 call check_switches_menu | 43 call check_switches_menu |
52 | 44 |
53 btfsc menubit2 | 45 btfsc menubit2 |
74 bra check_switches_menu2 | 66 bra check_switches_menu2 |
75 bsf menubit3 | 67 bsf menubit3 |
76 incf menupos,F | 68 incf menupos,F |
77 movlw d'6' | 69 movlw d'6' |
78 cpfsgt menupos | 70 cpfsgt menupos |
79 bra refresh_cursor | 71 bra refresh_cursor ; Returns |
80 movlw d'1' | 72 movlw d'1' |
81 movwf menupos | 73 movwf menupos |
82 bra refresh_cursor | 74 bra refresh_cursor ; Returns |
83 check_switches_menu2: | 75 check_switches_menu2: |
84 btfsc switch_left | 76 btfsc switch_left |
85 bsf menubit2 ; Enter! | 77 bsf menubit2 ; Enter! |
86 return | 78 return |
87 | 79 |
100 dcfsnz menupos,F | 92 dcfsnz menupos,F |
101 goto restart ; exit... | 93 goto restart ; exit... |
102 | 94 |
103 refresh_cursor: | 95 refresh_cursor: |
104 clrf timeout_counter2 | 96 clrf timeout_counter2 |
105 btfsc cursor | |
106 call PLED_menu_cursor | 97 call PLED_menu_cursor |
107 bcf switch_right | 98 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! |
108 bcf switch_left | |
109 return | 99 return |
110 | 100 |
111 more_menu: | 101 more_menu: |
112 movlw d'1' | 102 movlw d'1' |
113 movwf menupos | 103 movwf menupos |
114 more_menu2: | 104 more_menu2: |
115 bcf leftbind | 105 bcf leftbind |
116 call PLED_ClearScreen | 106 call PLED_ClearScreen |
117 more_menu3: | 107 more_menu3: |
118 clrf timeout_counter2 | 108 call menu_pre_loop_common ; Clear some menu flags, timeout and switches |
119 bcf sleepmode | |
120 bcf menubit2 | |
121 bcf menubit3 | |
122 bsf menubit | |
123 bsf cursor | |
124 call PLED_more_menu_mask | 109 call PLED_more_menu_mask |
125 call PLED_menu_cursor | 110 call PLED_menu_cursor |
126 bcf switch_left | |
127 bcf switch_right | |
128 more_menu_loop: | 111 more_menu_loop: |
129 call check_switches_menu | 112 call check_switches_menu |
130 | 113 |
131 ; movlw d'5' ; 5 items in "More Menu" | 114 ; movlw d'5' ; 5 items in "More Menu" |
132 ; cpfseq menupos | 115 ; cpfseq menupos |
174 setup_menu2: | 157 setup_menu2: |
175 bcf leftbind | 158 bcf leftbind |
176 call PLED_ClearScreen | 159 call PLED_ClearScreen |
177 call PLED_setup_menu_mask | 160 call PLED_setup_menu_mask |
178 setup_menu3a: | 161 setup_menu3a: |
179 clrf timeout_counter2 | 162 call menu_pre_loop_common ; Clear some menu flags, timeout and switches |
180 bcf sleepmode | |
181 bcf menubit2 | |
182 bcf menubit3 | |
183 bsf menubit | |
184 bsf cursor | |
185 call show_decotype | 163 call show_decotype |
186 call PLED_menu_cursor | 164 call PLED_menu_cursor |
187 bcf switch_left | |
188 bcf switch_right | |
189 | 165 |
190 setup_menu_loop: | 166 setup_menu_loop: |
191 call check_switches_menu | 167 call check_switches_menu |
192 | 168 |
193 btfsc menubit2 | 169 btfsc menubit2 |
312 more_setup_menu2: | 288 more_setup_menu2: |
313 bcf leftbind | 289 bcf leftbind |
314 call PLED_ClearScreen | 290 call PLED_ClearScreen |
315 call PLED_more_setup_menu_mask | 291 call PLED_more_setup_menu_mask |
316 more_setup_menu3a: | 292 more_setup_menu3a: |
317 clrf timeout_counter2 | 293 call menu_pre_loop_common ; Clear some menu flags, timeout and switches |
318 bcf sleepmode | |
319 bcf menubit2 | |
320 bcf menubit3 | |
321 bsf menubit | |
322 bsf cursor | |
323 call show_debugstate | 294 call show_debugstate |
324 call show_dateformat | 295 call show_dateformat |
325 call show_salinity_value | 296 call show_salinity_value |
326 call PLED_menu_cursor | 297 call PLED_menu_cursor |
327 call toggle_brightness_show | 298 call toggle_brightness_show |
328 bcf switch_left | |
329 bcf switch_right | |
330 | 299 |
331 more_setup_menu_loop: | 300 more_setup_menu_loop: |
332 call check_switches_menu | 301 call check_switches_menu |
333 | 302 |
334 ; movlw d'5' ; x-1 menu entries | 303 ; movlw d'5' ; x-1 menu entries |
540 call set_dive_modes ; Check thresholds | 509 call set_dive_modes ; Check thresholds |
541 call timeout_surfmode ; Sets sleepmode flag if timeout | 510 call timeout_surfmode ; Sets sleepmode flag if timeout |
542 btfsc divemode | 511 btfsc divemode |
543 goto restart ; dive started! | 512 goto restart ; dive started! |
544 return | 513 return |
514 | |
515 menu_pre_loop_common: ; Clear some menu flags and the timeout | |
516 clrf timeout_counter2 | |
517 bcf leftbind | |
518 bcf sleepmode | |
519 bcf menubit2 | |
520 bcf menubit3 | |
521 bsf menubit | |
522 bcf switch_left | |
523 bcf switch_right | |
524 return |