pkarashchenko commented on code in PR #13151:
URL: https://github.com/apache/nuttx/pull/13151#discussion_r1730202401


##########
boards/arm/stm32/stm32f411-minimum/include/board.h:
##########
@@ -321,8 +329,10 @@
  */
 
 #define BUTTON_USER        0
-#define NUM_BUTTONS        1
+#define BUTTON_EXTERNAL    1  //External user button connected to PA1
+#define NUM_BUTTONS        2
 
-#define BUTTON_USER_BIT    (1 << BUTTON_USER)
+#define BUTTON_USER_BIT       (1 << BUTTON_USER)
+#define BUTTON_EXTERNAL_BIT    (1 << BUTTON_EXTERNAL)

Review Comment:
   ```suggestion
   #define BUTTON_EXTERNAL_BIT   (1 << BUTTON_EXTERNAL)
   ```



##########
boards/arm/stm32/stm32f411-minimum/src/stm32f411-minimum.h:
##########
@@ -59,11 +59,19 @@
  */
 
 #define MIN_IRQBUTTON   BUTTON_USER
-#define MAX_IRQBUTTON   BUTTON_USER
-#define NUM_IRQBUTTONS  1
+#define MAX_IRQBUTTON   BUTTON_EXTERNAL
+#define NUM_IRQBUTTONS  (BUTTON_USER - BUTTON_EXTERNAL + 1)
 
 #define GPIO_BTN_USER \
-  (GPIO_INPUT |GPIO_FLOAT |GPIO_EXTI | GPIO_PORTA | GPIO_PIN0)
+  (GPIO_INPUT |GPIO_PULLUP |GPIO_EXTI | GPIO_PORTA | GPIO_PIN0)
+
+#define GPIO_BTN_EXTERNAL \
+  (GPIO_INPUT |GPIO_FLOAT |GPIO_EXTI | GPIO_PORTA | GPIO_PIN1)

Review Comment:
   ```suggestion
     (GPIO_INPUT | GPIO_FLOAT | GPIO_EXTI | GPIO_PORTA | GPIO_PIN1)
   ```



##########
boards/arm/stm32/stm32f411-minimum/src/stm32f411-minimum.h:
##########
@@ -59,11 +59,19 @@
  */
 
 #define MIN_IRQBUTTON   BUTTON_USER
-#define MAX_IRQBUTTON   BUTTON_USER
-#define NUM_IRQBUTTONS  1
+#define MAX_IRQBUTTON   BUTTON_EXTERNAL
+#define NUM_IRQBUTTONS  (BUTTON_USER - BUTTON_EXTERNAL + 1)
 
 #define GPIO_BTN_USER \
-  (GPIO_INPUT |GPIO_FLOAT |GPIO_EXTI | GPIO_PORTA | GPIO_PIN0)
+  (GPIO_INPUT |GPIO_PULLUP |GPIO_EXTI | GPIO_PORTA | GPIO_PIN0)

Review Comment:
   ```suggestion
     (GPIO_INPUT | GPIO_PULLUP | GPIO_EXTI | GPIO_PORTA | GPIO_PIN0)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to