remove obsolete files
This commit is contained in:
parent
c3305aeeae
commit
69d13b65d0
44
src/adc.cpp
44
src/adc.cpp
@ -1,44 +0,0 @@
|
|||||||
/*
|
|
||||||
* adc.cpp
|
|
||||||
*
|
|
||||||
* Created on: 03.10.2014
|
|
||||||
* Author: wn
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <msp430g2553.h>
|
|
||||||
#include <isr_compat.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include "adc.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void adcInit() {
|
|
||||||
ADC10CTL0 = ADC10SHT_0 | ADC10ON | SREF_0;
|
|
||||||
ADC10CTL1 = INCH_7 | ADC10SSEL_3 | ADC10DIV_2;
|
|
||||||
ADC10AE0 = BIT7;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t adcGet() {
|
|
||||||
uint16_t res = 0xffff;
|
|
||||||
|
|
||||||
ADC10CTL0 |= ENC | ADC10SC;
|
|
||||||
|
|
||||||
uint32_t timeOut = ADC_TIME_OUT;
|
|
||||||
|
|
||||||
while (1) {
|
|
||||||
timeOut--;
|
|
||||||
if (timeOut == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if ((ADC10CTL0 & ADC10IFG) != 0) {
|
|
||||||
res = ADC10MEM;
|
|
||||||
res >>= 1;
|
|
||||||
ADC10CTL0 &= ~(ADC10IFG | ENC);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user