This commit is contained in:
pjanik-hub
2026-02-19 19:07:05 -07:00
commit 7a82e54414
6 changed files with 89 additions and 0 deletions

37
src/main.c Normal file
View File

@@ -0,0 +1,37 @@
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/kernel.h>
#include <zephyr/drivers/uart.h>
#define SLEEP_MS 2000
#define LED_NODE DT_ALIAS(led0)
#if !DT_NODE_HAS_STATUS(LED_NODE, okay)
#error "led0 not enabled in devicetree"
#endif
static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED_NODE, gpios);
int main(void)
{
printk("app started\n");
if (!gpio_is_ready_dt(&led))
{
printk("LED GPIO not ready\n");
return 0;
}
int ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
if (ret < 0)
{
printk("LED GPIO configure failed: %d\n", ret);
return 0;
}
char incoming;
int i = 0;
while (1)
{
}
}