mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-23 08:06:13 +01:00
DC frequency uno does not have timers anyway step #5
This commit is contained in:
parent
ba0a41b6f2
commit
d4f0a7c8f3
5
DCC.cpp
5
DCC.cpp
|
@ -155,12 +155,17 @@ uint8_t DCC::getThrottleSpeedByte(int cab) {
|
||||||
|
|
||||||
// returns 0 to 3 for frequency
|
// returns 0 to 3 for frequency
|
||||||
uint8_t DCC::getThrottleFrequency(int cab) {
|
uint8_t DCC::getThrottleFrequency(int cab) {
|
||||||
|
#if defined(ARDUINO_AVR_UNO)
|
||||||
|
(void)cab;
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
int reg=lookupSpeedTable(cab);
|
int reg=lookupSpeedTable(cab);
|
||||||
if (reg<0)
|
if (reg<0)
|
||||||
return 0; // use default frequency
|
return 0; // use default frequency
|
||||||
uint8_t res = (uint8_t)(speedTable[reg].functions >>30);
|
uint8_t res = (uint8_t)(speedTable[reg].functions >>30);
|
||||||
DIAG(F("Speed table %d functions %l shifted %d"), reg, speedTable[reg].functions, res);
|
DIAG(F("Speed table %d functions %l shifted %d"), reg, speedTable[reg].functions, res);
|
||||||
return res; // shift out first 29 bits so we have the "frequency bits" left
|
return res; // shift out first 29 bits so we have the "frequency bits" left
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns direction on loco
|
// returns direction on loco
|
||||||
|
|
Loading…
Reference in New Issue
Block a user