Skip to content

Commit d955b69

Browse files
author
Alrik Vidstrom
committed
Fix bug that breaks RS485 on the Opta
PB14 is used to enable USB on the PMC, but it is used for RS485 on the Opta. Therefore, performing automatic detection on the Opta breaks RS485.
1 parent ec461e0 commit d955b69

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Arduino_POSIXStorage.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,11 @@ enum BoardTypes detectBoardType()
224224
{
225225
#if defined(ARDUINO_PORTENTA_C33)
226226
return BOARD_PORTENTA_C33;
227-
#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_OPTA)
227+
#elif defined(ARDUINO_OPTA)
228+
// This case must be handled separately, because PB14 that enables USB on the PMC is used for RS485 on the Opta,
229+
// so performing automatic detection on the Opta breaks RS485
230+
return BOARD_PORTENTA_H7;
231+
#elif defined(ARDUINO_PORTENTA_H7_M7)
228232
#if (defined(AUTOMATIC_OVERRIDE_PORTENTA_H7) && defined(AUTOMATIC_OVERRIDE_PORTENTA_MACHINE_CONTROL))
229233
#error "You have defined AUTOMATIC_OVERRIDE_PORTENTA_H7 and AUTOMATIC_OVERRIDE_PORTENTA_MACHINE_CONTROL at the same time"
230234
#endif

0 commit comments

Comments
 (0)