Mercurial > public > hwos_code
comparison src/adc_lightsensor.asm @ 235:23311219dacc
under construction: new hardware_flag to configure different hardware versions
author | heinrichsweikamp |
---|---|
date | Wed, 25 Feb 2015 16:49:59 +0100 |
parents | effd7259f5a5 |
children | e2ea74646127 |
comparison
equal
deleted
inserted
replaced
234:57155164faad | 235:23311219dacc |
---|---|
25 bra wait_adc2 | 25 bra wait_adc2 |
26 return | 26 return |
27 | 27 |
28 global get_battery_voltage | 28 global get_battery_voltage |
29 get_battery_voltage: ; starts ADC and waits until fnished | 29 get_battery_voltage: ; starts ADC and waits until fnished |
30 btfss cr_hardware | 30 btfss rechargeable |
31 bra get_battery_voltage1 ; Normal ostc3 hardware | 31 bra get_battery_voltage1 ; Normal ostc3 hardware |
32 | 32 |
33 call lt2942_get_accumulated_charge | 33 call lt2942_get_accumulated_charge |
34 call lt2942_get_voltage | 34 call lt2942_get_voltage |
35 | 35 |
232 global get_ambient_level | 232 global get_ambient_level |
233 get_ambient_level: ; starts ADC and waits until finished | 233 get_ambient_level: ; starts ADC and waits until finished |
234 btfsc adc_running ; ADC in use? | 234 btfsc adc_running ; ADC in use? |
235 return ; Yes, return | 235 return ; Yes, return |
236 | 236 |
237 btfss cr_hardware | 237 btfss rechargeable |
238 bra get_ambient_level1 ; Normal ostc3 hardware | 238 bra get_ambient_level1 ; Normal ostc3 hardware |
239 | 239 |
240 banksel isr_backup ; Back to Bank0 ISR data | 240 banksel isr_backup ; Back to Bank0 ISR data |
241 movff opt_brightness,isr1_temp | 241 movff opt_brightness,isr1_temp |
242 incf isr1_temp,F ; adjust 0-2 to 1-3 | 242 incf isr1_temp,F ; adjust 0-2 to 1-3 |
301 | 301 |
302 incf isr1_temp,F ; adjust 0-2 to 1-3 | 302 incf isr1_temp,F ; adjust 0-2 to 1-3 |
303 | 303 |
304 banksel common ; flag is in bank1 | 304 banksel common ; flag is in bank1 |
305 movlw ambient_light_max_high_cr; cR hardware brightest setting | 305 movlw ambient_light_max_high_cr; cR hardware brightest setting |
306 btfss cr_hardware | 306 btfss rechargeable |
307 movlw ambient_light_max_high_15V; 1,5V battery brightest setting | 307 movlw ambient_light_max_high_15V; 1,5V battery brightest setting |
308 btfsc battery_is_36v ; 3,6V battery in use? | 308 btfsc battery_is_36v ; 3,6V battery in use? |
309 movlw ambient_light_max_high_36V ; 3,6V battery brightest setting | 309 movlw ambient_light_max_high_36V ; 3,6V battery brightest setting |
310 banksel isr_backup ; Back to Bank0 ISR data | 310 banksel isr_backup ; Back to Bank0 ISR data |
311 | 311 |