Skip to content

Commit db167c6

Browse files
galaknashif
authored andcommitted
dts: Rename LED._GPIO_* -> DT_ALIAS_LED._GPIOS_*
We use the following commands to rename any LED._GPIO_{CONTROLLER,PIN,FLAGS} to DT_ALIAS_LED._GPIOS_{CONTROLLER,PIN,FLAGS} git grep -l LED._GPIO_CONTROLLER | xargs sed -i 's/LED\(.\)_GPIO_CONTROLLER/DT_ALIAS_LED\1_GPIOS_CONTROLLER/g' git grep -l LED._GPIO_PIN | xargs sed -i 's/LED\(.\)_GPIO_PIN/DT_ALIAS_LED\1_GPIOS_PIN/g' git grep -l LED._GPIO_FLAGS | xargs sed -i 's/LED\(.\)_GPIO_FLAGS/DT_ALIAS_LED\1_GPIOS_FLAGS/g' Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
1 parent c661cc6 commit db167c6

File tree

23 files changed

+102
-102
lines changed

23 files changed

+102
-102
lines changed

samples/basic/blink_led/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#else
3333
#define PWM_DRIVER DT_NORDIC_NRF_PWM_PWM_0_LABEL
3434
#endif /* CONFIG_PWM_NRF5_SW */
35-
#define PWM_CHANNEL LED0_GPIO_PIN
35+
#define PWM_CHANNEL DT_ALIAS_LED0_GPIOS_PIN
3636
#elif defined(CONFIG_BOARD_COLIBRI_IMX7D_M4)
3737
#define PWM_DRIVER PWM_1_LABEL
3838
#define PWM_CHANNEL 0

samples/basic/blinky/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ sample code is configured to work on boards that have defined the led0
1818
alias in their board device tree description file. Doing so will generate
1919
these variables:
2020

21-
- LED0_GPIO_CONTROLLER
22-
- LED0_GPIO_PIN
21+
- DT_ALIAS_LED0_GPIOS_CONTROLLER
22+
- DT_ALIAS_LED0_GPIOS_PIN
2323

2424

2525
Building and Running

samples/basic/blinky/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#include <device.h>
99
#include <drivers/gpio.h>
1010

11-
#define LED_PORT LED0_GPIO_CONTROLLER
12-
#define LED LED0_GPIO_PIN
11+
#define LED_PORT DT_ALIAS_LED0_GPIOS_CONTROLLER
12+
#define LED DT_ALIAS_LED0_GPIOS_PIN
1313

1414
/* 1000 msec = 1 sec */
1515
#define SLEEP_TIME 1000

samples/basic/disco/sample.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ sample:
22
name: Disco Lights
33
tests:
44
sample.disco:
5-
filter: DT_GPIO_LEDS_LED0_GPIO_CONTROLLER and DT_GPIO_LEDS_LED1_GPIOS_CONTROLLER
5+
filter: DT_GPIO_LEDS_LED0_GPIOS_CONTROLLER and DT_GPIO_LEDS_LED1_GPIOS_CONTROLLER
66
tags: LED gpio
77
depends_on: gpio
88
harness: led

samples/basic/disco/src/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
#include <device.h>
99
#include <drivers/gpio.h>
1010

11-
#define PORT0 LED0_GPIO_CONTROLLER
12-
#define PORT1 LED1_GPIO_CONTROLLER
11+
#define PORT0 DT_ALIAS_LED0_GPIOS_CONTROLLER
12+
#define PORT1 DT_ALIAS_LED1_GPIOS_CONTROLLER
1313

14-
#define LED0 LED0_GPIO_PIN
15-
#define LED1 LED1_GPIO_PIN
14+
#define LED0 DT_ALIAS_LED0_GPIOS_PIN
15+
#define LED1 DT_ALIAS_LED1_GPIOS_PIN
1616

1717
#define SLEEP_TIME 500
1818

samples/basic/fade_led/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#else
3131
#define PWM_DRIVER DT_NORDIC_NRF_PWM_PWM_0_LABEL
3232
#endif /* CONFIG_PWM_NRF5_SW */
33-
#define PWM_CHANNEL LED0_GPIO_PIN
33+
#define PWM_CHANNEL DT_ALIAS_LED0_GPIOS_PIN
3434
#elif defined(CONFIG_SOC_ESP32)
3535
#define PWM_DRIVER CONFIG_PWM_LED_ESP32_DEV_NAME_0
3636
#define PWM_CHANNEL 21

