mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-24 08:36:14 +01:00
Compare commits
2 Commits
8223d30892
...
c458e98cd3
Author | SHA1 | Date | |
---|---|---|---|
|
c458e98cd3 | ||
|
f254643a1d |
|
@ -92,6 +92,7 @@ private:
|
||||||
#if defined(ARDUINO_ARCH_STM32) // TODO: PMA temporary hack - assumes 100Mhz F_CPU as STM32 can change frequency
|
#if defined(ARDUINO_ARCH_STM32) // TODO: PMA temporary hack - assumes 100Mhz F_CPU as STM32 can change frequency
|
||||||
static const long CLOCK_CYCLES=(100000000L / 1000000 * DCC_SIGNAL_TIME) >>1;
|
static const long CLOCK_CYCLES=(100000000L / 1000000 * DCC_SIGNAL_TIME) >>1;
|
||||||
#elif defined(ARDUINO_GIGA)
|
#elif defined(ARDUINO_GIGA)
|
||||||
|
///TJF: we could get F_CPU from SystemCoreClock, but it will not allow as it is a non-constant value
|
||||||
static const long CLOCK_CYCLES=(480000000L / 1000000 * DCC_SIGNAL_TIME) >>1;
|
static const long CLOCK_CYCLES=(480000000L / 1000000 * DCC_SIGNAL_TIME) >>1;
|
||||||
#else
|
#else
|
||||||
static const long CLOCK_CYCLES=(F_CPU / 1000000 * DCC_SIGNAL_TIME) >>1;
|
static const long CLOCK_CYCLES=(F_CPU / 1000000 * DCC_SIGNAL_TIME) >>1;
|
||||||
|
|
|
@ -530,7 +530,8 @@ void MotorDriver::getFastPin(const FSH* type,int pin, bool input, FASTPIN & res
|
||||||
#elif defined(ARDUINO_ARCH_STM32)
|
#elif defined(ARDUINO_ARCH_STM32)
|
||||||
GPIO_TypeDef *port = digitalPinToPort(pin);
|
GPIO_TypeDef *port = digitalPinToPort(pin);
|
||||||
#elif defined(ARDUINO_GIGA)
|
#elif defined(ARDUINO_GIGA)
|
||||||
auto * port = ((GPIO_TypeDef *)(GPIOA_BASE + (GPIOB_BASE - GPIOA_BASE) * (digitalPinToPinName(pin) >> 4)));
|
//auto * port = ((GPIO_TypeDef *)(GPIOA_BASE + (GPIOB_BASE - GPIOA_BASE) * (digitalPinToPinName(pin) >> 4)));
|
||||||
|
GPIO_TypeDef *port = (GPIO_TypeDef *)digitalPinToPort(pin);
|
||||||
#else
|
#else
|
||||||
uint8_t port = digitalPinToPort(pin);
|
uint8_t port = digitalPinToPort(pin);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user