mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-22 23:56:13 +01:00
Add MEGAAVR ADCeee skeleton.
This commit is contained in:
parent
863c839563
commit
f939ea0768
|
@ -1,4 +1,5 @@
|
||||||
/*
|
/*
|
||||||
|
* © 2022 Paul M. Antoine
|
||||||
* © 2021 Mike S
|
* © 2021 Mike S
|
||||||
* © 2021 Harald Barth
|
* © 2021 Harald Barth
|
||||||
* © 2021 Fred Decker
|
* © 2021 Fred Decker
|
||||||
|
@ -124,5 +125,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