Revision: 7565
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7565&view=rev
Author:   gbiggs
Date:     2009-03-31 04:00:09 +0000 (Tue, 31 Mar 2009)

Log Message:
-----------
Applied patch #2609664

Modified Paths:
--------------
    code/player/trunk/server/drivers/rfid/skyetekM1.cc

Modified: code/player/trunk/server/drivers/rfid/skyetekM1.cc
===================================================================
--- code/player/trunk/server/drivers/rfid/skyetekM1.cc  2009-03-31 03:56:42 UTC 
(rev 7564)
+++ code/player/trunk/server/drivers/rfid/skyetekM1.cc  2009-03-31 04:00:09 UTC 
(rev 7565)
@@ -83,6 +83,8 @@
 #include <string.h>
 #include <termios.h>
 #include <unistd.h>
+#include <stddef.h>
+#include <time.h>
 
 // Includes needed for player
 #include <libplayercore/playercore.h>
@@ -441,7 +443,10 @@
                        return;
                }
                memset (&TID, 0, len); // clear the struct for new port settings
-               usleep (10000); // sleep for 10ms
+               struct timespec ts;
+               ts.tv_sec = 0;
+               ts.tv_nsec = 10000000; // sleep for 10ms
+               nanosleep(&ts, NULL);
                ReadSerial (TID, len);
                if (response_buf[2] == 0x94)
                {
@@ -490,7 +495,10 @@
        WriteSerial (temp, length + 1);
 
        // sleep for 10ms
-       usleep (10000);
+       struct timespec ts;
+       ts.tv_sec = 0;
+       ts.tv_nsec = 10000000; // sleep for 10ms
+       nanosleep(&ts, NULL);
 
        while (!read_done)
        {
@@ -512,7 +520,9 @@
                if ((read_data[0] = 0x02) && (read_data[1] <= 0x50))
                        read_done = TRUE;
 
-               usleep (10000);               // Sleep for 10ms
+               ts.tv_sec = 0;
+               ts.tv_nsec = 10000000; // sleep for 10ms
+               nanosleep(&ts, NULL);
        }
 
        return 0;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
_______________________________________________
Playerstage-commit mailing list
Playerstage-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to