Skip to content

Commit 736deea

Browse files
authored
Merge pull request #21 from alrvid/main
Fix bug that breaks RS485 on the Opta
2 parents ec461e0 + d955b69 commit 736deea

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)