comparison code_part1/OSTC_code_asm_part1/menu_ppO2.asm @ 576:ab2686087bce

faster font display, code cleaning
author heinrichsweikamp
date Sun, 22 Apr 2012 14:38:10 +0200
parents cbdcbbc91877
children 2ab9e9a8a189
comparison
equal deleted inserted replaced
575:cbdcbbc91877 576:ab2686087bce
26 menu_const_ppO2: 26 menu_const_ppO2:
27 movlw d'1' 27 movlw d'1'
28 movwf menupos 28 movwf menupos
29 29
30 bcf menubit4 30 bcf menubit4
31 bcf cursor
32 bcf sleepmode
33 clrf decodata+0 ; Here: # of SP 31 clrf decodata+0 ; Here: # of SP
34 bcf first_FA ; Here: =1: -, =0: + 32 bcf first_FA ; Here: =1: -, =0: +
35 bcf second_FA ; Here: =1: 1, =0: 10 steps 33 bcf second_FA ; Here: =1: 1, =0: 10 steps
36 34
37 menu_const_ppO20: 35 menu_const_ppO20:
42 DISPLAYTEXT .111 ; Constant ppO2 Setup 40 DISPLAYTEXT .111 ; Constant ppO2 Setup
43 WIN_INVERT .0 ; Init new Wordprocessor 41 WIN_INVERT .0 ; Init new Wordprocessor
44 42
45 43
46 menu_const_ppO21: 44 menu_const_ppO21:
47 clrf timeout_counter2
48 bcf menubit2
49 bcf menubit3
50
51 WIN_LEFT .20 45 WIN_LEFT .20
52 WIN_TOP .35 46 WIN_TOP .35
53 lfsr FSR2,letter 47 lfsr FSR2,letter
54 OUTPUTTEXT .112 ; SP# 48 OUTPUTTEXT .112 ; SP#
55 movff decodata+0,lo 49 movff decodata+0,lo
128 OUTPUTTEXT .89 ; "Default: " 122 OUTPUTTEXT .89 ; "Default: "
129 STRCAT_PRINT "1.00" 123 STRCAT_PRINT "1.00"
130 124
131 DISPLAYTEXT .11 ; Exit 125 DISPLAYTEXT .11 ; Exit
132 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! 126 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
127 call menu_pre_loop_common ; Clear some menu flags, timeout and switches
133 call PLED_menu_cursor 128 call PLED_menu_cursor
134 129
135 menu_const_ppO2_loop: 130 menu_const_ppO2_loop:
136 call check_switches_logbook 131 call check_switches_logbook
137 132
165 bra menu_const_ppO23 ; No 160 bra menu_const_ppO23 ; No
166 movlw d'1' 161 movlw d'1'
167 movwf menupos 162 movwf menupos
168 163
169 menu_const_ppO23: 164 menu_const_ppO23:
170 clrf timeout_counter2 165 call menu_pre_loop_common ; Clear some menu flags, timeout and switches
171 call PLED_menu_cursor 166 call PLED_menu_cursor
172
173 ; debounce switches
174 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
175 bcf menubit3 ; clear flag
176 bra menu_const_ppO2_loop 167 bra menu_const_ppO2_loop
177 168
178 do_menu_const_ppO2: 169 do_menu_const_ppO2:
179 dcfsnz menupos,F 170 dcfsnz menupos,F
180 bra next_ppO2 171 bra next_ppO2
229 movff lo,EEDATA ; write result 220 movff lo,EEDATA ; write result
230 call write_eeprom ; save result in EEPROM 221 call write_eeprom ; save result in EEPROM
231 222
232 movlw d'4' 223 movlw d'4'
233 movwf menupos 224 movwf menupos
234 bra menu_const_ppO21 225 bra menu_const_ppO21
235 226
236 change_ppo2_reset: ; reset to 1.00Bar 227 change_ppo2_reset: ; reset to 1.00Bar
237 movf decodata+0,W ; read current value 228 movf decodata+0,W ; read current value
238 addlw d'36' ; offset in memory 229 addlw d'36' ; offset in memory
239 movwf EEADR 230 movwf EEADR
251 bra next_ppO22 242 bra next_ppO22
252 clrf decodata+0 ; yes, so reset to zero 243 clrf decodata+0 ; yes, so reset to zero
253 next_ppO22: 244 next_ppO22:
254 movlw d'1' 245 movlw d'1'
255 movwf menupos 246 movwf menupos
256 bra menu_const_ppO21 247 bra menu_const_ppO21