1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-22 23:56:13 +01:00

SAMD fixups and workaround

This commit is contained in:
Asbelos 2022-07-08 10:34:27 +01:00
parent 385afdeb6c
commit aa3c3c2ee4

View File

@ -64,14 +64,11 @@
#endif
#if defined(__IMXRT1062__) || defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_SAMD)
struct FASTPIN {
volatile uint32_t *inout;
uint32_t maskHIGH;
uint32_t maskLOW;
};
typedef uint32_t portreg_t;
#else
typedef uint8_t portreg_t;
#endif
struct FASTPIN {
volatile portreg_t *inout;
portreg_t maskHIGH;
@ -122,7 +119,11 @@ class MotorDriver {
virtual unsigned int raw2mA( int raw);
virtual unsigned int mA2raw( unsigned int mA);
inline bool brakeCanPWM() {
#ifdef digitalPinToTimer
return ((brakePin!=UNUSED_PIN) && (digitalPinToTimer(brakePin)));
#else
return (brakePin<14 && brakePin >1);
#endif
}
inline int getRawCurrentTripValue() {
return rawCurrentTripValue;