Esempio n. 1
0
        public static unsafe void Poll()
        {
            while (true)
            {
                for (int i = 0; i < Controllers.Count; i++)
                {
                    IUSBController controller = (IUSBController)Controllers.Item[i];

                    //tada
                    controller?.Poll(controller);
                }

                for (int i = 0; i < Devices.Count; i++)
                {
                    USBDevice device = (USBDevice)Devices.Item[i];

                    if (device.State == USBDeviceState.CONFIGURED)
                    {
                        device.Driver?.Poll(device);
                    }
                }

                MultiTasking.Tasking.CurrentTask.CurrentThread.Sleep(0, 100);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Load driver
        /// </summary>
        /// <param name="device"></param>
        /// <returns></returns>
        public static unsafe IUSBDriver LoadDriver(USBDevice device)
        {
            for (int i = 0; i < mDriverList.Count; i++)
            {
                IUSBDriver driver = (IUSBDriver)mDriverList.Item[i];

                IUSBDriver loadedDriver = driver.Load(device);

                if (loadedDriver != null)
                {
                    return(loadedDriver);
                }
            }

            return(null);
        }
Esempio n. 3
0
 public static void RegisterDevice(USBDevice device)
 {
     Devices.Add(device);
 }