diff --git a/lib/pbio/include/pbio/iodev.h b/lib/pbio/include/pbio/iodev.h index f99eb6f75..466d2eaf9 100644 --- a/lib/pbio/include/pbio/iodev.h +++ b/lib/pbio/include/pbio/iodev.h @@ -254,10 +254,6 @@ typedef enum { * Information about one mode of an I/O device. */ typedef struct { - /** - * Mode flags. - */ - lump_mode_flags_t flags; /** * The number of data values for this mode. */ diff --git a/lib/pbio/src/uartdev.c b/lib/pbio/src/uartdev.c index 12eed2c8c..b5cc8c13f 100644 --- a/lib/pbio/src/uartdev.c +++ b/lib/pbio/src/uartdev.c @@ -272,29 +272,6 @@ static uint8_t ev3_uart_get_msg_size(uint8_t header) { return size; } -static void pbio_uartdev_set_mode_flags(pbio_iodev_type_id_t type_id, uint8_t mode, lump_mode_flags_t *flags) { - memset(flags, 0, sizeof(*flags)); - - switch (type_id) { - case PBIO_IODEV_TYPE_ID_INTERACTIVE_MOTOR: - switch (mode) { - case 0: // POWER - flags->flags0 = LUMP_MODE_FLAGS0_MOTOR_POWER | LUMP_MODE_FLAGS0_MOTOR; - break; - case 1: // SPEED - flags->flags0 = LUMP_MODE_FLAGS0_MOTOR_SPEED | LUMP_MODE_FLAGS0_MOTOR; - break; - case 2: // POS - flags->flags0 = LUMP_MODE_FLAGS0_MOTOR_REL_POS | LUMP_MODE_FLAGS0_MOTOR; - break; - } - flags->flags4 = LUMP_MODE_FLAGS4_USES_HBRIDGE; - flags->flags5 = LUMP_MODE_FLAGS5_UNKNOWN_BIT1; // TODO: figure out what this flag means - break; - default: - break; - } -} static void pbio_uartdev_parse_msg(uartdev_port_data_t *data) { uint32_t speed; @@ -461,35 +438,40 @@ static void pbio_uartdev_parse_msg(uartdev_port_data_t *data) { data->new_mode = mode; data->info_flags |= EV3_UART_INFO_FLAG_INFO_NAME; - lump_mode_flags_t *flags = &data->info->mode_info[mode].flags; + // newer LEGO UART devices send additional 6 mode capability flags + uint8_t flags = 0; if (name_len <= LUMP_MAX_SHORT_NAME_SIZE && msg_size > LUMP_MAX_NAME_SIZE) { - // newer LPF2 devices send additional mode flags along with the name - memcpy(flags, data->rx_msg + 8, 6); + // Only the first is used in practice. + flags = data->rx_msg[8]; } else { - // otherwise look up flags - pbio_uartdev_set_mode_flags(data->type_id, mode, flags); + // for newer devices that don't send it, set flags by device ID + // TODO: Look up from static info like we do for basic devices + if (data->type_id == PBIO_IODEV_TYPE_ID_INTERACTIVE_MOTOR) { + flags = LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_POWER | LUMP_MODE_FLAGS0_MOTOR_SPEED | LUMP_MODE_FLAGS0_MOTOR_REL_POS; + } } - if (flags->flags0 & LUMP_MODE_FLAGS0_MOTOR_POWER) { + // Although capabilities are sent per mode, we apply them to the whole device + if (flags & LUMP_MODE_FLAGS0_MOTOR_POWER) { data->info->capability_flags |= PBIO_IODEV_CAPABILITY_FLAG_IS_MOTOR; } - if (flags->flags0 & LUMP_MODE_FLAGS0_MOTOR_SPEED) { + if (flags & LUMP_MODE_FLAGS0_MOTOR_SPEED) { data->info->capability_flags |= PBIO_IODEV_CAPABILITY_FLAG_HAS_MOTOR_SPEED; } - if (flags->flags0 & LUMP_MODE_FLAGS0_MOTOR_REL_POS) { + if (flags & LUMP_MODE_FLAGS0_MOTOR_REL_POS) { data->info->capability_flags |= PBIO_IODEV_CAPABILITY_FLAG_HAS_MOTOR_REL_POS; } - if (flags->flags0 & LUMP_MODE_FLAGS0_MOTOR_ABS_POS) { + if (flags & LUMP_MODE_FLAGS0_MOTOR_ABS_POS) { data->info->capability_flags |= PBIO_IODEV_CAPABILITY_FLAG_HAS_MOTOR_ABS_POS; } - if (flags->flags0 & LUMP_MODE_FLAGS0_REQUIRES_POWER) { + if (flags & LUMP_MODE_FLAGS0_REQUIRES_POWER) { data->info->capability_flags |= PBIO_IODEV_CAPABILITY_FLAG_REQUIRES_POWER; } debug_pr("new_mode: %d\n", data->new_mode); debug_pr("flags: %02X %02X %02X %02X %02X %02X\n", - flags->flags0, flags->flags1, flags->flags2, - flags->flags3, flags->flags4, flags->flags5); + data->rx_msg[8 + 0], data->rx_msg[8 + 1], data->rx_msg[8 + 2], + data->rx_msg[8 + 3], data->rx_msg[8 + 4], data->rx_msg[8 + 5]); } break; // Ignore RAW, PCT, SI, UNITS info. This is never used and can diff --git a/lib/pbio/test/src/uartdev.c b/lib/pbio/test/src/uartdev.c index bba643b7d..3f9f8641b 100644 --- a/lib/pbio/test/src/uartdev.c +++ b/lib/pbio/test/src/uartdev.c @@ -360,102 +360,58 @@ static PT_THREAD(test_boost_color_distance_sensor(struct pt *pt)) { tt_want_uint_op(iodev->info->capability_flags, ==, PBIO_IODEV_CAPABILITY_FLAG_NONE); tt_want_uint_op(iodev->mode, ==, 0); - tt_want_uint_op(iodev->info->mode_info[0].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); - tt_want_uint_op(iodev->info->mode_info[0].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[0].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); - tt_want_uint_op(iodev->info->mode_info[0].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); tt_want_uint_op(iodev->info->mode_info[0].input_flags, ==, LPF2_MAPPING_FLAG_NULL | LPF2_MAPPING_FLAG_2_0 | LPF2_MAPPING_FLAG_DISCRETE); tt_want_uint_op(iodev->info->mode_info[0].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[0].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[0].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[1].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); - tt_want_uint_op(iodev->info->mode_info[1].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[1].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); - tt_want_uint_op(iodev->info->mode_info[1].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); tt_want_uint_op(iodev->info->mode_info[1].input_flags, ==, LPF2_MAPPING_FLAG_2_0 | LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[1].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[1].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[1].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[2].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); - tt_want_uint_op(iodev->info->mode_info[2].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[2].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); - tt_want_uint_op(iodev->info->mode_info[2].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); tt_want_uint_op(iodev->info->mode_info[2].input_flags, ==, LPF2_MAPPING_FLAG_RELATIVE); tt_want_uint_op(iodev->info->mode_info[2].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[2].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[2].data_type, ==, PBIO_IODEV_DATA_TYPE_INT32); - tt_want_uint_op(iodev->info->mode_info[3].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); - tt_want_uint_op(iodev->info->mode_info[3].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[3].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); - tt_want_uint_op(iodev->info->mode_info[3].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); tt_want_uint_op(iodev->info->mode_info[3].input_flags, ==, LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[3].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[3].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[3].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[4].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); - tt_want_uint_op(iodev->info->mode_info[4].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[4].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); - tt_want_uint_op(iodev->info->mode_info[4].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); tt_want_uint_op(iodev->info->mode_info[4].input_flags, ==, LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[4].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[4].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[4].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[5].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); - tt_want_uint_op(iodev->info->mode_info[5].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[5].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); - tt_want_uint_op(iodev->info->mode_info[5].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); tt_want_uint_op(iodev->info->mode_info[5].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[5].output_flags, ==, LPF2_MAPPING_FLAG_DISCRETE); tt_want_uint_op(iodev->info->mode_info[5].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[5].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[6].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); - tt_want_uint_op(iodev->info->mode_info[6].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[6].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); - tt_want_uint_op(iodev->info->mode_info[6].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); tt_want_uint_op(iodev->info->mode_info[6].input_flags, ==, LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[6].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[6].num_values, ==, 3); tt_want_uint_op(iodev->info->mode_info[6].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[7].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); - tt_want_uint_op(iodev->info->mode_info[7].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[7].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); - tt_want_uint_op(iodev->info->mode_info[7].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); tt_want_uint_op(iodev->info->mode_info[7].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[7].output_flags, ==, LPF2_MAPPING_FLAG_DISCRETE); tt_want_uint_op(iodev->info->mode_info[7].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[7].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[8].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); - tt_want_uint_op(iodev->info->mode_info[8].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[8].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); - tt_want_uint_op(iodev->info->mode_info[8].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); tt_want_uint_op(iodev->info->mode_info[8].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[8].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[8].num_values, ==, 4); tt_want_uint_op(iodev->info->mode_info[8].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[9].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); - tt_want_uint_op(iodev->info->mode_info[9].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[9].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); - tt_want_uint_op(iodev->info->mode_info[9].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); tt_want_uint_op(iodev->info->mode_info[9].input_flags, ==, LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[9].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[9].num_values, ==, 2); tt_want_uint_op(iodev->info->mode_info[9].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[10].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); - tt_want_uint_op(iodev->info->mode_info[10].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[10].flags.flags4, ==, LUMP_MODE_FLAGS4_NONE); - tt_want_uint_op(iodev->info->mode_info[10].flags.flags5, ==, LUMP_MODE_FLAGS5_NONE); tt_want_uint_op(iodev->info->mode_info[10].input_flags, ==, LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[10].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[10].num_values, ==, 8); @@ -675,41 +631,22 @@ static PT_THREAD(test_boost_interactive_motor(struct pt *pt)) { PBIO_IODEV_CAPABILITY_FLAG_HAS_MOTOR_SPEED | PBIO_IODEV_CAPABILITY_FLAG_HAS_MOTOR_REL_POS); tt_want_uint_op(iodev->mode, ==, 0); - tt_want_uint_op(iodev->info->mode_info[0].flags.flags0, ==, - LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_POWER); - tt_want_uint_op(iodev->info->mode_info[0].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[0].flags.flags4, ==, LUMP_MODE_FLAGS4_USES_HBRIDGE); - tt_want_uint_op(iodev->info->mode_info[0].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT1); tt_want_uint_op(iodev->info->mode_info[0].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[0].output_flags, ==, LPF2_MAPPING_FLAG_2_0 | LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[0].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[0].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[1].flags.flags0, ==, - LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_SPEED); - tt_want_uint_op(iodev->info->mode_info[1].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[1].flags.flags4, ==, LUMP_MODE_FLAGS4_USES_HBRIDGE); - tt_want_uint_op(iodev->info->mode_info[1].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT1); tt_want_uint_op(iodev->info->mode_info[1].input_flags, ==, LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[1].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[1].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[1].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[2].flags.flags0, ==, - LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_REL_POS); - tt_want_uint_op(iodev->info->mode_info[2].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[2].flags.flags4, ==, LUMP_MODE_FLAGS4_USES_HBRIDGE); - tt_want_uint_op(iodev->info->mode_info[2].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT1); tt_want_uint_op(iodev->info->mode_info[2].input_flags, ==, LPF2_MAPPING_FLAG_RELATIVE); tt_want_uint_op(iodev->info->mode_info[2].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[2].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[2].data_type, ==, PBIO_IODEV_DATA_TYPE_INT32); - tt_want_uint_op(iodev->info->mode_info[3].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); - tt_want_uint_op(iodev->info->mode_info[3].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[3].flags.flags4, ==, LUMP_MODE_FLAGS4_USES_HBRIDGE); - tt_want_uint_op(iodev->info->mode_info[3].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT1); tt_want_uint_op(iodev->info->mode_info[3].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[3].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[3].num_values, ==, 5); @@ -906,24 +843,12 @@ static PT_THREAD(test_technic_large_motor(struct pt *pt)) { | PBIO_IODEV_CAPABILITY_FLAG_HAS_MOTOR_REL_POS | PBIO_IODEV_CAPABILITY_FLAG_HAS_MOTOR_ABS_POS); tt_want_uint_op(iodev->mode, ==, 0); - tt_want_uint_op(iodev->info->mode_info[0].flags.flags0, ==, - LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_POWER); - tt_want_uint_op(iodev->info->mode_info[0].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[0].flags.flags4, ==, - LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); - tt_want_uint_op(iodev->info->mode_info[0].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); tt_want_uint_op(iodev->info->mode_info[0].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[0].output_flags, ==, LPF2_MAPPING_FLAG_2_0 | LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[0].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[0].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[1].flags.flags0, ==, - LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_SPEED); - tt_want_uint_op(iodev->info->mode_info[1].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[1].flags.flags4, ==, - LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); - tt_want_uint_op(iodev->info->mode_info[1].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); tt_want_uint_op(iodev->info->mode_info[1].input_flags, ==, LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[1].output_flags, ==, @@ -931,12 +856,6 @@ static PT_THREAD(test_technic_large_motor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[1].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[1].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[2].flags.flags0, ==, - LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_REL_POS); - tt_want_uint_op(iodev->info->mode_info[2].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[2].flags.flags4, ==, - LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); - tt_want_uint_op(iodev->info->mode_info[2].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); tt_want_uint_op(iodev->info->mode_info[2].input_flags, ==, LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_RELATIVE); tt_want_uint_op(iodev->info->mode_info[2].output_flags, ==, @@ -944,12 +863,6 @@ static PT_THREAD(test_technic_large_motor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[2].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[2].data_type, ==, PBIO_IODEV_DATA_TYPE_INT32); - tt_want_uint_op(iodev->info->mode_info[3].flags.flags0, ==, - LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_ABS_POS); - tt_want_uint_op(iodev->info->mode_info[3].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[3].flags.flags4, ==, - LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); - tt_want_uint_op(iodev->info->mode_info[3].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); tt_want_uint_op(iodev->info->mode_info[3].input_flags, ==, LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_ABSOLUTE | LPF2_MAPPING_FLAG_UNKNOWN_BIT1); tt_want_uint_op(iodev->info->mode_info[3].output_flags, ==, @@ -957,22 +870,11 @@ static PT_THREAD(test_technic_large_motor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[3].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[3].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[4].flags.flags0, ==, - LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_ABS_POS); - tt_want_uint_op(iodev->info->mode_info[4].flags.flags1, ==, LUMP_MODE_FLAGS1_CALIB); - tt_want_uint_op(iodev->info->mode_info[4].flags.flags4, ==, - LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); - tt_want_uint_op(iodev->info->mode_info[4].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); tt_want_uint_op(iodev->info->mode_info[4].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[4].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[4].num_values, ==, 2); tt_want_uint_op(iodev->info->mode_info[4].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[5].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); - tt_want_uint_op(iodev->info->mode_info[5].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[5].flags.flags4, ==, - LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); - tt_want_uint_op(iodev->info->mode_info[5].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); tt_want_uint_op(iodev->info->mode_info[5].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[5].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[5].num_values, ==, 14); @@ -1169,24 +1071,12 @@ static PT_THREAD(test_technic_xl_motor(struct pt *pt)) { | PBIO_IODEV_CAPABILITY_FLAG_HAS_MOTOR_REL_POS | PBIO_IODEV_CAPABILITY_FLAG_HAS_MOTOR_ABS_POS); tt_want_uint_op(iodev->mode, ==, 0); - tt_want_uint_op(iodev->info->mode_info[0].flags.flags0, ==, - LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_POWER); - tt_want_uint_op(iodev->info->mode_info[0].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[0].flags.flags4, ==, - LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); - tt_want_uint_op(iodev->info->mode_info[0].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); tt_want_uint_op(iodev->info->mode_info[0].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[0].output_flags, ==, LPF2_MAPPING_FLAG_2_0 | LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[0].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[0].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[1].flags.flags0, ==, - LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_SPEED); - tt_want_uint_op(iodev->info->mode_info[1].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[1].flags.flags4, ==, - LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); - tt_want_uint_op(iodev->info->mode_info[1].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); tt_want_uint_op(iodev->info->mode_info[1].input_flags, ==, LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_ABSOLUTE); tt_want_uint_op(iodev->info->mode_info[1].output_flags, ==, @@ -1194,12 +1084,6 @@ static PT_THREAD(test_technic_xl_motor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[1].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[1].data_type, ==, PBIO_IODEV_DATA_TYPE_INT8); - tt_want_uint_op(iodev->info->mode_info[2].flags.flags0, ==, - LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_REL_POS); - tt_want_uint_op(iodev->info->mode_info[2].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[2].flags.flags4, ==, - LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); - tt_want_uint_op(iodev->info->mode_info[2].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); tt_want_uint_op(iodev->info->mode_info[2].input_flags, ==, LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_RELATIVE); tt_want_uint_op(iodev->info->mode_info[2].output_flags, ==, @@ -1207,12 +1091,6 @@ static PT_THREAD(test_technic_xl_motor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[2].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[2].data_type, ==, PBIO_IODEV_DATA_TYPE_INT32); - tt_want_uint_op(iodev->info->mode_info[3].flags.flags0, ==, - LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_ABS_POS); - tt_want_uint_op(iodev->info->mode_info[3].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[3].flags.flags4, ==, - LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); - tt_want_uint_op(iodev->info->mode_info[3].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); tt_want_uint_op(iodev->info->mode_info[3].input_flags, ==, LPF2_MAPPING_FLAG_UNKNOWN_BIT5 | LPF2_MAPPING_FLAG_ABSOLUTE | LPF2_MAPPING_FLAG_UNKNOWN_BIT1); tt_want_uint_op(iodev->info->mode_info[3].output_flags, ==, @@ -1220,22 +1098,11 @@ static PT_THREAD(test_technic_xl_motor(struct pt *pt)) { tt_want_uint_op(iodev->info->mode_info[3].num_values, ==, 1); tt_want_uint_op(iodev->info->mode_info[3].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[4].flags.flags0, ==, - LUMP_MODE_FLAGS0_MOTOR | LUMP_MODE_FLAGS0_MOTOR_ABS_POS); - tt_want_uint_op(iodev->info->mode_info[4].flags.flags1, ==, LUMP_MODE_FLAGS1_CALIB); - tt_want_uint_op(iodev->info->mode_info[4].flags.flags4, ==, - LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); - tt_want_uint_op(iodev->info->mode_info[4].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); tt_want_uint_op(iodev->info->mode_info[4].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[4].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[4].num_values, ==, 2); tt_want_uint_op(iodev->info->mode_info[4].data_type, ==, PBIO_IODEV_DATA_TYPE_INT16); - tt_want_uint_op(iodev->info->mode_info[5].flags.flags0, ==, LUMP_MODE_FLAGS0_NONE); - tt_want_uint_op(iodev->info->mode_info[5].flags.flags1, ==, LUMP_MODE_FLAGS1_NONE); - tt_want_uint_op(iodev->info->mode_info[5].flags.flags4, ==, - LUMP_MODE_FLAGS4_UNKNOWN_BIT2 | LUMP_MODE_FLAGS4_USES_HBRIDGE); - tt_want_uint_op(iodev->info->mode_info[5].flags.flags5, ==, LUMP_MODE_FLAGS5_UNKNOWN_BIT2); tt_want_uint_op(iodev->info->mode_info[5].input_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[5].output_flags, ==, 0); tt_want_uint_op(iodev->info->mode_info[5].num_values, ==, 14);