finished getting all of the usb stuff working nicely(ish)
diff --git a/frc971/input/gyro_board_data.h b/frc971/input/gyro_board_data.h
index 0a8272a..a1b8712 100644
--- a/frc971/input/gyro_board_data.h
+++ b/frc971/input/gyro_board_data.h
@@ -46,6 +46,8 @@
};
void NetworkToHost() {
+ // Apparently it sends the information out in little endian.
+#if 0
using ::aos::ntoh;
gyro_angle = ntoh(gyro_angle);
@@ -64,6 +66,7 @@
capture_shooter_angle_rise = ntoh(capture_shooter_angle_rise);
digitals = ntoh(digitals);
+#endif
}
} __attribute__((__packed__));
diff --git a/frc971/input/gyro_board_reader.cc b/frc971/input/gyro_board_reader.cc
index dab6130..4628c78 100644
--- a/frc971/input/gyro_board_reader.cc
+++ b/frc971/input/gyro_board_reader.cc
@@ -105,9 +105,9 @@
LOG(FATAL, "libusb gave error %d\n", r);
}
- if (read_bytes != sizeof(data)) {
- LOG(ERROR, "read %d bytes instead of %zu\n",
- read_bytes, sizeof(data));
+ if (read_bytes < static_cast<ssize_t>(sizeof(*real_data))) {
+ LOG(ERROR, "read %d bytes instead of at least %zd\n",
+ read_bytes, sizeof(*real_data));
continue;
}