samples/basic/threads/sample.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sample:
55
tests:
66
sample.threads:
77
tags: kernel threads gpio
8-
filter: DT_GPIO_LEDS_LED0_GPIO_CONTROLLER and DT_GPIO_LEDS_LED1_GPIOS_CONTROLLER
8+
filter: DT_GPIO_LEDS_LED0_GPIOS_CONTROLLER and DT_GPIO_LEDS_LED1_GPIOS_CONTROLLER
99
depends_on: gpio
1010
harness: console
1111
harness_config:

samples/basic/threads/src/main.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@
1818
#define PRIORITY 7
1919

2020
/* Change this if you have an LED connected to a custom port */
21-
#ifndef LED0_GPIO_CONTROLLER
22-
#define LED0_GPIO_CONTROLLER LED0_GPIO_PORT
21+
#ifndef DT_ALIAS_LED0_GPIOS_CONTROLLER
22+
#define DT_ALIAS_LED0_GPIOS_CONTROLLER LED0_GPIO_PORT
2323
#endif
24-
#ifndef LED1_GPIO_CONTROLLER
25-
#define LED1_GPIO_CONTROLLER LED1_GPIO_PORT
24+
#ifndef DT_ALIAS_LED1_GPIOS_CONTROLLER
25+
#define DT_ALIAS_LED1_GPIOS_CONTROLLER LED1_GPIO_PORT
2626
#endif
2727

28-
#define PORT0 LED0_GPIO_CONTROLLER
29-
#define PORT1 LED1_GPIO_CONTROLLER
28+
#define PORT0 DT_ALIAS_LED0_GPIOS_CONTROLLER
29+
#define PORT1 DT_ALIAS_LED1_GPIOS_CONTROLLER
3030

3131

3232
/* Change this if you have an LED connected to a custom pin */
33-
#define LED0 LED0_GPIO_PIN
34-
#define LED1 LED1_GPIO_PIN
33+
#define LED0 DT_ALIAS_LED0_GPIOS_PIN
34+
#define LED1 DT_ALIAS_LED1_GPIOS_PIN
3535

3636
struct printk_data_t {
3737
void *fifo_reserved; /* 1st word reserved for use by fifo */

samples/boards/96b_argonkey/microphone/src/main.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,39 +50,39 @@ void signal_sampling_started(void)
5050
{
5151
static struct device *led0, *led1;
5252

53-
led0 = device_get_binding(LED0_GPIO_CONTROLLER);
54-
gpio_pin_configure(led0, LED0_GPIO_PIN, GPIO_DIR_OUT);
55-
gpio_pin_write(led0, LED0_GPIO_PIN, 1);
53+
led0 = device_get_binding(DT_ALIAS_LED0_GPIOS_CONTROLLER);
54+
gpio_pin_configure(led0, DT_ALIAS_LED0_GPIOS_PIN, GPIO_DIR_OUT);
55+
gpio_pin_write(led0, DT_ALIAS_LED0_GPIOS_PIN, 1);
5656

57-
led1 = device_get_binding(LED1_GPIO_CONTROLLER);
58-
gpio_pin_configure(led1, LED1_GPIO_PIN, GPIO_DIR_OUT);
59-
gpio_pin_write(led1, LED1_GPIO_PIN, 0);
57+
led1 = device_get_binding(DT_ALIAS_LED1_GPIOS_CONTROLLER);
58+
gpio_pin_configure(led1, DT_ALIAS_LED1_GPIOS_PIN, GPIO_DIR_OUT);
59+
gpio_pin_write(led1, DT_ALIAS_LED1_GPIOS_PIN, 0);
6060
}
6161

6262
void signal_sampling_stopped(void)
6363
{
6464
static struct device *led0, *led1;
6565

66-
led0 = device_get_binding(LED0_GPIO_CONTROLLER);
67-
gpio_pin_configure(led0, LED0_GPIO_PIN, GPIO_DIR_OUT);
68-
gpio_pin_write(led0, LED0_GPIO_PIN, 1);
66+
led0 = device_get_binding(DT_ALIAS_LED0_GPIOS_CONTROLLER);
67+
gpio_pin_configure(led0, DT_ALIAS_LED0_GPIOS_PIN, GPIO_DIR_OUT);
68+
gpio_pin_write(led0, DT_ALIAS_LED0_GPIOS_PIN, 1);
6969

70-
led1 = device_get_binding(LED1_GPIO_CONTROLLER);
71-
gpio_pin_configure(led1, LED1_GPIO_PIN, GPIO_DIR_OUT);
72-
gpio_pin_write(led1, LED1_GPIO_PIN, 1);
70+
led1 = device_get_binding(DT_ALIAS_LED1_GPIOS_CONTROLLER);
71+
gpio_pin_configure(led1, DT_ALIAS_LED1_GPIOS_PIN, GPIO_DIR_OUT);
72+
gpio_pin_write(led1, DT_ALIAS_LED1_GPIOS_PIN, 1);
7373
}
7474

7575
void signal_print_stopped(void)
7676
{
7777
static struct device *led0, *led1;
7878

79-
led0 = device_get_binding(LED0_GPIO_CONTROLLER);
80-
gpio_pin_configure(led0, LED0_GPIO_PIN, GPIO_DIR_OUT);
81-
gpio_pin_write(led0, LED0_GPIO_PIN, 0);
79+
led0 = device_get_binding(DT_ALIAS_LED0_GPIOS_CONTROLLER);
80+
gpio_pin_configure(led0, DT_ALIAS_LED0_GPIOS_PIN, GPIO_DIR_OUT);
81+
gpio_pin_write(led0, DT_ALIAS_LED0_GPIOS_PIN, 0);
8282

83-
led1 = device_get_binding(LED1_GPIO_CONTROLLER);
84-
gpio_pin_configure(led1, LED1_GPIO_PIN, GPIO_DIR_OUT);
85-
gpio_pin_write(led1, LED1_GPIO_PIN, 1);
83+
led1 = device_get_binding(DT_ALIAS_LED1_GPIOS_CONTROLLER);
84+
gpio_pin_configure(led1, DT_ALIAS_LED1_GPIOS_PIN, GPIO_DIR_OUT);
85+
gpio_pin_write(led1, DT_ALIAS_LED1_GPIOS_PIN, 1);
8686
}
8787

8888
void *rx_block[NUM_MS];

samples/boards/96b_argonkey/sensors/src/main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,15 @@ void main(void)
133133
}
134134
#endif
135135

