File tree 2 files changed +9
-4
lines changed 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ following:
113
113
114
114
``` python
115
115
try :
116
- if asyncio.version != ' fast_io' :
116
+ if asyncio.version[ 0 ] != ' fast_io' :
117
117
raise AttributeError
118
118
except AttributeError :
119
119
raise OSError (' This requires fast_io fork of uasyncio.' )
@@ -161,7 +161,7 @@ Applications can detect which timebase is in use by issuing:
161
161
162
162
``` python
163
163
try :
164
- if asyncio.version != ' fast_io' :
164
+ if asyncio.version[ 0 ] != ' fast_io' :
165
165
raise AttributeError
166
166
except AttributeError :
167
167
raise OSError (' This requires fast_io fork of uasyncio.' )
@@ -272,7 +272,7 @@ hardware and code. The only *required* change to application code is to add
272
272
273
273
``` python
274
274
try :
275
- if asyncio.version != ' fast_io' :
275
+ if asyncio.version[ 0 ] != ' fast_io' :
276
276
raise AttributeError
277
277
except AttributeError :
278
278
raise OSError (' This requires fast_io fork of uasyncio.' )
Original file line number Diff line number Diff line change 23
23
if mode is None : # USB is disabled
24
24
use_utime = False # use RTC timebase
25
25
elif 'VCP' in mode : # User has enabled VCP in boot.py
26
- if pyb .Pin .board .USB_VBUS .value () == 1 : # USB physically connected
26
+ usb_conn = pyb .Pin .board .USB_VBUS .value () # USB physically connected to pyb V1.x
27
+ if not usb_conn :
28
+ usb_conn = hasattr (pyb .Pin .board , 'USB_HS_DP' ) and pyb .Pin .board .USB_HS_DP .value ()
29
+ if not usb_conn :
30
+ usb_conn = hasattr (pyb .Pin .board , 'USB_DP' ) and pyb .Pin .board .USB_DP .value ()
31
+ if usb_conn :
27
32
print ('USB connection: rtc_time disabled.' )
28
33
else :
29
34
pyb .usb_mode (None ) # Save power
You can’t perform that action at this time.
0 commit comments