mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-23 21:01:25 +01:00
Skeletal ADCee class for STM32
This commit is contained in:
parent
57aa1457e0
commit
888165e987
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* © 2022 Paul M Antoine
|
* © 2022 Paul M. Antoine
|
||||||
* © 2021 Mike S
|
* © 2021 Mike S
|
||||||
* © 2021 Harald Barth
|
* © 2021 Harald Barth
|
||||||
* © 2021 Fred Decker
|
* © 2021 Fred Decker
|
||||||
@ -127,4 +127,31 @@ void DCCTimer::reset() {
|
|||||||
while(true) {};
|
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
|
#endif
|
Loading…
Reference in New Issue
Block a user