redid the sensor reading code for the bbb+cape
diff --git a/bbb_cape/src/cape/data_struct.h b/bbb_cape/src/cape/data_struct.h
index 31a909f..9e5ee6c 100644
--- a/bbb_cape/src/cape/data_struct.h
+++ b/bbb_cape/src/cape/data_struct.h
@@ -9,7 +9,8 @@
#pragma pack(push, 1)
// Be careful with declaration order in here. ARM doesn't like unaligned
-// accesses!
+// accesses and this structure is packed, so messing the order up will cause the
+// compiler to generate very inefficient code to access fields.
struct DATA_STRUCT_NAME {
int64_t gyro_angle;
@@ -56,6 +57,48 @@
int32_t posedge_value, negedge_value;
uint8_t posedge_count, negedge_count;
} test;
+
+ // This is for the comp and practice robots.
+ struct {
+ int32_t left_drive;
+ int32_t right_drive;
+ int32_t shooter_angle;
+ int32_t shooter;
+ int32_t indexer;
+ int32_t wrist;
+
+ int32_t capture_top_rise;
+ int32_t capture_top_fall;
+ int32_t capture_bottom_fall_delay;
+ 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;
+
+ int8_t bottom_rise_count;
+
+ int8_t bottom_fall_delay_count;
+ int8_t bottom_fall_count;
+
+ 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;
};
} __attribute__((aligned(8)));
#pragma pack(pop)