瀏覽代碼

Opps, cleanup more device status function stuff

main
PaulStoffregen 7 年之前
父節點
當前提交
713bfb1513
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. +2
    -3
      USBHost_t36.h

+ 2
- 3
USBHost_t36.h 查看文件

@@ -381,18 +381,17 @@ protected:
// All USB device drivers inherit from this base class.
class USBDriver : public USBHost {
public:
//operator bool() { return (*(Device_t * volatile *)&device != nullptr); }
operator bool() {
Device_t *dev = *(Device_t * volatile *)&device;
return dev != nullptr;
}
uint16_t idVendor() {
Device_t *dev = *(Device_t * volatile *)&device;
return (device != nullptr) ? device->idVendor : 0;
return (dev != nullptr) ? dev->idVendor : 0;
}
uint16_t idProduct() {
Device_t *dev = *(Device_t * volatile *)&device;
return (device != nullptr) ? device->idProduct : 0;
return (dev != nullptr) ? dev->idProduct : 0;
}
const uint8_t *manufacturer() {
Device_t *dev = *(Device_t * volatile *)&device;

Loading…
取消
儲存