You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/11/25 14:26:13 UTC
[GitHub] [nuttx] tmedicci commented on a diff in pull request #7693: Adds ESP32-WroverKit LUA config and fixes LEDs setup
tmedicci commented on code in PR #7693:
URL: https://github.com/apache/nuttx/pull/7693#discussion_r1032502378
##########
boards/xtensa/esp32/esp32-wrover-kit/include/board.h:
##########
@@ -53,18 +53,40 @@
#define BOARD_LED1 0
#define BOARD_LED2 1
#define BOARD_LED3 2
-#define BOARD_NLEDS 3
-#define BOARD_LED_RED BOARD_LED1
-#define BOARD_LED_GREEN BOARD_LED2
-#define BOARD_LED_BLUE BOARD_LED3
+#define BOARD_LED_RED BOARD_LED1 /* GPIO 0 */
+#define BOARD_LED_GREEN BOARD_LED2 /* GPIO 2 */
+#define BOARD_LED_BLUE BOARD_LED3 /* GPIO 4 */
/* LED bits for use with autoleds */
#define BOARD_LED1_BIT (1 << BOARD_LED1)
#define BOARD_LED2_BIT (1 << BOARD_LED2)
#define BOARD_LED3_BIT (1 << BOARD_LED3)
+/* GPIO 2 is used by MMCSD driver as MISO, therefore, it can't be used as
+ * USER LED
+ */
+#ifdef CONFIG_MMCSD
+
+/* GPIO 0 is used by BUTTONS, it can't be used as USER LED */
+#ifdef CONFIG_INPUT_BUTTONS
+#define BOARD_NLEDS 1
+#else
+#define BOARD_NLEDS 2
+#endif
+
+#else /* MMCSD */
+
+/* GPIO 0 is used by BUTTONS, it can't be used as USER LED */
+#ifdef CONFIG_INPUT_BUTTONS
+#define BOARD_NLEDS 2
+#else
+#define BOARD_NLEDS 3
+#endif
Review Comment:
```suggestion
#ifdef CONFIG_INPUT_BUTTONS
# define BOARD_NLEDS 2
#else
# define BOARD_NLEDS 3
#endif
```
##########
boards/xtensa/esp32/esp32-wrover-kit/include/board.h:
##########
@@ -53,18 +53,40 @@
#define BOARD_LED1 0
#define BOARD_LED2 1
#define BOARD_LED3 2
-#define BOARD_NLEDS 3
-#define BOARD_LED_RED BOARD_LED1
-#define BOARD_LED_GREEN BOARD_LED2
-#define BOARD_LED_BLUE BOARD_LED3
+#define BOARD_LED_RED BOARD_LED1 /* GPIO 0 */
+#define BOARD_LED_GREEN BOARD_LED2 /* GPIO 2 */
+#define BOARD_LED_BLUE BOARD_LED3 /* GPIO 4 */
/* LED bits for use with autoleds */
#define BOARD_LED1_BIT (1 << BOARD_LED1)
#define BOARD_LED2_BIT (1 << BOARD_LED2)
#define BOARD_LED3_BIT (1 << BOARD_LED3)
+/* GPIO 2 is used by MMCSD driver as MISO, therefore, it can't be used as
+ * USER LED
+ */
+#ifdef CONFIG_MMCSD
+
+/* GPIO 0 is used by BUTTONS, it can't be used as USER LED */
+#ifdef CONFIG_INPUT_BUTTONS
+#define BOARD_NLEDS 1
+#else
+#define BOARD_NLEDS 2
+#endif
Review Comment:
```suggestion
#ifdef CONFIG_INPUT_BUTTONS
# define BOARD_NLEDS 1
#else
# define BOARD_NLEDS 2
#endif
```
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org