summaryrefslogtreecommitdiff
path: root/examples/device
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2022-11-21 17:22:52 +0700
committerGitHub <[email protected]>2022-11-21 17:22:52 +0700
commit4a2e424103b0a2626a6cb464a350c68ae109cc7e (patch)
tree4a46f70fc34bc477b5c742b6f5a103322b7753f1 /examples/device
parent95fb11fcffd27a055561d2171aa99199982bb563 (diff)
parenta394273ed28bdbd9ed5cf4ba94a99204bdd841e9 (diff)
Merge pull request #1746 from hathach/host-msc-example
Add host msc explorer example
Diffstat (limited to 'examples/device')
-rw-r--r--examples/device/board_test/src/main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/device/board_test/src/main.c b/examples/device/board_test/src/main.c
index 5e28cbb27..0289ca15f 100644
--- a/examples/device/board_test/src/main.c
+++ b/examples/device/board_test/src/main.c
@@ -56,7 +56,7 @@ int main(void)
{
uint32_t interval_ms = board_button_read() ? BLINK_PRESSED : BLINK_UNPRESSED;
- // Blink every interval ms
+ // Blink and print every interval ms
if ( !(board_millis() - start_ms < interval_ms) )
{
board_uart_write(HELLO_STR, strlen(HELLO_STR));
@@ -66,6 +66,13 @@ int main(void)
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);
+ }
}
return 0;