Mercurial > public > hwos_code
comparison src/adc_lightsensor.asm @ 626:be8787f2034d
compass3 support for 3.01 branch
author | heinrichsweikamp |
---|---|
date | Sun, 23 Jun 2019 15:21:16 +0200 |
parents | b87f23fae743 |
children |
comparison
equal
deleted
inserted
replaced
625:5c2ca77ce2df | 626:be8787f2034d |
---|---|
544 bcf analog_sw2_pressed ; - clear flag for analog switch 2 | 544 bcf analog_sw2_pressed ; - clear flag for analog switch 2 |
545 return ; - done | 545 return ; - done |
546 get_analog_switches2: | 546 get_analog_switches2: |
547 btfsc adc_running ; ADC in use? | 547 btfsc adc_running ; ADC in use? |
548 return ; YES - abort | 548 return ; YES - abort |
549 ; NO | 549 btfsc cc_active ; Charging? |
550 return ; YES - abort | |
550 movlw b'00001001' ; left justified | 551 movlw b'00001001' ; left justified |
551 movwf ADCON2 | 552 movwf ADCON2 |
552 ; movlw b'00000000' ; Vref+ = Vdd | 553 ; movlw b'00000000' ; Vref+ = Vdd |
553 clrf ADCON1 | 554 clrf ADCON1 |
554 movlw b'00100101' ; power on ADC, select AN9 | 555 movlw b'00100101' ; power on ADC, select AN9 |