diff options
| author | HiFiPhile <[email protected]> | 2025-07-11 15:47:55 +0200 |
|---|---|---|
| committer | HiFiPhile <[email protected]> | 2025-07-11 15:47:55 +0200 |
| commit | f074815405f9c510f3f1eb57f3cbdab40e9e1caa (patch) | |
| tree | 27157de2ae8ef662974a9d87a8119c12f3fbdffb /examples/device/board_test/src | |
| parent | 69f6b57772ad4f2923dcf48aabaaba044085c4b0 (diff) | |
| parent | 29c2af7651f9075a63a036e94c7bbe3d0d00c31a (diff) | |
Merge branch 'master' into feature/usbtmc_vendor-specific
Diffstat (limited to 'examples/device/board_test/src')
| -rw-r--r-- | examples/device/board_test/src/main.c | 27 | ||||
| -rw-r--r-- | examples/device/board_test/src/tusb_config.h | 2 |
2 files changed, 19 insertions, 10 deletions
diff --git a/examples/device/board_test/src/main.c b/examples/device/board_test/src/main.c index 2269d45f1..d91a8760e 100644 --- a/examples/device/board_test/src/main.c +++ b/examples/device/board_test/src/main.c @@ -49,25 +49,34 @@ int main(void) { while (1) { uint32_t interval_ms = board_button_read() ? BLINK_PRESSED : BLINK_UNPRESSED; + int ch = board_getchar(); + if (ch > 0) { + board_putchar(ch); + #ifndef LOGGER_UART + board_uart_write(&ch, 1); + #endif + } + // Blink and print every interval ms if (!(board_millis() - start_ms < interval_ms)) { - board_uart_write(HELLO_STR, strlen(HELLO_STR)); - start_ms = board_millis(); + if (ch < 0) { + // skip if echoing + printf(HELLO_STR); + + #ifndef LOGGER_UART + board_uart_write(HELLO_STR, strlen(HELLO_STR)); + #endif + } + board_led_write(led_state); led_state = 1 - led_state; // toggle } - - // echo - uint8_t ch; - if (board_uart_read(&ch, 1) > 0) { - board_uart_write(&ch, 1); - } } } -#if TUSB_MCU_VENDOR_ESPRESSIF +#ifdef ESP_PLATFORM void app_main(void) { main(); } diff --git a/examples/device/board_test/src/tusb_config.h b/examples/device/board_test/src/tusb_config.h index 8ac3bc8de..81829d450 100644 --- a/examples/device/board_test/src/tusb_config.h +++ b/examples/device/board_test/src/tusb_config.h @@ -44,7 +44,7 @@ #endif // Espressif IDF requires "freertos/" prefix in include path -#if TUSB_MCU_VENDOR_ESPRESSIF +#ifdef ESP_PLATFORM #define CFG_TUSB_OS_INC_PATH freertos/ #endif |
