Index: sandbox/JamPlayerUSB/jbistub.c
===================================================================
--- sandbox/JamPlayerUSB/jbistub.c	(revision 111)
+++ sandbox/JamPlayerUSB/jbistub.c	(revision 112)
@@ -27,19 +27,12 @@
 /****************************************************************************/
 
-#include <windows.h>
-
 #include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
-#include <io.h>
-#include <fcntl.h>
-#include <process.h>
+#include <unistd.h>
 #include <malloc.h>
+#include <ctype.h>
+#include <sys/stat.h>
+
 #define POINTER_ALIGNMENT sizeof(BYTE)
-#include <time.h>
-#include <conio.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 
 #include "jbiexprt.h"
@@ -54,22 +47,14 @@
 long file_length = 0L;
 
-/* delay count for one millisecond delay */
-long one_ms_delay = 0L;
+/******************************************************************/
+
+#include <windows.h>
+#include "ftd2xx.h"
 
 BOOL jtag_hardware_initialized = FALSE;
 
-/* function prototypes to allow forward reference */
-extern void delay_loop(long count);
-
 BOOL verbose = FALSE;
 
-/******************************************************************/
-
-#include "ftd2xx.h"
-
 static FT_HANDLE ftdih = NULL;
-
-BYTE usb_buf[64];
-int usb_buf_pos;
 
 /******************************************************************/
@@ -116,6 +101,4 @@
 
     FT_STATUS status;
-
-    usb_buf_pos = 0;
 
     if ((status = FT_OpenEx("USB-Blaster", FT_OPEN_BY_DESCRIPTION, &ftdih)) != FT_OK)
@@ -429,6 +412,5 @@
 void jbi_delay(long microseconds)
 {
-	delay_loop(microseconds *
-		((one_ms_delay / 1000L) + ((one_ms_delay % 1000L) ? 1 : 0)));
+	usleep(microseconds);
 }
 
@@ -451,9 +433,4 @@
 		free(ptr);
 	}
-}
-
-void calibrate_delay(void)
-{
-	one_ms_delay = 0L;
 }
 
@@ -508,7 +485,4 @@
 	int exit_code = 0;
 	int format_version = 0;
-	time_t start_time = 0;
-	time_t end_time = 0;
-	int time_delta = 0;
 	char *workspace = NULL;
 	char *action = NULL;
@@ -680,9 +654,4 @@
 		{
 			/*
-			*	Calibrate the delay loop function
-			*/
-			calibrate_delay();
-
-			/*
 			*	Check CRC
 			*/
@@ -786,9 +755,7 @@
 				*	Execute the Jam STAPL ByteCode program
 				*/
-				time(&start_time);
 				exec_result = jbi_execute(file_buffer, file_length, workspace,
 					workspace_size, action, init_list, reset_jtag,
 					&error_address, &exit_code, &format_version);
-				time(&end_time);
 
 				if (exec_result == JBIC_SUCCESS)
@@ -858,16 +825,4 @@
 					printf("Unknown error code %d\n", exec_result);
 				}
-
-				/*
-				*	Print out elapsed time
-				*/
-				if (verbose)
-				{
-					time_delta = (int) (end_time - start_time);
-					printf("Elapsed time = %02u:%02u:%02u\n",
-						time_delta / 3600,			/* hours */
-						(time_delta % 3600) / 60,	/* minutes */
-						time_delta % 60);			/* seconds */
-				}
 			}
 		}
@@ -881,7 +836,2 @@
 	return (exit_status);
 }
-
-void delay_loop(long count)
-{
-	while (count != 0L) count--;
-}
