clean up some examples

This commit is contained in:
hathach
2021-03-18 15:23:08 +07:00
parent b221cedf80
commit 2882390c82
6 changed files with 34 additions and 30 deletions

View File

@@ -63,13 +63,11 @@ static void echo_serial_port(uint8_t itf, uint8_t buf[], uint32_t count)
}
else
{
// echo back additional ports as upper case
// echo back 2nd port as upper case
if (islower(buf[i])) buf[i] -= 'a' - 'A';
}
tud_cdc_n_write_char(itf, buf[i]);
if ( buf[i] == '\r' ) tud_cdc_n_write_char(itf, '\n');
}
tud_cdc_n_write_flush(itf);
}
@@ -85,7 +83,7 @@ static void cdc_task(void)
{
// connected() check for DTR bit
// Most but not all terminal client set this when making connection
if ( tud_cdc_n_connected(itf) )
// if ( tud_cdc_n_connected(itf) )
{
if ( tud_cdc_n_available(itf) )
{