File tree 1 file changed +18
-2
lines changed
hardware/arduino/sam/variants/arduino_due_x
1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -61,13 +61,29 @@ extern "C"{
61
61
62
62
#define digitalPinToPort (P ) ( g_APinDescription[P].pPort )
63
63
#define digitalPinToBitMask (P ) ( g_APinDescription[P].ulPin )
64
- #define digitalPinToTimer (P ) ( )
65
64
//#define analogInPinToBit(P) ( )
66
65
#define portOutputRegister (port ) ( &(port->PIO_ODSR) )
67
66
#define portInputRegister (port ) ( &(port->PIO_PDSR) )
68
- //#define portModeRegister(P) ( )
69
67
#define digitalPinHasPWM (P ) ( g_APinDescription[P].ulPWMChannel != NOT_ON_PWM || g_APinDescription[P].ulTCChannel != NOT_ON_TIMER )
70
68
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
+
71
87
// Interrupts
72
88
#define digitalPinToInterrupt (p ) ((p) < NUM_DIGITAL_PINS ? (p) : -1)
73
89
You can’t perform that action at this time.
0 commit comments