From 0a63befee94d1549af8b884ddac3952948d75e2d Mon Sep 17 00:00:00 2001 From: travis-farmer Date: Mon, 23 Oct 2023 15:50:02 -0400 Subject: [PATCH] doesn't work, gonna commit before i try a new path --- DCCTimerGiga.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/DCCTimerGiga.cpp b/DCCTimerGiga.cpp index 580992c..1adc7c7 100644 --- a/DCCTimerGiga.cpp +++ b/DCCTimerGiga.cpp @@ -47,6 +47,7 @@ INTERRUPT_CALLBACK interruptHandler=0; //HardwareTimer* timerAux = NULL; HardwareTimer timer(TIM2); HardwareTimer timerAux(TIM3); + static bool tim2ModeHA = false; static bool tim3ModeHA = false; @@ -166,9 +167,9 @@ int16_t ADCee::ADCmax() } int ADCee::init(uint8_t pin) { - analogReadResolution(12); - //DIAG(F("ADCee Init: current val:%d"),analogRead(pin)); - return analogRead(pin); + + + return 123; // random number, faked for now } /* @@ -180,13 +181,13 @@ int ADCee::read(uint8_t pin, bool fromISR) { //if (!fromISR) noInterrupts(); //current = analogRead(pin); //if (!fromISR) interrupts(); - PinName name = analogPinToPinName(pin); + mbed::AnalogIn* adc = analogPinToAdcObj(pin); if (adc == NULL) { - adc = new mbed::AnalogIn(name); + adc = new mbed::AnalogIn(analogPinToPinName(pin)); analogPinToAdcObj(pin) = adc; } - return (adc->read_u16() >> (16 - 12)); + return (int)(adc->read_u16() >> (16 - 10)); } /*