diff --git a/DCCTimerMEGAAVR.cpp b/DCCTimerMEGAAVR.cpp index be9248e..2b2bdab 100644 --- a/DCCTimerMEGAAVR.cpp +++ b/DCCTimerMEGAAVR.cpp @@ -1,4 +1,5 @@ /* + * © 2022 Paul M. Antoine * © 2021 Mike S * © 2021 Harald Barth * © 2021 Fred Decker @@ -124,5 +125,31 @@ void DCCTimer::reset() { while(true){} } +int16_t ADCee::ADCmax() { + return 4095; +} +int ADCee::init(uint8_t pin) { + return analogRead(pin); +} +/* + * Read function ADCee::read(pin) to get value instead of analogRead(pin) + */ +int ADCee::read(uint8_t pin, bool fromISR) { + int current; + if (!fromISR) noInterrupts(); + current = analogRead(pin); + if (!fromISR) interrupts(); + return current; +} +/* + * Scan function that is called from interrupt + */ +void ADCee::scan() { +} + +void ADCee::begin() { + noInterrupts(); + interrupts(); +} #endif