apps/examples/flowc: Add a delay between received packets in order to force input flow control.
This commit is contained in:
parent
adcce43685
commit
778ff478e6
@ -102,6 +102,10 @@ config EXAMPLES_FLOWC_RECEIVER_BUFSIZE
|
||||
int "Receiver buffer size"
|
||||
default 64
|
||||
|
||||
config EXAMPLES_FLOWC_RECEIVER_DELAY
|
||||
int "Receiver read delay (msec)"
|
||||
default 100
|
||||
|
||||
config EXAMPLES_FLOWC_RECEVER_DEVNAME
|
||||
string "Default TTY device for receiver"
|
||||
default "/dev/ttyACM0"
|
||||
|
@ -191,6 +191,12 @@ int flowc_receiver(int argc, char **argv)
|
||||
close(fd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_EXAMPLES_FLOWC_RECEIVER_DELAY
|
||||
/* Delay to force flow control */
|
||||
|
||||
usleep(1000 * CONFIG_EXAMPLES_FLOWC_RECEIVER_DELAY);
|
||||
#endif
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
Loading…
Reference in New Issue
Block a user