diff --git a/DCCTimer.h b/DCCTimer.h index a9baf0e..a50c669 100644 --- a/DCCTimer.h +++ b/DCCTimer.h @@ -1,7 +1,7 @@ /* * © 2022 Paul M Antoine * © 2021 Mike S - * © 2021 Harald Barth + * © 2021-2022 Harald Barth * © 2021 Fred Decker * All rights reserved. * @@ -93,7 +93,7 @@ private: }; -class Adc { +class ADCee { public: // On architectures that use the analog read during DCC waveform // with specially configured ADC, for example AVR, init must be diff --git a/DCCTimerAVR.cpp b/DCCTimerAVR.cpp index 74611e1..6759ac9 100644 --- a/DCCTimerAVR.cpp +++ b/DCCTimerAVR.cpp @@ -124,15 +124,15 @@ void DCCTimer::reset() { #else #define NUM_ADC_INPUTS 15 #endif -uint16_t Adc::usedpins = 0; -int * Adc::analogvals = NULL; +uint16_t ADCee::usedpins = 0; +int * ADCee::analogvals = NULL; /* * Register a new pin to be scanned * Returns current reading of pin and * stores that as well */ -int Adc::init(uint8_t pin) { +int ADCee::init(uint8_t pin) { uint8_t id = pin - A0; if (id > NUM_ADC_INPUTS) return -1023; @@ -145,9 +145,9 @@ int Adc::init(uint8_t pin) { return value; } /* - * Read function Adc::read(pin) to get value instead of analogRead(pin) + * Read function ADCee::read(pin) to get value instead of analogRead(pin) */ -int Adc::read(uint8_t pin, bool fromISR) { +int ADCee::read(uint8_t pin, bool fromISR) { (void)fromISR; // AVR does ignore this arg uint8_t id = pin - A0; if ((usedpins & (1< */ LOW}; void DCCWaveform::begin() { - Adc::begin(); + ADCee::begin(); DCCTimer::begin(DCCWaveform::interruptHandler); } @@ -82,8 +82,8 @@ void DCCWaveform::interruptHandler() { TrackManager::setDCCSignal(sigMain); TrackManager::setPROGSignal(sigProg); - // Refresh the values in the Adc object buffering the values of the ADC HW - Adc::scan(); + // Refresh the values in the ADCee object buffering the values of the ADC HW + ADCee::scan(); // Move on in the state engine mainTrack.state=stateTransform[mainTrack.state]; diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index 241f0e4..c8cba40 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "PORTX-HAL-202210041956Z" +#define GITHUB_SHA "PORTX-HAL-202210042018Z" diff --git a/MotorDriver.cpp b/MotorDriver.cpp index 666013f..cef38fa 100644 --- a/MotorDriver.cpp +++ b/MotorDriver.cpp @@ -92,7 +92,7 @@ MotorDriver::MotorDriver(int16_t power_pin, byte signal_pin, byte signal_pin2, i currentPin=current_pin; if (currentPin!=UNUSED_PIN) { - senseOffset = Adc::init(currentPin); + senseOffset = ADCee::init(currentPin); } faultPin=fault_pin; @@ -194,7 +194,7 @@ int MotorDriver::getCurrentRaw(bool fromISR) { (void)fromISR; if (currentPin==UNUSED_PIN) return 0; int current; - current = Adc::read(currentPin, fromISR)-senseOffset; + current = ADCee::read(currentPin, fromISR)-senseOffset; if (current<0) current=0-current; if ((faultPin != UNUSED_PIN) && isLOW(fastFaultPin) && powerMode==POWERMODE::ON) return (current == 0 ? -1 : -current);