Skip to content

Commit 7ee0908

Browse files
committed
pbio/port: Fix none-mode not being set.
All ports should support "no mode". This was causing the Color Light Matrix sometimes not turning off properly.
1 parent 2dbed3c commit 7ee0908

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/pbio/src/port.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ pbio_error_t pbio_port_set_mode(pbio_port_t *port, pbio_port_mode_t mode) {
495495
}
496496

497497
// Check if the mode is supported by the port.
498-
if (!(port->pdata->supported_modes & mode)) {
498+
if (mode && !(port->pdata->supported_modes & mode)) {
499499
return PBIO_ERROR_NOT_SUPPORTED;
500500
}
501501

0 commit comments

Comments
 (0)