Skip to content

Commit

Permalink
pbio/ioport: populate port field
Browse files Browse the repository at this point in the history
This was never initialized. Since pbdrv/motor still uses the legacy pattern with a port argument, we need this to turn sensor power on and off.

We may be able to drop the port attribute once we reorganize ioports more generally. See also #27.
  • Loading branch information
laurensvalk committed Dec 23, 2020
1 parent 6307fd7 commit 7c03a67
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/pbio/drv/ioport/ioport_lpf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ PROCESS_THREAD(pbdrv_ioport_lpf2_process, ev, data) {
if (ioport->connected_type_id == PBIO_IODEV_TYPE_ID_LPF2_UNKNOWN_UART) {
ioport_enable_uart(ioport);
pbio_uartdev_get(i, &ioport->iodev);
ioport->iodev->port = i + PBDRV_CONFIG_FIRST_IO_PORT;
} else if (ioport->connected_type_id == PBIO_IODEV_TYPE_ID_NONE) {
ioport->iodev = NULL;
} else {
Expand Down

0 comments on commit 7c03a67

Please sign in to comment.