Skip to content

Commit aa46959

Browse files
author
Alrik Vidstrom
committed
Fix PMC detection error
The external pull-up resistor didn't have sufficient time to raise the voltage to an acceptable high for certain boards
1 parent dc510ae commit aa46959

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Arduino_POSIXStorage.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,12 @@ enum BoardTypes detectPortentaH7TypeOnce()
164164
// Inject low level into input, wait 1 ms to settle
165165
vbusPin.mode(PullDown);
166166
delay(1);
167-
// Shortly float the input and read the state
167+
// Shortly float the input
168168
vbusPin.mode(PullNone);
169+
// Give the external pull-up resistor on the Portenta Machine control enough time to
170+
// raise the voltage to an acceptable high
171+
delayMicroseconds(50);
172+
// Read the state
169173
inAfterDown = vbusPin.read();
170174
// End floating state and leave the input in pull-up state
171175
vbusPin.mode(PullUp);

0 commit comments

Comments
 (0)