diff --git a/hardware/arduino/sam/cores/arduino/Arduino.h b/hardware/arduino/sam/cores/arduino/Arduino.h index defd4c4f4..cd7cd494c 100644 --- a/hardware/arduino/sam/cores/arduino/Arduino.h +++ b/hardware/arduino/sam/cores/arduino/Arduino.h @@ -51,17 +51,6 @@ void yield(void); extern void setup( void ) ; extern void loop( void ) ; -// Get the bit location within the hardware port of the given virtual pin. -// This comes from the pins_*.c file for the active board configuration. -// -#define digitalPinToPort(P) ( g_APinDescription[P].pPort ) -#define digitalPinToBitMask(P) ( g_APinDescription[P].ulPin ) -#define digitalPinToTimer(P) ( ) -//#define analogInPinToBit(P) ( ) -#define portOutputRegister(port) ( &(port->PIO_ODSR) ) -#define portInputRegister(port) ( &(port->PIO_PDSR) ) -//#define portModeRegister(P) ( ) - //#define NOT_A_PIN 0 // defined in pio.h/EPioType #define NOT_A_PORT 0 diff --git a/hardware/arduino/sam/variants/arduino_due_x/variant.h b/hardware/arduino/sam/variants/arduino_due_x/variant.h index b1c601816..567d1e74b 100644 --- a/hardware/arduino/sam/variants/arduino_due_x/variant.h +++ b/hardware/arduino/sam/variants/arduino_due_x/variant.h @@ -59,6 +59,14 @@ extern "C"{ #define NUM_DIGITAL_PINS (54u) #define NUM_ANALOG_INPUTS (12u) +#define digitalPinToPort(P) ( g_APinDescription[P].pPort ) +#define digitalPinToBitMask(P) ( g_APinDescription[P].ulPin ) +#define digitalPinToTimer(P) ( ) +//#define analogInPinToBit(P) ( ) +#define portOutputRegister(port) ( &(port->PIO_ODSR) ) +#define portInputRegister(port) ( &(port->PIO_PDSR) ) +//#define portModeRegister(P) ( ) + // Interrupts #define digitalPinToInterrupt(p) ((p) < NUM_DIGITAL_PINS ? (p) : -1)