summaryrefslogtreecommitdiff
path: root/examples/host
diff options
context:
space:
mode:
authorhathach <[email protected]>2020-09-04 00:50:10 +0700
committerhathach <[email protected]>2020-09-04 00:50:10 +0700
commit865ebf7c5db98ccc3f8f5f4fead9d8bba0e57c18 (patch)
treebd270b2aba6333b30c7b07ac9a23dce105bf1872 /examples/host
parent7828c396dbc287f9d9a0aa6af63a32108f139b94 (diff)
fflush(stdout) for keyboard host example
Diffstat (limited to 'examples/host')
-rw-r--r--examples/host/cdc_msc_hid/src/main.c2
-rw-r--r--examples/host/cdc_msc_hid/src/msc_app.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/examples/host/cdc_msc_hid/src/main.c b/examples/host/cdc_msc_hid/src/main.c
index 209379b37..34503499f 100644
--- a/examples/host/cdc_msc_hid/src/main.c
+++ b/examples/host/cdc_msc_hid/src/main.c
@@ -143,6 +143,8 @@ static inline void process_kbd_report(hid_keyboard_report_t const *p_new_report)
uint8_t ch = keycode2ascii[p_new_report->keycode[i]][is_shift ? 1 : 0];
putchar(ch);
if ( ch == '\r' ) putchar('\n'); // added new line for enter key
+
+ fflush(stdout); // flush right away, else nanolib will wait for newline
}
}
// TODO example skips key released
diff --git a/examples/host/cdc_msc_hid/src/msc_app.c b/examples/host/cdc_msc_hid/src/msc_app.c
index 93dc6d3fe..62bd961c1 100644
--- a/examples/host/cdc_msc_hid/src/msc_app.c
+++ b/examples/host/cdc_msc_hid/src/msc_app.c
@@ -35,7 +35,7 @@
//------------- IMPLEMENTATION -------------//
void tuh_msc_mounted_cb(uint8_t dev_addr)
{
- printf("a MassStorage device is mounted\r\n");
+ printf("A MassStorage device is mounted\r\n");
//------------- Disk Information -------------//
// SCSI VendorID[8] & ProductID[16] from Inquiry Command
@@ -83,7 +83,7 @@ void tuh_msc_mounted_cb(uint8_t dev_addr)
void tuh_msc_unmounted_cb(uint8_t dev_addr)
{
(void) dev_addr;
- printf("a MassStorage device is unmounted\r\n");
+ printf("A MassStorage device is unmounted\r\n");
// uint8_t phy_disk = dev_addr-1;
//