diff --git a/examples/pn53x-tamashell.1 b/examples/pn53x-tamashell.1 index 3607e05..598528c 100644 --- a/examples/pn53x-tamashell.1 +++ b/examples/pn53x-tamashell.1 @@ -22,7 +22,7 @@ Shebang is supported, simply start your script with: .SH COMMANDS -\fIp N\fP to introduce a pause of N seconds. +\fIp N\fP to introduce a pause of N milliseconds. \fIq\fP or \fICtrl-d\fP to quit. diff --git a/examples/pn53x-tamashell.c b/examples/pn53x-tamashell.c index 9c79a28..e874905 100644 --- a/examples/pn53x-tamashell.c +++ b/examples/pn53x-tamashell.c @@ -47,7 +47,20 @@ #include #include #include -#include +#include + +#ifndef _WIN32 +// Needed by sleep() under Unix +# include +# define sleep usleep +# define SUSP_TIME 1000 // usecs. +#else +// Needed by Sleep() under Windows +# include +# define sleep Sleep +# define SUSP_TIME 1 // msecs. +#endif + #include @@ -132,9 +145,9 @@ int main(int argc, const char* argv[]) offset++; } sscanf(cmd+offset, "%d", &s); - printf("Pause for %i secs\n", s); + printf("Pause for %i msecs\n", s); if (s>0) { - sleep(s); + sleep(s * SUSP_TIME); } free(cmd); continue;