136-
led0 = device_get_binding(LED0_GPIO_CONTROLLER);
137-
gpio_pin_configure(led0, LED0_GPIO_PIN, GPIO_DIR_OUT);
138-
gpio_pin_write(led0, LED0_GPIO_PIN, 1);
136+
led0 = device_get_binding(DT_ALIAS_LED0_GPIOS_CONTROLLER);
137+
gpio_pin_configure(led0, DT_ALIAS_LED0_GPIOS_PIN, GPIO_DIR_OUT);
138+
gpio_pin_write(led0, DT_ALIAS_LED0_GPIOS_PIN, 1);
139139

140-
led1 = device_get_binding(LED1_GPIO_CONTROLLER);
141-
gpio_pin_configure(led1, LED1_GPIO_PIN, GPIO_DIR_OUT);
140+
led1 = device_get_binding(DT_ALIAS_LED1_GPIOS_CONTROLLER);
141+
gpio_pin_configure(led1, DT_ALIAS_LED1_GPIOS_PIN, GPIO_DIR_OUT);
142142

143143
for (i = 0; i < 5; i++) {
144-
gpio_pin_write(led1, LED1_GPIO_PIN, on);
144+
gpio_pin_write(led1, DT_ALIAS_LED1_GPIOS_PIN, on);
145145
k_sleep(200);
146146
on = (on == 1) ? 0 : 1;
147147
}

