summaryrefslogtreecommitdiff
path: root/examples/device
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-01-25 16:29:56 +0700
committerhathach <[email protected]>2025-01-25 22:24:00 +0700
commit8c7998b0e9783a8f44e544c08cb89a81dcf66b6f (patch)
tree42d3c5f049fff23e76f749f8129d883f69b2563d /examples/device
parent6b3a5957c2e84a093854eaf6afea352d67324136 (diff)
fix ci
Diffstat (limited to 'examples/device')
-rw-r--r--examples/device/board_test/src/main.c54
1 files changed, 4 insertions, 50 deletions
diff --git a/examples/device/board_test/src/main.c b/examples/device/board_test/src/main.c
index 321f6638a..2269d45f1 100644
--- a/examples/device/board_test/src/main.c
+++ b/examples/device/board_test/src/main.c
@@ -23,7 +23,6 @@
*
*/
-#if 1
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -52,7 +51,7 @@ int main(void) {
// Blink and print every interval ms
if (!(board_millis() - start_ms < interval_ms)) {
- // board_uart_write(HELLO_STR, strlen(HELLO_STR));
+ board_uart_write(HELLO_STR, strlen(HELLO_STR));
start_ms = board_millis();
@@ -61,57 +60,12 @@ int main(void) {
}
// echo
- // uint8_t ch;
- // if (board_uart_read(&ch, 1) > 0) {
- // board_uart_write(&ch, 1);
- // }
- }
-}
-
-#else
-#include <stdio.h>
-#include <zephyr/kernel.h>
-#include <zephyr/drivers/gpio.h>
-
-/* 1000 msec = 1 sec */
-#define SLEEP_TIME_MS 200
-
-/* The devicetree node identifier for the "led0" alias. */
-#define LED0_NODE DT_ALIAS(led0)
-
-/*
- * A build error on this line means your board is unsupported.
- * See the sample documentation for information on how to fix this.
- */
-static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
-
-int main(void)
-{
- int ret;
- bool led_state = true;
-
- if (!gpio_is_ready_dt(&led)) {
- return 0;
- }
-
- ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
- if (ret < 0) {
- return 0;
- }
-
- while (1) {
- ret = gpio_pin_toggle_dt(&led);
- if (ret < 0) {
- return 0;
+ uint8_t ch;
+ if (board_uart_read(&ch, 1) > 0) {
+ board_uart_write(&ch, 1);
}
-
- led_state = !led_state;
- printf("LED state: %s\n", led_state ? "ON" : "OFF");
- k_msleep(SLEEP_TIME_MS);
}
- return 0;
}
-#endif
#if TUSB_MCU_VENDOR_ESPRESSIF
void app_main(void) {