Skip to content

Commit

Permalink
pbdrv/ioport_lpf2: Return EAGAIN during sync.
Browse files Browse the repository at this point in the history
This allows higher level code to call this again as neeeded.

pybricks/support#361
  • Loading branch information
laurensvalk committed Jun 4, 2021
1 parent 38b4903 commit f910978
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/pbio/drv/ioport/ioport_lpf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@ pbio_error_t pbdrv_ioport_get_iodev(pbio_port_t port, pbio_iodev_t **iodev) {
return PBIO_ERROR_NO_DEV;
}

// If there is an iodev but we don't know which one yet, it is syncing
if ((*iodev)->info->type_id == PBIO_IODEV_TYPE_ID_NONE) {
return PBIO_ERROR_AGAIN;
}

return PBIO_SUCCESS;
}

Expand Down

0 comments on commit f910978

Please sign in to comment.