N K
/
GaNtroller
a fork of priustroller
Fork of priustroller_current by
Diff: sensors/sensors.h
- Revision:
- 30:2b6d426f3bfc
- Parent:
- 29:cb03760ba9ea
- Child:
- 33:e7b132029bae
--- a/sensors/sensors.h Sat Mar 14 23:42:46 2015 +0000 +++ b/sensors/sensors.h Sun Mar 15 01:45:22 2015 +0000 @@ -70,15 +70,4 @@ VoltageSensor *_in; }; -inline float NativeAnalogIn::Read() { - TIM2->DIER = 0x0000; - ADC1->SQR3 = 0x0000; - ADC1->SQR3 |= _channel; - ADC1->CR2 |= ADC_CR2_SWSTART; - while ((ADC1->SR & 2) == 0){} - float x = ADC1->DR; - TIM2->DIER = 0x0001; - return x / 4095.0f; -} - #endif \ No newline at end of file