lib/ev3dev/lego_port: read mode, not status
This is required for UART, I2C and RAW, which do not provide a status.
@@ -137,11 +137,11 @@ pbio_error_t ev3dev_lego_port_configure(pbio_port_t port, pbio_iodev_type_id_t i
}
// If special modes have been set previously and they're still good, we're done.
- if ((id == PBIO_IODEV_TYPE_ID_NXT_COLOR_SENSOR && status_now == RAW ) ||
+ if ((id == PBIO_IODEV_TYPE_ID_NXT_COLOR_SENSOR && mode_now == RAW ) ||
(id == PBIO_IODEV_TYPE_ID_NXT_ANALOG && status_now == NXT_ANALOG) ||
(id == PBIO_IODEV_TYPE_ID_NXT_TOUCH_SENSOR && status_now == NXT_ANALOG) ||
- (id == PBIO_IODEV_TYPE_ID_CUSTOM_I2C && status_now == OTHER_I2C ) ||
- (id == PBIO_IODEV_TYPE_ID_CUSTOM_UART && status_now == OTHER_UART) ||
+ (id == PBIO_IODEV_TYPE_ID_CUSTOM_I2C && mode_now == OTHER_I2C ) ||
+ (id == PBIO_IODEV_TYPE_ID_CUSTOM_UART && mode_now == OTHER_UART) ||
(id == PBIO_IODEV_TYPE_ID_LUMP_UART && status_now == EV3_UART) ||
(id == PBIO_IODEV_TYPE_ID_EV3DEV_DC_MOTOR && status_now == DC_MOTOR)
){
