added analog sensors and cleaned up the sensor data structure a bit
diff --git a/gyro_board/src/usb/data_struct.h b/gyro_board/src/usb/data_struct.h
index 6c99195..8c069b9 100644
--- a/gyro_board/src/usb/data_struct.h
+++ b/gyro_board/src/usb/data_struct.h
@@ -17,9 +17,15 @@
// Which robot (+version) the gyro board is sending out data for.
// We should keep this in the same place for all gyro board software
// versions so that the fitpc can detect when it's reading from a gyro
- // board set up for a different robot than it is.
- // 0 = 2013 competition/practice robot
- // 1 = 2013 3rd robot
+ // board set up for a different robot (or version) than it is.
+ // The numbers listed below each robot are the values that have been used
+ // for it.
+ //
+ // 2013 competition/practice robot
+ // 0
+ // 2 added battery measurement + drivetrain analog hall effects
+ // 2013 3rd robot
+ // 1
uint8_t robot_id;
// This information should also be kept in the same place from year to
// year so that the fitpc code can record the dip switch values when it
@@ -39,26 +45,17 @@
uint8_t base_status;
};
};
- uint16_t header;
+ uint32_t header;
};
- // This is a counter that gets incremented with each packet sent (and wraps
- // around when it reaches 255).
- uint8_t sequence;
+ // This is a counter that gets incremented with each packet sent.
+ uint32_t sequence;
+
+ // We are 64-bit aligned at this point if it matters for anything other than
+ // the gyro angle.
union {
struct {
- union {
- struct {
- uint8_t wrist_hall_effect : 1;
- uint8_t angle_adjust_bottom_hall_effect : 1;
- uint8_t top_disc : 1;
- uint8_t bottom_disc : 1;
- uint8_t loader_top : 1;
- uint8_t loader_bottom : 1;
- };
- uint16_t booleans;
- };
int32_t left_drive;
int32_t right_drive;
int32_t shooter_angle;
@@ -72,6 +69,10 @@
int32_t capture_wrist_rise;
int32_t capture_shooter_angle_rise;
+ uint16_t battery_voltage;
+ uint16_t left_drive_hall;
+ uint16_t right_drive_hall;
+
int8_t top_rise_count;
int8_t top_fall_count;
@@ -84,6 +85,15 @@
int8_t wrist_rise_count;
int8_t shooter_angle_rise_count;
+
+ struct {
+ uint8_t wrist_hall_effect : 1;
+ uint8_t angle_adjust_bottom_hall_effect : 1;
+ uint8_t top_disc : 1;
+ uint8_t bottom_disc : 1;
+ uint8_t loader_top : 1;
+ uint8_t loader_bottom : 1;
+ };
} main;
struct {