Skip to content

Commit 56b8cf5

Browse files
committed
pbio/iodev: Drop num_view_modes.
This is not used anywhere, and it isn't very useful information, so we can delete it. It might tell us that some modes are not worth using, but not which ones.
1 parent f1a78f1 commit 56b8cf5

File tree

3 files changed

+0
-17
lines changed

3 files changed

+0
-17
lines changed

lib/pbio/include/pbio/iodev.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,6 @@ typedef struct {
286286
* The number of modes the device has. (Indicates size of *mode_info*).
287287
*/
288288
uint8_t num_modes;
289-
/**
290-
* The number of "view" modes the device has. This modes are show in the
291-
* port monitor. Other modes may or may not be useable depending on the
292-
* device (e.g. some are for factory calibration).
293-
*/
294-
uint8_t num_view_modes;
295289
/**
296290
* Bit flags indicating which combination of modes can be used at the same
297291
* time. Each bit cooresponds to the mode of the same number (0 to 15).

lib/pbio/src/uartdev.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -359,15 +359,9 @@ static void pbio_uartdev_parse_msg(uartdev_port_data_t *data) {
359359
// Powered Up devices can have an extended mode message that
360360
// includes modes > LUMP_MAX_MODE
361361
data->info->num_modes = data->rx_msg[3] + 1;
362-
data->info->num_view_modes = data->rx_msg[4] + 1;
363-
} else if (msg_size > 3) {
364-
data->info->num_view_modes = data->rx_msg[2] + 1;
365-
} else {
366-
data->info->num_view_modes = data->info->num_modes;
367362
}
368363

369364
debug_pr("num_modes: %d\n", data->info->num_modes);
370-
debug_pr("num_view_modes: %d\n", data->info->num_view_modes);
371365

372366
break;
373367
case LUMP_CMD_SPEED:
@@ -816,7 +810,6 @@ static PT_THREAD(pbio_uartdev_update(uartdev_port_data_t * data)) {
816810
// if all was good, we are ready to start receiving the mode info
817811

818812
data->info->num_modes = 1;
819-
data->info->num_view_modes = 1;
820813

821814
data->type_id = data->rx_msg[1];
822815
data->info_flags = EV3_UART_INFO_FLAG_CMD_TYPE;

lib/pbio/test/src/uartdev.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ static PT_THREAD(test_boost_color_distance_sensor(struct pt *pt)) {
354354
tt_uint_op(pbio_uartdev_get(0, &iodev), ==, PBIO_SUCCESS);
355355
tt_want_uint_op(iodev->info->type_id, ==, PBIO_IODEV_TYPE_ID_COLOR_DIST_SENSOR);
356356
tt_want_uint_op(iodev->info->num_modes, ==, 11);
357-
tt_want_uint_op(iodev->info->num_view_modes, ==, 8);
358357
// TODO: verify fw/hw versions
359358
tt_want_uint_op(iodev->info->mode_combos, ==, 1 << 6 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0);
360359
tt_want_uint_op(iodev->info->capability_flags, ==, PBIO_IODEV_CAPABILITY_FLAG_NONE);
@@ -600,7 +599,6 @@ static PT_THREAD(test_boost_interactive_motor(struct pt *pt)) {
600599
tt_uint_op(pbio_uartdev_get(0, &iodev), ==, PBIO_SUCCESS);
601600
tt_want_uint_op(iodev->info->type_id, ==, PBIO_IODEV_TYPE_ID_INTERACTIVE_MOTOR);
602601
tt_want_uint_op(iodev->info->num_modes, ==, 4);
603-
tt_want_uint_op(iodev->info->num_view_modes, ==, 3);
604602
// TODO: verify fw/hw versions
605603
tt_want_uint_op(iodev->info->mode_combos, ==, 1 << 2 | 1 << 1);
606604
tt_want_uint_op(iodev->info->capability_flags, ==, PBIO_IODEV_CAPABILITY_FLAG_IS_MOTOR |
@@ -803,7 +801,6 @@ static PT_THREAD(test_technic_large_motor(struct pt *pt)) {
803801
tt_uint_op(pbio_uartdev_get(0, &iodev), ==, PBIO_SUCCESS);
804802
tt_want_uint_op(iodev->info->type_id, ==, PBIO_IODEV_TYPE_ID_TECHNIC_L_MOTOR);
805803
tt_want_uint_op(iodev->info->num_modes, ==, 6);
806-
tt_want_uint_op(iodev->info->num_view_modes, ==, 4);
807804
// TODO: verify fw/hw versions
808805
tt_want_uint_op(iodev->info->mode_combos, ==, 1 << 3 | 1 << 2 | 1 << 1);
809806
tt_want_uint_op(iodev->info->capability_flags, ==, PBIO_IODEV_CAPABILITY_FLAG_IS_MOTOR | PBIO_IODEV_CAPABILITY_FLAG_HAS_MOTOR_SPEED
@@ -1012,7 +1009,6 @@ static PT_THREAD(test_technic_xl_motor(struct pt *pt)) {
10121009
tt_uint_op(pbio_uartdev_get(0, &iodev), ==, PBIO_SUCCESS);
10131010
tt_want_uint_op(iodev->info->type_id, ==, PBIO_IODEV_TYPE_ID_TECHNIC_XL_MOTOR);
10141011
tt_want_uint_op(iodev->info->num_modes, ==, 6);
1015-
tt_want_uint_op(iodev->info->num_view_modes, ==, 4);
10161012
// TODO: verify fw/hw versions
10171013
tt_want_uint_op(iodev->info->mode_combos, ==, 1 << 3 | 1 << 2 | 1 << 1);
10181014
tt_want_uint_op(iodev->info->capability_flags, ==, PBIO_IODEV_CAPABILITY_FLAG_IS_MOTOR | PBIO_IODEV_CAPABILITY_FLAG_HAS_MOTOR_SPEED

0 commit comments

Comments
 (0)