Skip to content

Commit 1afa525

Browse files
committed
Reverted change in Arduino.h which affects all boards, and reintroduced the fix as overlay config instead, for R1, C33 and H7.
1 parent b47c37c commit 1afa525

File tree

4 files changed

+71
-2
lines changed

4 files changed

+71
-2
lines changed

cores/arduino/Arduino.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
#else
6565
#define LED_BUILTIN \
6666
DIGITAL_PIN_GPIOS_FIND_PIN( \
67-
DT_REG_ADDR(DT_PHANDLE_BY_IDX(DT_PATH(zephyr_user), builtin_led_gpios, 1)), \
68-
DT_PHA_BY_IDX(DT_PATH(zephyr_user), builtin_led_gpios, 1, pin))
67+
DT_REG_ADDR(DT_PHANDLE_BY_IDX(DT_PATH(zephyr_user), builtin_led_gpios, 0)), \
68+
DT_PHA_BY_IDX(DT_PATH(zephyr_user), builtin_led_gpios, 0, pin))
6969
#endif
7070

7171
/* If digital-pin-gpios is not defined, tries to use the led0 alias */

variants/arduino_giga_r1_stm32h747xx_m7/arduino_giga_r1_stm32h747xx_m7.overlay

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,3 +540,23 @@
540540
/* Include common flash filesystem configuration */
541541
qspi_flash: &n25q128a1 {};
542542
#include "../common/arduino_flash_fs.dtsi"
543+
544+
/ {
545+
zephyr,user {
546+
/* Override builtin LED GPIO to point to the green LED */
547+
builtin_led_gpios = <&gpioj 13 0>; /* Pin 13 on GPIOJ for Green LED, active-low */
548+
};
549+
550+
leds {
551+
compatible = "gpio-leds";
552+
red_led: led_0 {
553+
gpios = <&gpioi 12 GPIO_ACTIVE_LOW>; /* Red LED on GPIO pin 12 of GPIOI, active-low */
554+
};
555+
green_led: led_1 {
556+
gpios = <&gpioj 13 GPIO_ACTIVE_LOW>; /* Green LED on GPIO pin 13 of GPIOJ, active-low */
557+
};
558+
blue_led: led_2 {
559+
gpios = <&gpioe 3 GPIO_ACTIVE_LOW>; /* Blue LED on GPIO pin 3 of GPIOE, active-low */
560+
};
561+
};
562+
};

variants/arduino_portenta_c33_r7fa6m5bh3cfc/arduino_portenta_c33_r7fa6m5bh3cfc.overlay

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,3 +302,29 @@
302302
/* Include common flash filesystem configuration */
303303
qspi_flash: &at25sf128a {};
304304
#include "../common/arduino_flash_fs.dtsi"
305+
306+
/ {
307+
zephyr,user {
308+
/* Override builtin LED GPIO to point to the green LED (led2) */
309+
builtin_led_gpios = <&ioport4 0 0>; /* GPIO pin 0 on ioport4 (green LED) */
310+
};
311+
312+
leds {
313+
compatible = "gpio-leds";
314+
315+
led1: led1 {
316+
gpios = <&ioport1 7 GPIO_ACTIVE_LOW>; /* Red LED on GPIO pin 7 of ioport1, active-low */
317+
label = "LEDR"; /* Label changed to Red LED */
318+
};
319+
320+
led2: led2 {
321+
gpios = <&ioport4 0 GPIO_ACTIVE_LOW>; /* Green LED on GPIO pin 0 of ioport4, active-low */
322+
label = "LEDG"; /* Label changed to Green LED */
323+
};
324+
325+
led3: led3 {
326+
gpios = <&ioport8 0 GPIO_ACTIVE_LOW>; /* Blue LED on GPIO pin 0 of ioport8, active-low */
327+
label = "LEDB"; /* Label changed to Blue LED */
328+
};
329+
};
330+
};

variants/arduino_portenta_h7_stm32h747xx_m7/arduino_portenta_h7_stm32h747xx_m7.overlay

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,3 +388,26 @@ qspi_flash: &mx25l12833f {};
388388
<&adc1 13>; /* Hack for D20 */
389389
};
390390
};
391+
392+
/ {
393+
zephyr,user {
394+
/* Override builtin LED GPIO to point to the green LED */
395+
builtin_led_gpios = <&gpiok 6 0>; /* Pin 6 on GPIOK, active low */
396+
};
397+
398+
leds {
399+
compatible = "gpio-leds";
400+
401+
red_led: led_0 {
402+
gpios = <&gpiok 5 GPIO_ACTIVE_LOW>; /* Red LED on GPIO pin 5, active-low */
403+
};
404+
405+
green_led: led_1 {
406+
gpios = <&gpiok 6 GPIO_ACTIVE_LOW>; /* Green LED on GPIO pin 6, active-low */
407+
};
408+
409+
blue_led: led_2 {
410+
gpios = <&gpiok 7 GPIO_ACTIVE_LOW>; /* Blue LED on GPIO pin 7, active-low */
411+
};
412+
};
413+
};

0 commit comments

Comments
 (0)