From 7c03a67f17e9d1b98765159760f27565f0a84c70 Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Sat, 12 Dec 2020 14:18:42 +0100 Subject: [PATCH] pbio/ioport: populate port field 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. --- lib/pbio/drv/ioport/ioport_lpf2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pbio/drv/ioport/ioport_lpf2.c b/lib/pbio/drv/ioport/ioport_lpf2.c index 1fb07c2f7..d9b2cc893 100644 --- a/lib/pbio/drv/ioport/ioport_lpf2.c +++ b/lib/pbio/drv/ioport/ioport_lpf2.c @@ -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 {