Mercurial > public > hwos_code
comparison src/adc_lightsensor.asm @ 354:043890f06bce
some cleanups
author | heinrichsweikamp |
---|---|
date | Wed, 29 Jul 2015 20:39:35 +0200 |
parents | 34e2f5bdc5a2 |
children | 36bd27f42362 |
comparison
equal
deleted
inserted
replaced
353:573f2251cf49 | 354:043890f06bce |
---|---|
241 bra get_ambient_level1 ; Normal ostc3 hardware | 241 bra get_ambient_level1 ; Normal ostc3 hardware |
242 | 242 |
243 banksel isr_backup ; Back to Bank0 ISR data | 243 banksel isr_backup ; Back to Bank0 ISR data |
244 movff opt_brightness,isr1_temp | 244 movff opt_brightness,isr1_temp |
245 incf isr1_temp,F ; adjust 0-2 to 1-3 | 245 incf isr1_temp,F ; adjust 0-2 to 1-3 |
246 movlw ambient_light_max_high_cr; cR hardware brightest setting | 246 movlw ambient_light_max_high_cr; cR and 2 hardware brightest setting |
247 dcfsnz isr1_temp,F | 247 dcfsnz isr1_temp,F |
248 movlw ambient_light_max_eco ; brightest setting | 248 movlw ambient_light_max_eco ; brightest setting |
249 dcfsnz isr1_temp,F | 249 dcfsnz isr1_temp,F |
250 movlw ambient_light_max_medium; brightest setting | 250 movlw ambient_light_max_medium; brightest setting |
251 | 251 |
303 clrf isr1_temp ; Yes, set temporally to eco mode | 303 clrf isr1_temp ; Yes, set temporally to eco mode |
304 | 304 |
305 incf isr1_temp,F ; adjust 0-2 to 1-3 | 305 incf isr1_temp,F ; adjust 0-2 to 1-3 |
306 | 306 |
307 banksel common ; flag is in bank1 | 307 banksel common ; flag is in bank1 |
308 movlw ambient_light_max_high_cr; cR hardware brightest setting | 308 movlw ambient_light_max_high_cr; cR and 2 hardware brightest setting |
309 btfss rechargeable | 309 btfss rechargeable |
310 movlw ambient_light_max_high_15V; 1,5V battery brightest setting | 310 movlw ambient_light_max_high_15V; 1,5V battery brightest setting |
311 btfsc battery_is_36v ; 3,6V battery in use? | 311 btfsc battery_is_36v ; 3,6V battery in use? |
312 movlw ambient_light_max_high_36V ; 3,6V battery brightest setting | 312 movlw ambient_light_max_high_36V ; 3,6V battery brightest setting |
313 banksel isr_backup ; Back to Bank0 ISR data | 313 banksel isr_backup ; Back to Bank0 ISR data |
367 bra get_analog_inputs2a ; No | 367 bra get_analog_inputs2a ; No |
368 ; Yes, ignore this reading | 368 ; Yes, ignore this reading |
369 clrf o2_mv_sensor1+1 | 369 clrf o2_mv_sensor1+1 |
370 clrf o2_mv_sensor1+0 | 370 clrf o2_mv_sensor1+0 |
371 get_analog_inputs2a: | 371 get_analog_inputs2a: |
372 ; Ignore 1,2mV noise for not-connected inputs | 372 ; Ignore 1,9mV noise for not-connected inputs |
373 tstfsz o2_mv_sensor1+1 ; >25,5mV? | 373 tstfsz o2_mv_sensor1+1 ; >25,5mV? |
374 bra get_analog_inputs2 ; Yes, skip here | 374 bra get_analog_inputs2 ; Yes, skip here |
375 movlw .19 | 375 movlw .19 |
376 cpfsgt o2_mv_sensor1+0 ; >1,9mV? | 376 cpfsgt o2_mv_sensor1+0 ; >1,9mV? |
377 clrf o2_mv_sensor1+0 ; no, clear result | 377 clrf o2_mv_sensor1+0 ; no, clear result |
395 bra get_analog_inputs3a ; No | 395 bra get_analog_inputs3a ; No |
396 ; Yes, ignore this reading | 396 ; Yes, ignore this reading |
397 clrf o2_mv_sensor2+1 | 397 clrf o2_mv_sensor2+1 |
398 clrf o2_mv_sensor2+0 | 398 clrf o2_mv_sensor2+0 |
399 get_analog_inputs3a: | 399 get_analog_inputs3a: |
400 ; Ignore 1,2mV noise for not-connected inputs | 400 ; Ignore 1,9mV noise for not-connected inputs |
401 tstfsz o2_mv_sensor2+1 ; >25,5mV? | 401 tstfsz o2_mv_sensor2+1 ; >25,5mV? |
402 bra get_analog_inputs3 ; Yes, skip here | 402 bra get_analog_inputs3 ; Yes, skip here |
403 movlw .19 | 403 movlw .19 |
404 cpfsgt o2_mv_sensor2+0 ; >1,9mV? | 404 cpfsgt o2_mv_sensor2+0 ; >1,9mV? |
405 clrf o2_mv_sensor2+0 ; no, clear result | 405 clrf o2_mv_sensor2+0 ; no, clear result |
423 bra get_analog_inputs4a ; No | 423 bra get_analog_inputs4a ; No |
424 ; Yes, ignore this reading | 424 ; Yes, ignore this reading |
425 clrf o2_mv_sensor3+1 | 425 clrf o2_mv_sensor3+1 |
426 clrf o2_mv_sensor3+0 | 426 clrf o2_mv_sensor3+0 |
427 get_analog_inputs4a: | 427 get_analog_inputs4a: |
428 ; Ignore 1,2mV noise for not-connected inputs | 428 ; Ignore 1,9mV noise for not-connected inputs |
429 tstfsz o2_mv_sensor3+1 ; >25,5mV? | 429 tstfsz o2_mv_sensor3+1 ; >25,5mV? |
430 bra get_analog_inputs4 ; Yes, skip here | 430 bra get_analog_inputs4 ; Yes, skip here |
431 movlw .19 | 431 movlw .19 |
432 cpfsgt o2_mv_sensor3+0 ; >1,9mV? | 432 cpfsgt o2_mv_sensor3+0 ; >1,9mV? |
433 clrf o2_mv_sensor3+0 ; no, clear result | 433 clrf o2_mv_sensor3+0 ; no, clear result |