diff --git a/MotorDriver.cpp b/MotorDriver.cpp index f18050e..20e146c 100644 --- a/MotorDriver.cpp +++ b/MotorDriver.cpp @@ -510,7 +510,7 @@ void MotorDriver::getFastPin(const FSH* type,int pin, bool input, FASTPIN & res #if defined(ARDUINO_GIGA) (void)type; (void)input; // no warnings please - result = digitalPinToGpio(pin); + result = pin; #else (void) type; // avoid compiler warning if diag not used above. #if defined(ARDUINO_ARCH_SAMD) diff --git a/MotorDriver.h b/MotorDriver.h index 6338c2f..aa102b2 100644 --- a/MotorDriver.h +++ b/MotorDriver.h @@ -31,15 +31,17 @@ enum TRACK_MODE : byte {TRACK_MODE_NONE = 1, TRACK_MODE_MAIN = 2, TRACK_MODE_PROG = 4, TRACK_MODE_DC = 8, TRACK_MODE_DCX = 16, TRACK_MODE_EXT = 32}; #ifdef ARDUINO_GIGA -#define setHIGH(fastpin) gpio_write(&fastpin, 1) -#define setLOW(fastpin) gpio_write(&fastpin, 0) +#include +//extern gpio_t digitalPinToGpio(int P); +#define setHIGH(fastpin) digitalWrite(fastpin, 1) +#define setLOW(fastpin) digitalWrite(fastpin, 0) #else #define setHIGH(fastpin) *fastpin.inout |= fastpin.maskHIGH #define setLOW(fastpin) *fastpin.inout &= fastpin.maskLOW #endif #if defined(ARDUINO_GIGA) -#define isHIGH(fastpin) (gpio_read(&fastpin)==1) -#define isLOW(fastpin) (gpio_read(&fastpin)==0) +#define isHIGH(fastpin) (digitalRead(fastpin)==1) +#define isLOW(fastpin) (digitalRead(fastpin)==0) #else #define isHIGH(fastpin) (*fastpin.inout & fastpin.maskHIGH) #define isLOW(fastpin) (!isHIGH(fastpin)) @@ -126,9 +128,9 @@ typedef uint8_t portreg_t; #endif #if defined(ARDUINO_GIGA) -typedef gpio_t FASTPIN; -#include -//extern gpio_t digitalPinToGpio(uint8_t P); +typedef pin_size_t FASTPIN; + + #else struct FASTPIN { volatile portreg_t *inout;