samples/boards/nrf52/mesh/onoff-app/src/main.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ struct onoff_state {
180180
*/
181181

182182
static struct onoff_state onoff_state[] = {
183-
{ .led_gpio_pin = LED0_GPIO_PIN },
184-
{ .led_gpio_pin = LED1_GPIO_PIN },
185-
{ .led_gpio_pin = LED2_GPIO_PIN },
186-
{ .led_gpio_pin = LED3_GPIO_PIN },
183+
{ .led_gpio_pin = DT_ALIAS_LED0_GPIOS_PIN },
184+
{ .led_gpio_pin = DT_ALIAS_LED1_GPIOS_PIN },
185+
{ .led_gpio_pin = DT_ALIAS_LED2_GPIOS_PIN },
186+
{ .led_gpio_pin = DT_ALIAS_LED3_GPIOS_PIN },
187187
};
188188

189189
/*
@@ -635,10 +635,10 @@ void main(void)
635635
gpio_pin_enable_callback(sw_device, DT_ALIAS_SW3_GPIOS_PIN);
636636

637637
/* Initialize LED's */
638-
init_led(0, LED0_GPIO_CONTROLLER, LED0_GPIO_PIN);
639-
init_led(1, LED1_GPIO_CONTROLLER, LED1_GPIO_PIN);
640-
init_led(2, LED2_GPIO_CONTROLLER, LED2_GPIO_PIN);
641-
init_led(3, LED3_GPIO_CONTROLLER, LED3_GPIO_PIN);
638+
init_led(0, DT_ALIAS_LED0_GPIOS_CONTROLLER, DT_ALIAS_LED0_GPIOS_PIN);
639+
init_led(1, DT_ALIAS_LED1_GPIOS_CONTROLLER, DT_ALIAS_LED1_GPIOS_PIN);
640+
init_led(2, DT_ALIAS_LED2_GPIOS_CONTROLLER, DT_ALIAS_LED2_GPIOS_PIN);
641+
init_led(3, DT_ALIAS_LED3_GPIOS_CONTROLLER, DT_ALIAS_LED3_GPIOS_PIN);
642642

643643
/* Initialize the Bluetooth Subsystem */
644644
err = bt_enable(bt_ready);

samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/src/app_gpio.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@ void app_gpio_init(void)
2626

2727
/* LEDs configuration & setting */
2828

29-
led_device[0] = device_get_binding(LED0_GPIO_CONTROLLER);
30-
gpio_pin_configure(led_device[0], LED0_GPIO_PIN,
29+
led_device[0] = device_get_binding(DT_ALIAS_LED0_GPIOS_CONTROLLER);
30+
gpio_pin_configure(led_device[0], DT_ALIAS_LED0_GPIOS_PIN,
3131
GPIO_DIR_OUT | GPIO_PUD_PULL_UP);
32-
gpio_pin_write(led_device[0], LED0_GPIO_PIN, 1);
32+
gpio_pin_write(led_device[0], DT_ALIAS_LED0_GPIOS_PIN, 1);
3333

34-
led_device[1] = device_get_binding(LED1_GPIO_CONTROLLER);
35-
gpio_pin_configure(led_device[1], LED1_GPIO_PIN,
34+
led_device[1] = device_get_binding(DT_ALIAS_LED1_GPIOS_CONTROLLER);
35+
gpio_pin_configure(led_device[1], DT_ALIAS_LED1_GPIOS_PIN,
3636
GPIO_DIR_OUT | GPIO_PUD_PULL_UP);
37-
gpio_pin_write(led_device[1], LED1_GPIO_PIN, 1);
37+
gpio_pin_write(led_device[1], DT_ALIAS_LED1_GPIOS_PIN, 1);
3838

39-
led_device[2] = device_get_binding(LED2_GPIO_CONTROLLER);
40-
gpio_pin_configure(led_device[2], LED2_GPIO_PIN,
39+
led_device[2] = device_get_binding(DT_ALIAS_LED2_GPIOS_CONTROLLER);
40+
gpio_pin_configure(led_device[2], DT_ALIAS_LED2_GPIOS_PIN,
4141
GPIO_DIR_OUT | GPIO_PUD_PULL_UP);
42-
gpio_pin_write(led_device[2], LED2_GPIO_PIN, 1);
42+
gpio_pin_write(led_device[2], DT_ALIAS_LED2_GPIOS_PIN, 1);
4343

44-
led_device[3] = device_get_binding(LED3_GPIO_CONTROLLER);
45-
gpio_pin_configure(led_device[3], LED3_GPIO_PIN,
44+
led_device[3] = device_get_binding(DT_ALIAS_LED3_GPIOS_CONTROLLER);
45+
gpio_pin_configure(led_device[3], DT_ALIAS_LED3_GPIOS_PIN,
4646
GPIO_DIR_OUT | GPIO_PUD_PULL_UP);
47-
gpio_pin_write(led_device[3], LED3_GPIO_PIN, 1);
47+
gpio_pin_write(led_device[3], DT_ALIAS_LED3_GPIOS_PIN, 1);
4848

4949
/* Buttons configuration & setting */
5050

samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/src/main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,26 +124,26 @@ void update_led_gpio(void)
124124

125125
if (lightness) {
126126
/* LED1 On */
127-
gpio_pin_write(led_device[0], LED0_GPIO_PIN, 0);
127+
gpio_pin_write(led_device[0], DT_ALIAS_LED0_GPIOS_PIN, 0);
128128
} else {
129129
/* LED1 Off */
130-
gpio_pin_write(led_device[0], LED0_GPIO_PIN, 1);
130+
gpio_pin_write(led_device[0], DT_ALIAS_LED0_GPIOS_PIN, 1);
131131
}
132132

133133
if (power < 50) {
134134
/* LED3 On */
135-
gpio_pin_write(led_device[2], LED2_GPIO_PIN, 0);
135+
gpio_pin_write(led_device[2], DT_ALIAS_LED2_GPIOS_PIN, 0);
136136
} else {
137137
/* LED3 Off */
138-
gpio_pin_write(led_device[2], LED2_GPIO_PIN, 1);
138+
gpio_pin_write(led_device[2], DT_ALIAS_LED2_GPIOS_PIN, 1);
139139
}
140140

141141
if (color < 50) {
142142
/* LED4 On */
143-
gpio_pin_write(led_device[3], LED3_GPIO_PIN, 0);
143+
gpio_pin_write(led_device[3], DT_ALIAS_LED3_GPIOS_PIN, 0);
144144
} else {
145145
/* LED4 Off */
146-
gpio_pin_write(led_device[3], LED3_GPIO_PIN, 1);
146+
gpio_pin_write(led_device[3], DT_ALIAS_LED3_GPIOS_PIN, 1);
147147
}
148148
}
149149

samples/boards/nrf52/mesh/onoff_level_lighting_vnd_app/src/mesh/device_composition.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,10 +1144,10 @@ static void vnd_set_unack(struct bt_mesh_model *model,
11441144

11451145
if (state->current == STATE_ON) {
11461146
/* LED2 On */
1147-
gpio_pin_write(led_device[1], LED1_GPIO_PIN, 0);
1147+
gpio_pin_write(led_device[1], DT_ALIAS_LED1_GPIOS_PIN, 0);
11481148
} else {
11491149
/* LED2 Off */
1150-
gpio_pin_write(led_device[1], LED1_GPIO_PIN, 1);
1150+
gpio_pin_write(led_device[1], DT_ALIAS_LED1_GPIOS_PIN, 1);
11511151
}
11521152
}
11531153

samples/boards/nrf52/power_mgr/src/sample.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
#define PORT DT_ALIAS_SW0_GPIOS_CONTROLLER
1919
#define BUTTON_1 DT_ALIAS_SW0_GPIOS_PIN
2020
#define BUTTON_2 DT_ALIAS_SW1_GPIOS_PIN
21-
#define LED_1 LED0_GPIO_PIN
22-
#define LED_2 LED1_GPIO_PIN
21+
#define LED_1 DT_ALIAS_LED0_GPIOS_PIN
22+
#define LED_2 DT_ALIAS_LED1_GPIOS_PIN
2323

2424
#define LOW 0
2525
#define HIGH 1

samples/boards/reel_board/mesh_badge/src/periphs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ struct led_device_info {
2424
};
2525

2626
static struct led_device_info led_dev_info[] = {
27-
{ NULL, LED0_GPIO_CONTROLLER, LED0_GPIO_PIN }, /* green back LED */
28-
{ NULL, LED1_GPIO_CONTROLLER, LED1_GPIO_PIN }, /* red front LED */
29-
{ NULL, LED2_GPIO_CONTROLLER, LED2_GPIO_PIN }, /* green front LED */
30-
{ NULL, LED3_GPIO_CONTROLLER, LED3_GPIO_PIN }, /* blue front LED */
27+
{ NULL, DT_ALIAS_LED0_GPIOS_CONTROLLER, DT_ALIAS_LED0_GPIOS_PIN }, /* green back LED */
28+
{ NULL, DT_ALIAS_LED1_GPIOS_CONTROLLER, DT_ALIAS_LED1_GPIOS_PIN }, /* red front LED */
29+
{ NULL, DT_ALIAS_LED2_GPIOS_CONTROLLER, DT_ALIAS_LED2_GPIOS_PIN }, /* green front LED */
30+
{ NULL, DT_ALIAS_LED3_GPIOS_CONTROLLER, DT_ALIAS_LED3_GPIOS_PIN }, /* blue front LED */
3131
};
3232

3333
static struct device_info dev_info[] = {

samples/boards/reel_board/mesh_badge/src/reel_board.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ static struct {
6868
const char *name;
6969
u32_t pin;
7070
} leds[] = {
71-
{ .name = LED0_GPIO_CONTROLLER, .pin = LED0_GPIO_PIN, },
72-
{ .name = LED1_GPIO_CONTROLLER, .pin = LED1_GPIO_PIN, },
73-
{ .name = LED2_GPIO_CONTROLLER, .pin = LED2_GPIO_PIN, },
74-
{ .name = LED3_GPIO_CONTROLLER, .pin = LED3_GPIO_PIN, },
71+
{ .name = DT_ALIAS_LED0_GPIOS_CONTROLLER, .pin = DT_ALIAS_LED0_GPIOS_PIN, },
72+
{ .name = DT_ALIAS_LED1_GPIOS_CONTROLLER, .pin = DT_ALIAS_LED1_GPIOS_PIN, },
73+
{ .name = DT_ALIAS_LED2_GPIOS_CONTROLLER, .pin = DT_ALIAS_LED2_GPIOS_PIN, },
74+
{ .name = DT_ALIAS_LED3_GPIOS_CONTROLLER, .pin = DT_ALIAS_LED3_GPIOS_PIN, },
7575
};
7676

7777
struct k_delayed_work led_timer;

samples/drivers/gpio/sample.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ sample:
33
tests:
44
sample.driver.gpio:
55
tags: drivers
6-
filter: DT_GPIO_LEDS_LED0_GPIO_CONTROLLER and DT_GPIO_KEYS_SW0_GPIOS_CONTROLLER
6+
filter: DT_GPIO_LEDS_LED0_GPIOS_CONTROLLER and DT_GPIO_KEYS_SW0_GPIOS_CONTROLLER
77
harness: console
88
harness_config:
99
type: one_line

samples/drivers/gpio/src/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
#include <drivers/gpio.h>
2121
#include <sys/util.h>
2222

23-
#if defined(DT_ALIAS_SW0_GPIOS_CONTROLLER) && defined(LED0_GPIO_CONTROLLER)
24-
#define GPIO_OUT_DRV_NAME LED0_GPIO_CONTROLLER
25-
#define GPIO_OUT_PIN LED0_GPIO_PIN
23+
#if defined(DT_ALIAS_SW0_GPIOS_CONTROLLER) && defined(DT_ALIAS_LED0_GPIOS_CONTROLLER)
24+
#define GPIO_OUT_DRV_NAME DT_ALIAS_LED0_GPIOS_CONTROLLER
25+
#define GPIO_OUT_PIN DT_ALIAS_LED0_GPIOS_PIN
2626
#define GPIO_IN_DRV_NAME DT_ALIAS_SW0_GPIOS_CONTROLLER
2727
#define GPIO_INT_PIN DT_ALIAS_SW0_GPIOS_PIN
2828
#else

samples/net/lwm2m_client/src/lwm2m-client.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
4848

4949
#define ENDPOINT_LEN 32
5050

51-
#ifndef LED0_GPIO_CONTROLLER
51+
#ifndef DT_ALIAS_LED0_GPIOS_CONTROLLER
5252
#ifdef LED0_GPIO_PORT
53-
#define LED0_GPIO_CONTROLLER LED0_GPIO_PORT
53+
#define DT_ALIAS_LED0_GPIOS_CONTROLLER LED0_GPIO_PORT
5454
#else
55-
#define LED0_GPIO_CONTROLLER "(fail)"
56-
#define LED0_GPIO_PIN 0
55+
#define DT_ALIAS_LED0_GPIOS_CONTROLLER "(fail)"
56+
#define DT_ALIAS_LED0_GPIOS_PIN 0
5757
#endif
5858
#endif
5959

60-
#define LED_GPIO_PORT LED0_GPIO_CONTROLLER
61-
#define LED_GPIO_PIN LED0_GPIO_PIN
60+
#define LED_GPIO_PORT DT_ALIAS_LED0_GPIOS_CONTROLLER
61+
#define LED_GPIO_PIN DT_ALIAS_LED0_GPIOS_PIN
6262

6363
static int pwrsrc_bat;
6464
static int pwrsrc_usb;

0 commit comments

Comments
 (0)