comparison src/adc_lightsensor.asm @ 200:dcd513840c6c

cleanup
author heinrichsweikamp
date Wed, 12 Nov 2014 19:33:15 +0100
parents a0e0ddfc1b49
children 82faedf8fd58
comparison
equal deleted inserted replaced
199:800f09c9089c 200:dcd513840c6c
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 c3_hardware 30 btfss cr_hardware
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 bcf LEDr 35 bcf LEDr
218 global get_ambient_level 218 global get_ambient_level
219 get_ambient_level: ; starts ADC and waits until finished 219 get_ambient_level: ; starts ADC and waits until finished
220 btfsc adc_running ; ADC in use? 220 btfsc adc_running ; ADC in use?
221 return ; Yes, return 221 return ; Yes, return
222 222
223 btfss c3_hardware 223 btfss cr_hardware
224 bra get_ambient_level1 ; Normal ostc3 hardware 224 bra get_ambient_level1 ; Normal ostc3 hardware
225 movlw .250 225 movlw .250
226 movwf ambient_light+0 226 movwf ambient_light+0
227 clrf ambient_light+1 ; Set to max 227 clrf ambient_light+1 ; Set to max
228 bra get_ambient_level2 ; Continue as normal 228 bra get_ambient_level2 ; Continue as normal
272 clrf isr1_temp ; Yes, set temporally to eco mode 272 clrf isr1_temp ; Yes, set temporally to eco mode
273 273
274 incf isr1_temp,F ; adjust 0-2 to 1-3 274 incf isr1_temp,F ; adjust 0-2 to 1-3
275 275
276 banksel common ; flag is in bank1 276 banksel common ; flag is in bank1
277 movlw ambient_light_max_high_c3; c3 hardware brightest setting 277 movlw ambient_light_max_high_cr; cR hardware brightest setting
278 btfss c3_hardware 278 btfss cr_hardware
279 movlw ambient_light_max_high_15V; 1,5V battery brightest setting 279 movlw ambient_light_max_high_15V; 1,5V battery brightest setting
280 btfsc battery_is_36v ; 3,6V battery in use? 280 btfsc battery_is_36v ; 3,6V battery in use?
281 movlw ambient_light_max_high_36V ; 3,6V battery brightest setting 281 movlw ambient_light_max_high_36V ; 3,6V battery brightest setting
282 banksel isr_backup ; Back to Bank0 ISR data 282 banksel isr_backup ; Back to Bank0 ISR data
283 283