File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,15 @@ void update_progress(uint32_t progress, uint32_t total)
120
120
printf (" Update progress = %" PRIu8 " %%\n " , percent);
121
121
}
122
122
123
+ void flush_stdin_buffer (void )
124
+ {
125
+ FileHandle *debug_console = mbed::mbed_file_handle (STDIN_FILENO);
126
+ while (debug_console->readable ()) {
127
+ char buffer[1 ];
128
+ debug_console->read (buffer, 1 );
129
+ }
130
+ }
131
+
123
132
int main (void )
124
133
{
125
134
int status;
@@ -237,6 +246,9 @@ int main(void)
237
246
t.start (callback (&queue, &EventQueue::dispatch_forever));
238
247
queue.call_every (5000 , value_increment);
239
248
249
+ // Flush the stdin buffer before reading from it
250
+ flush_stdin_buffer ();
251
+
240
252
while (cloud_client_running) {
241
253
int in_char = getchar ();
242
254
if (in_char == ' i' ) {
Original file line number Diff line number Diff line change 288
288
"storage_filesystem.blockdevice" : " SPIF" ,
289
289
"storage_filesystem.external_base_address" : " (0x0)" ,
290
290
"storage_filesystem.external_size" : " (1024*1024*1)" ,
291
- "platform.default-serial-baud-rate" : 230400 ,
292
- "platform.stdio-baud-rate" : 230400 ,
293
291
"drivers.uart-serial-rxbuf-size" : 1024 ,
294
292
"drivers.uart-serial-txbuf-size" : 1024 ,
295
293
"lwip.ipv4-enabled" : true ,
You can’t perform that action at this time.
0 commit comments