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); } }
/// <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); }
public static void RegisterDevice(USBDevice device) { Devices.Add(device); }