diff --git a/examples/flowc/Kconfig b/examples/flowc/Kconfig index 13869d706..5049dfebf 100644 --- a/examples/flowc/Kconfig +++ b/examples/flowc/Kconfig @@ -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" diff --git a/examples/flowc/flowc_receiver.c b/examples/flowc/flowc_receiver.c index f5a92d0ec..a9b183f84 100644 --- a/examples/flowc/flowc_receiver.c +++ b/examples/flowc/flowc_receiver.c @@ -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);