1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-24 08:36:14 +01:00

works, so far

This commit is contained in:
travis-farmer 2023-10-23 10:30:04 -04:00
parent 2edc223beb
commit dff7eb37ab

View File

@ -160,10 +160,12 @@ void DCCTimer::reset() {
int16_t ADCee::ADCmax() int16_t ADCee::ADCmax()
{ {
return 1023; return 4095;
} }
int ADCee::init(uint8_t pin) { int ADCee::init(uint8_t pin) {
analogReadResolution(12);
//DIAG(F("ADCee Init: current val:%d"),analogRead(pin));
return analogRead(pin); return analogRead(pin);
} }
@ -172,9 +174,11 @@ int ADCee::init(uint8_t pin) {
*/ */
int ADCee::read(uint8_t pin, bool fromISR) { int ADCee::read(uint8_t pin, bool fromISR) {
int current; int current;
if (!fromISR) noInterrupts(); //DIAG(F("ADCee Read:%d"),fromISR);
//if (!fromISR) noInterrupts();
current = analogRead(pin); current = analogRead(pin);
if (!fromISR) interrupts(); //if (!fromISR) interrupts();
return current; return current;
} }
@ -189,6 +193,7 @@ void ADCee::scan() {
void ADCee::begin() { void ADCee::begin() {
noInterrupts(); noInterrupts();
interrupts(); interrupts();
} }
#endif #endif