We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ed710fe commit 3f6c7c7Copy full SHA for 3f6c7c7
cores/arduino/stm32/PinNamesTypes.h
@@ -129,7 +129,10 @@ typedef enum {
129
#define STM_PORT(X) (((uint32_t)(X) >> 4) & 0xF)
130
#define STM_PIN(X) ((uint32_t)(X) & 0xF)
131
// Check PinName is valid: FirstPort <= PortName <= LastPort
132
-#define STM_VALID_PINNAME(X) ((STM_PORT(X) >= FirstPort) && (STM_PORT(X) <= LastPort))
+// As FirstPort is equal to 0 and STM_PORT cast as an unsigned
133
+// (STM_PORT(X) >= FirstPort) is always true
134
+//#define STM_VALID_PINNAME(X) ((STM_PORT(X) >= FirstPort) && (STM_PORT(X) <= LastPort))
135
+#define STM_VALID_PINNAME(X) (STM_PORT(X) <= LastPort)
136
137
#define STM_GPIO_PIN(X) ((uint16_t)(1<<STM_PIN(X)))
138
/* Defines to be used by application */
0 commit comments