File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
hardware/arduino/sam/variants/arduino_due_x Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -61,13 +61,29 @@ extern "C"{
6161
6262#define digitalPinToPort (P ) ( g_APinDescription[P].pPort )
6363#define digitalPinToBitMask (P ) ( g_APinDescription[P].ulPin )
64- #define digitalPinToTimer (P ) ( )
6564//#define analogInPinToBit(P) ( )
6665#define portOutputRegister (port ) ( &(port->PIO_ODSR) )
6766#define portInputRegister (port ) ( &(port->PIO_PDSR) )
68- //#define portModeRegister(P) ( )
6967#define digitalPinHasPWM (P ) ( g_APinDescription[P].ulPWMChannel != NOT_ON_PWM || g_APinDescription[P].ulTCChannel != NOT_ON_TIMER )
7068
69+ /*
70+ * portModeRegister(..) should return a register to set pin mode
71+ * INPUT or OUTPUT by setting the corresponding bit to 0 or 1.
72+ * Unfortunately on SAM architecture the PIO_OSR register is
73+ * read-only and can be set only through the enable/disable registers
74+ * pair PIO_OER/PIO_ODR.
75+ */
76+ // #define portModeRegister(port) ( &(port->PIO_OSR) )
77+
78+ /*
79+ * digitalPinToTimer(..) is AVR-specific and is not defined for SAM
80+ * architecture. If you need to check if a pin supports PWM you must
81+ * use digitalPinHasPWM(..).
82+ *
83+ * https://github.com/arduino/Arduino/issues/1833
84+ */
85+ // #define digitalPinToTimer(P)
86+
7187// Interrupts
7288#define digitalPinToInterrupt (p ) ((p) < NUM_DIGITAL_PINS ? (p) : -1)
7389
You can’t perform that action at this time.
0 commit comments