Modules/USB - Cleanup mostly
[tpg/acess2.git] / Modules / USB / Core / main.c
index 277cf7c..36a1363 100644 (file)
 #include <modules.h>
 #include "usb.h"
 
+// === IMPORTS ===
+extern void    USB_PollThread(void *unused);
+extern void    USB_AsyncThread(void *Unused);
+
 // === PROTOTYPES ===
  int   USB_Install(char **Arguments);
 void   USB_Cleanup(void);
@@ -30,8 +34,6 @@ tDevFS_Driver gUSB_DrvInfo = {
        }
 };
 tUSBHost       *gUSB_Hosts = NULL;
-tUSBInterface  *gUSB_InterruptDevs = NULL;
-tUSBInterface  *gUSB_InterruptLast = NULL;
 
 // === CODE ===
 /**
@@ -40,25 +42,13 @@ tUSBInterface       *gUSB_InterruptLast = NULL;
 int USB_Install(char **Arguments)
 {
        Log_Warning("USB", "Not Complete - Devel Only");
+       
+       Proc_SpawnWorker(USB_PollThread, NULL);
+       Proc_SpawnWorker(USB_AsyncThread, NULL);
+       
        return MODULE_ERR_OK;
 }
 
-/**
- * \brief USB polling thread
- */
-int USB_PollThread(void *unused)
-{
-       for(;;)
-       {
-               for( tUSBInterface *dev = gUSB_InterruptDevs; dev; dev = dev->Next )
-               {
-//                     hub->CheckPorts(hub, hub->Device);
-               }
-               // TODO: Fine tune
-               Time_Delay(250);
-       }
-}
-
 /**
  * \brief Called just before module is unloaded
  */

UCC git Repository :: git.ucc.asn.au