Skip to content

Commit

Permalink
Fix issue with checking if already in host mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rechrtb committed Jul 17, 2024
1 parent c19ed1a commit 603e63d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TinyUsbInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ bool CoreUsbSetHostMode(bool hostMode, const StringRef& reply)
return false;
}

if (hostMode && digitalRead(UsbVbusDetect))
if (!CoreUsbIsHostMode() && digitalRead(UsbVbusDetect))
{
reply.printf("Unable to change to host mode, board plugged in to computer\n");
return false;
Expand Down

0 comments on commit 603e63d

Please sign in to comment.