update uart read for lpc18/43 for testing

This commit is contained in:
hathach
2022-11-18 21:50:00 +07:00
parent b00529e287
commit a6001fc8f2
6 changed files with 17 additions and 10 deletions

View File

@@ -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) )
{
board_uart_write(&ch, 1);
}
}
return 0;