mirror of
https://github.com/gdsports/USBHost_t36
synced 2024-11-14 13:15:00 -05:00
Opps, cleanup more device status function stuff
This commit is contained in:
parent
8f09965162
commit
713bfb1513
@ -381,18 +381,17 @@ protected:
|
|||||||
// All USB device drivers inherit from this base class.
|
// All USB device drivers inherit from this base class.
|
||||||
class USBDriver : public USBHost {
|
class USBDriver : public USBHost {
|
||||||
public:
|
public:
|
||||||
//operator bool() { return (*(Device_t * volatile *)&device != nullptr); }
|
|
||||||
operator bool() {
|
operator bool() {
|
||||||
Device_t *dev = *(Device_t * volatile *)&device;
|
Device_t *dev = *(Device_t * volatile *)&device;
|
||||||
return dev != nullptr;
|
return dev != nullptr;
|
||||||
}
|
}
|
||||||
uint16_t idVendor() {
|
uint16_t idVendor() {
|
||||||
Device_t *dev = *(Device_t * volatile *)&device;
|
Device_t *dev = *(Device_t * volatile *)&device;
|
||||||
return (device != nullptr) ? device->idVendor : 0;
|
return (dev != nullptr) ? dev->idVendor : 0;
|
||||||
}
|
}
|
||||||
uint16_t idProduct() {
|
uint16_t idProduct() {
|
||||||
Device_t *dev = *(Device_t * volatile *)&device;
|
Device_t *dev = *(Device_t * volatile *)&device;
|
||||||
return (device != nullptr) ? device->idProduct : 0;
|
return (dev != nullptr) ? dev->idProduct : 0;
|
||||||
}
|
}
|
||||||
const uint8_t *manufacturer() {
|
const uint8_t *manufacturer() {
|
||||||
Device_t *dev = *(Device_t * volatile *)&device;
|
Device_t *dev = *(Device_t * volatile *)&device;
|
||||||
|
Loading…
Reference in New Issue
Block a user