Modules/USB - Cleanup mostly
[tpg/acess2.git] / Modules / USB / Core / main.c
index baf1332..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;
-tUSBHub        *gUSB_Hubs = NULL;
-tUSBHub        *gUSB_HubsEnd = NULL;
 
 // === CODE ===
 /**
@@ -40,25 +42,13 @@ tUSBHub     *gUSB_HubsEnd = 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( tUSBHub *hub = gUSB_Hubs; hub; hub = hub->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