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"
|
int "Receiver buffer size"
|
||||||
default 64
|
default 64
|
||||||
|
|
||||||
|
config EXAMPLES_FLOWC_RECEIVER_DELAY
|
||||||
|
int "Receiver read delay (msec)"
|
||||||
|
default 100
|
||||||
|
|
||||||
config EXAMPLES_FLOWC_RECEVER_DEVNAME
|
config EXAMPLES_FLOWC_RECEVER_DEVNAME
|
||||||
string "Default TTY device for receiver"
|
string "Default TTY device for receiver"
|
||||||
default "/dev/ttyACM0"
|
default "/dev/ttyACM0"
|
||||||
|
@ -191,6 +191,12 @@ int flowc_receiver(int argc, char **argv)
|
|||||||
close(fd);
|
close(fd);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_EXAMPLES_FLOWC_RECEIVER_DELAY
|
||||||
|
/* Delay to force flow control */
|
||||||
|
|
||||||
|
usleep(1000 * CONFIG_EXAMPLES_FLOWC_RECEIVER_DELAY);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
|
Loading…
Reference in New Issue
Block a user