You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
raiseValueError("bitmask must be within 0 and 0xFFFFFFFF (inclusive)")
175
+
defbit_on(x):
176
+
returnbitmask& (1<<x)
177
+
res= ["Enabled"ifbit_on(0) else"Disabled"]
178
+
ifbit_on(1):
179
+
res.append("USB2 Data Enabled")
180
+
ifbit_on(3):
181
+
res.append("USB3 Data Enabled")
182
+
ifbit_on(11):
183
+
res.append("USB2 Device Attached")
184
+
ifbit_on(12):
185
+
res.append("USB3 Device Attached")
186
+
ifbit_on(19):
187
+
res.append("USB Error Flag")
188
+
ifbit_on(20):
189
+
res.append("USB2 Boost Enabled")
190
+
ifbit_on(23):
191
+
res.append("Device Attached")
192
+
returnres
173
193
174
-
ifnot (bitmask&0x1): # Port is disabled by Acroname - last bit off indicates Vbus is off - port is disabled
175
-
return"Disabled"
176
-
ifbitmask==11: # Port is enabled but no device was detected
177
-
return"Disconnected"
178
-
ifbitmask>100: # Normally we hope it will cover "Device Attached" use cases (Note, can also be turn on when 'USB Error Flag' is on...but we havn't seen that )
0 commit comments