samples: nrf52: onoff_level_lightning_vnd_app: use dts-generated defines
This commit updates the onoff_level_lightning_vnd_app sample to use the dts-generated defines instead of the aliases in board.h. Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
This commit is contained in:
parent
6ca042d3bd
commit
7fb051bc72
1 changed files with 8 additions and 8 deletions
|
@ -31,22 +31,22 @@ static void gpio_init(void)
|
|||
|
||||
/* LEDs configiuratin & setting */
|
||||
|
||||
led_device[0] = device_get_binding(LED0_GPIO_PORT);
|
||||
led_device[0] = device_get_binding(LED0_GPIO_CONTROLLER);
|
||||
gpio_pin_configure(led_device[0], LED0_GPIO_PIN,
|
||||
GPIO_DIR_OUT | GPIO_PUD_PULL_UP);
|
||||
gpio_pin_write(led_device[0], LED0_GPIO_PIN, 1);
|
||||
|
||||
led_device[1] = device_get_binding(LED1_GPIO_PORT);
|
||||
led_device[1] = device_get_binding(LED1_GPIO_CONTROLLER);
|
||||
gpio_pin_configure(led_device[1], LED1_GPIO_PIN,
|
||||
GPIO_DIR_OUT | GPIO_PUD_PULL_UP);
|
||||
gpio_pin_write(led_device[1], LED1_GPIO_PIN, 1);
|
||||
|
||||
led_device[2] = device_get_binding(LED2_GPIO_PORT);
|
||||
led_device[2] = device_get_binding(LED2_GPIO_CONTROLLER);
|
||||
gpio_pin_configure(led_device[2], LED2_GPIO_PIN,
|
||||
GPIO_DIR_OUT | GPIO_PUD_PULL_UP);
|
||||
gpio_pin_write(led_device[2], LED2_GPIO_PIN, 1);
|
||||
|
||||
led_device[3] = device_get_binding(LED3_GPIO_PORT);
|
||||
led_device[3] = device_get_binding(LED3_GPIO_CONTROLLER);
|
||||
gpio_pin_configure(led_device[3], LED3_GPIO_PIN,
|
||||
GPIO_DIR_OUT | GPIO_PUD_PULL_UP);
|
||||
gpio_pin_write(led_device[3], LED3_GPIO_PIN, 1);
|
||||
|
@ -55,7 +55,7 @@ static void gpio_init(void)
|
|||
|
||||
k_work_init(&button_work, publish);
|
||||
|
||||
button_device[0] = device_get_binding(SW0_GPIO_NAME);
|
||||
button_device[0] = device_get_binding(SW0_GPIO_CONTROLLER);
|
||||
gpio_pin_configure(button_device[0], SW0_GPIO_PIN,
|
||||
(GPIO_DIR_IN | GPIO_INT | GPIO_INT_EDGE |
|
||||
GPIO_PUD_PULL_UP |
|
||||
|
@ -64,7 +64,7 @@ static void gpio_init(void)
|
|||
gpio_add_callback(button_device[0], &button_cb[0]);
|
||||
gpio_pin_enable_callback(button_device[0], SW0_GPIO_PIN);
|
||||
|
||||
button_device[1] = device_get_binding(SW1_GPIO_NAME);
|
||||
button_device[1] = device_get_binding(SW1_GPIO_CONTROLLER);
|
||||
gpio_pin_configure(button_device[1], SW1_GPIO_PIN,
|
||||
(GPIO_DIR_IN | GPIO_INT | GPIO_INT_EDGE |
|
||||
GPIO_PUD_PULL_UP |
|
||||
|
@ -73,7 +73,7 @@ static void gpio_init(void)
|
|||
gpio_add_callback(button_device[1], &button_cb[1]);
|
||||
gpio_pin_enable_callback(button_device[1], SW1_GPIO_PIN);
|
||||
|
||||
button_device[2] = device_get_binding(SW2_GPIO_NAME);
|
||||
button_device[2] = device_get_binding(SW2_GPIO_CONTROLLER);
|
||||
gpio_pin_configure(button_device[2], SW2_GPIO_PIN,
|
||||
(GPIO_DIR_IN | GPIO_INT | GPIO_INT_EDGE |
|
||||
GPIO_PUD_PULL_UP |
|
||||
|
@ -82,7 +82,7 @@ static void gpio_init(void)
|
|||
gpio_add_callback(button_device[2], &button_cb[2]);
|
||||
gpio_pin_enable_callback(button_device[2], SW2_GPIO_PIN);
|
||||
|
||||
button_device[3] = device_get_binding(SW3_GPIO_NAME);
|
||||
button_device[3] = device_get_binding(SW3_GPIO_CONTROLLER);
|
||||
gpio_pin_configure(button_device[3], SW3_GPIO_PIN,
|
||||
(GPIO_DIR_IN | GPIO_INT | GPIO_INT_EDGE |
|
||||
GPIO_PUD_PULL_UP |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue