mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
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
2 changed files with 10 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue