mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-24 08:36:14 +01:00
doesn't work, gonna commit before i try a new path
This commit is contained in:
parent
bbca4379d2
commit
0a63befee9
|
@ -47,6 +47,7 @@ INTERRUPT_CALLBACK interruptHandler=0;
|
||||||
//HardwareTimer* timerAux = NULL;
|
//HardwareTimer* timerAux = NULL;
|
||||||
HardwareTimer timer(TIM2);
|
HardwareTimer timer(TIM2);
|
||||||
HardwareTimer timerAux(TIM3);
|
HardwareTimer timerAux(TIM3);
|
||||||
|
|
||||||
static bool tim2ModeHA = false;
|
static bool tim2ModeHA = false;
|
||||||
static bool tim3ModeHA = false;
|
static bool tim3ModeHA = false;
|
||||||
|
|
||||||
|
@ -166,9 +167,9 @@ int16_t ADCee::ADCmax()
|
||||||
}
|
}
|
||||||
|
|
||||||
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 123; // random number, faked for now
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -180,13 +181,13 @@ int ADCee::read(uint8_t pin, bool fromISR) {
|
||||||
//if (!fromISR) noInterrupts();
|
//if (!fromISR) noInterrupts();
|
||||||
//current = analogRead(pin);
|
//current = analogRead(pin);
|
||||||
//if (!fromISR) interrupts();
|
//if (!fromISR) interrupts();
|
||||||
PinName name = analogPinToPinName(pin);
|
|
||||||
mbed::AnalogIn* adc = analogPinToAdcObj(pin);
|
mbed::AnalogIn* adc = analogPinToAdcObj(pin);
|
||||||
if (adc == NULL) {
|
if (adc == NULL) {
|
||||||
adc = new mbed::AnalogIn(name);
|
adc = new mbed::AnalogIn(analogPinToPinName(pin));
|
||||||
analogPinToAdcObj(pin) = adc;
|
analogPinToAdcObj(pin) = adc;
|
||||||
}
|
}
|
||||||
return (adc->read_u16() >> (16 - 12));
|
return (int)(adc->read_u16() >> (16 - 10));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user