From e1805f65ee75fab4454c21eda8b42b49d4bdc48f Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Mon, 9 Jan 2023 18:59:07 +0100 Subject: [PATCH] fix multiple definition of `fault_status` (#12) --- board/defines.h | 4 ++-- board/drivers/angle_sensor.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/board/defines.h b/board/defines.h index 8e5598b..bc7459a 100644 --- a/board/defines.h +++ b/board/defines.h @@ -178,11 +178,11 @@ typedef struct { } board_t; -struct { +typedef struct { uint8_t left_i2c : 1; uint8_t left_angle : 1; uint8_t right_i2c : 1; uint8_t right_angle : 1; -} fault_status; +} fault_status_t; #endif // DEFINES_H diff --git a/board/drivers/angle_sensor.h b/board/drivers/angle_sensor.h index e00cfba..72f0a85 100644 --- a/board/drivers/angle_sensor.h +++ b/board/drivers/angle_sensor.h @@ -19,6 +19,7 @@ extern I2C_HandleTypeDef hi2c1; const uint8_t init_imu_regaddr[] = {0x76, 0x4c, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53}; const uint8_t init_imu_data[] = {0x00, 0x12, 0x2f, 0x26, 0x67, 0x04, 0x00, 0x00}; +fault_status_t fault_status = {0}; void angle_sensor_read(uint16_t *sensor_angle) {