mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-23 04:41:24 +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 Harald Barth
|
||||
* © 2021 Fred Decker
|
||||
@ -124,5 +125,31 @@ void DCCTimer::reset() {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user