diff options
| author | hathach <[email protected]> | 2025-07-10 17:18:17 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2025-07-10 17:18:17 +0700 |
| commit | 77be5f96e48cd6810538173f2311a51592ecd17a (patch) | |
| tree | 49283b92773740657b03f640f72ce5be8cb92d52 /examples/device/board_test/src | |
| parent | dee6b369235e3440f9237ae0e74f81edca95f6b7 (diff) | |
| parent | 546e8413b5ed05a8c35b8dbe7792516a3cd631fa (diff) | |
Merge branch 'master' into fork/roma-jam/feature/add_tusb_teardown
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 |
