Update repo
This commit is contained in:
1 parent
0afe39c8fe
commit
d229fd964d
6 files changed
+9
-28
No files matched your search
@@ -6,7 +6,6 @@
|
||||
#include <zephyr/drivers/uart.h>
|
||||
#include <zephyr/drivers/adc.h>
|
||||
|
||||
|
||||
#if !DT_NODE_HAS_STATUS(DT_ALIAS(sw0), okay)
|
||||
#error "Board does not define alias sw0. Add a boad overlay"
|
||||
#endif
|
||||
@@ -16,7 +15,6 @@ static const struct gpio_dt_spec button =
|
||||
|
||||
static struct gpio_callback button_cb;
|
||||
|
||||
|
||||
static void button_isr(const struct device *port,
|
||||
struct gpio_callback *cb,
|
||||
gpio_port_pins_t pins)
|
||||
@@ -34,9 +32,8 @@ static void button_isr(const struct device *port,
|
||||
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
|
||||
int main(void)
|
||||
{
|
||||
if(!device_is_ready(button.port)) {
|
||||
return 0;
|
||||
}
|
||||
@@ -49,7 +46,6 @@ int main(void)
|
||||
gpio_init_callback(&button_cb, button_isr, BIT(button.pin));
|
||||
gpio_add_callback(button.port, &button_cb);
|
||||
|
||||
|
||||
if(gpio_pin_interrupt_configure_dt(&button, GPIO_INT_EDGE_BOTH) != 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -57,9 +53,7 @@ int main(void)
|
||||
printk("\r\n[EXTI] Button pin interrupt is ready. Press button\r\n");
|
||||
|
||||
while (1) {
|
||||
|
||||
k_sleep(K_FOREVER);
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user