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:
parent
2edc223beb
commit
dff7eb37ab
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user