FreeCalypso > hg > freecalypso-tools
view target-utils/loadagent/sertimeout.c @ 817:9706832b740b
fc-tmsh: ETM_BSIM response handling implemented
| author | Mychaela Falconia <falcon@freecalypso.org> | 
|---|---|
| date | Sat, 15 May 2021 01:00:52 +0000 | 
| parents | 880c6d31e487 | 
| children | 
line wrap: on
 line source
/* * Here we are going to implement a function for serial input with a timeout. */ #include <stdlib.h> serial_in_timeout(count) unsigned count; { int c; do c = serial_in_poll(); while (c < 0 && --count); return c; } void cmd_sertimeout(argbulk) char *argbulk; { char *argv[2]; int count; if (parse_args(argbulk, 1, 1, argv, 0) < 0) return; count = atoi(argv[0]); serial_in_timeout(count); }
