Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
dfcf7c5
Delete Common/Inc/.placeholder
mahir-mahota Mar 18, 2024
b2e4826
Delete Common/Src/.placeholder
mahir-mahota Mar 18, 2024
c74f50d
Implemented seperate peripheral files on sensors board
mahir-mahota Mar 28, 2024
89ec7a4
ryder take a look
CloseZad Mar 29, 2024
5e2a8a0
added gyro
CloseZad Mar 29, 2024
f87381f
t
CloseZad Apr 3, 2024
e970751
rename
CloseZad Apr 14, 2024
8736a86
Updated IMU frame
mahir-mahota Apr 27, 2024
f55c064
Update .gitignore
mahir-mahota Apr 14, 2024
1034079
Fixing minor bugs
mahir-mahota Apr 14, 2024
c3d0ccd
Added IMU message to config
mahir-mahota Apr 27, 2024
0a58d40
Added Z Gyro
mahir-mahota Apr 30, 2024
5d0d255
Update config.h
mahir-mahota Apr 27, 2024
238f504
Update config.h
mahir-mahota Apr 27, 2024
fb4f20a
Update config.h
mahir-mahota Apr 30, 2024
60aae2b
Update config.h
mahir-mahota Apr 30, 2024
4e9779a
Successful pre test build
mahir-mahota Apr 30, 2024
f751750
Fixing variables and adding default cases
mahir-mahota May 1, 2024
ea1cd7b
Update mpu6050.c
mahir-mahota May 1, 2024
f5073ce
removed unnecessary includes
mahir-mahota May 2, 2024
07d64ec
Update config.h
mahir-mahota Apr 30, 2024
0b99a30
Added log file
mahir-mahota May 2, 2024
6bf9c82
Added logging driver
mahir-mahota May 2, 2024
75b90a5
Revert "Added logging driver"
mahir-mahota May 2, 2024
d7b496e
removed log :/
mahir-mahota May 2, 2024
31c87ac
increased acceleration resolution
mahir-mahota May 3, 2024
42dedf1
updates from test branch
mahir-mahota May 3, 2024
93ed063
Fixed gyroscope logic
mahir-mahota May 3, 2024
a868e13
Update config.h
mahir-mahota May 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<<<<<<< HEAD
build
bin
temp
Expand All @@ -7,9 +6,6 @@ temp
.vscode/
.idea/
.cache

.settings
.metadata
=======
.vscode
>>>>>>> edc909e (Minor fixes)
1 change: 0 additions & 1 deletion Common/Inc/.placeholder

This file was deleted.

69 changes: 40 additions & 29 deletions Common/Inc/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,63 @@
#define WARN_OFFSET 0xFF

// MOTOR CONTROLLER
#define MOTOR_CONTROLLER_1 0x10F8109A
#define MOTOR_CONTROLLER_2 0x10F8108D
#define MOTOR_CONTROLLER_K1 0x10F8109A
#define MOTOR_CONTROLLER_K2 0x10F8108D
#define MOTOR_CONTROLLER 0xFF
#define MOTOR_CONTROLLER_WARN MOTOR_CONTROLLER - WARN_OFFSET

// BMS
#define BMS_BOARD 0xFF
#define BMS_BOARD_WARN BMS_TEMP - WARN_OFFSET

// SENSORS
#define SENSOR_BOARD 0xFF
#define SENSOR_BOARD_WARN SENSOR_BOARD - WARN_OFFSET
#define SENSOR_BOARD_1 0xFF
#define SENSOR_BOARD_1_WARN SENSOR_BOARD_1 - WARN_OFFSET
#define SENSOR_BOARD_2 0xFF
#define SENSOR_BOARD_2_WARN SENSOR_BOARD_2 - WARN_OFFSET

// BEGIN KELLY DEFS
// FRAME 1
const DataSegment DRIVING_DIRECTION_K = {MOTOR_CONTROLLER_1, 1, 1};
const DataSegment MOTOR_SPEED_K = {MOTOR_CONTROLLER_1, 2, 3};
const DataSegment MOTOR_ERROR_CODE_K = {MOTOR_CONTROLLER_1, 4, 4};
const Data_Segment_t DRIVING_DIRECTION_K = {MOTOR_CONTROLLER_1, 1, 1};
const Data_Segment_t MOTOR_SPEED_K = {MOTOR_CONTROLLER_1, 2, 3};
const Data_Segment_t MOTOR_ERROR_CODE_K = {MOTOR_CONTROLLER_1, 4, 4};
// FRAME 2
const DataSegment BATTERY_VOLTAGE_K = {MOTOR_CONTROLLER_2, 1, 2};
const DataSegment BATTERY_CURRENT_K = {MOTOR_CONTROLLER_2, 3, 4};
const DataSegment MOTOR_TEMP_K = {MOTOR_CONTROLLER_2, 5, 6};
const DataSegment MOTOR_CONTROLLER_TEMP_K = {MOTOR_CONTROLLER_2, 7, 8};
const Data_Segment_t BATTERY_VOLTAGE_K = {MOTOR_CONTROLLER_K2, 1, 2};
const Data_Segment_t BATTERY_CURRENT_K = {MOTOR_CONTROLLER_K2, 3, 4};
const Data_Segment_t MOTOR_TEMP_K = {MOTOR_CONTROLLER_K2, 5, 6};
const Data_Segment_t MOTOR_CONTROLLER_TEMP_K = {MOTOR_CONTROLLER_K2, 7, 8};
// END KELLY DEFS

// BEGIN MOTOR CONTROLLER DEFS
const DataSegment BATTERY_VOLTAGE = {MOTOR_CONTROLLER, 1, 2};
const DataSegment BATTERY_CURRENT = {MOTOR_CONTROLLER, 3, 4};
const DataSegment MOTOR_SPEED = {MOTOR_CONTROLLER, 5, 6};
const DataSegment MOTOR_CONTROLLER_TEMP = {MOTOR_CONTROLLER, 7, 7};
const DataSegment DRIVING_DIRECTION = {MOTOR_CONTROLLER, 8, 8};
const DataSegment MOTOR_ERROR_CODE = {MOTOR_CONTROLLER, 8, 8};
const Data_Segment_t BATTERY_VOLTAGE = {MOTOR_CONTROLLER, 1, 2};
const Data_Segment_t BATTERY_CURRENT = {MOTOR_CONTROLLER, 3, 4};
const Data_Segment_t MOTOR_SPEED = {MOTOR_CONTROLLER, 5, 6};
const Data_Segment_t MOTOR_CONTROLLER_TEMP = {MOTOR_CONTROLLER, 7, 7};
const Data_Segment_t DRIVING_DIRECTION = {MOTOR_CONTROLLER, 8, 8};
const Data_Segment_t MOTOR_ERROR_CODE = {MOTOR_CONTROLLER, 8, 8};
// END MOTOR CONTROLLER DEFS

// BEGIN BMS DEFS
const DataSegment MUX1_TEMP = {BMS_BOARD, 1, 1};
const DataSegment MUX2_TEMP = {BMS_BOARD, 2, 2};
const DataSegment MUX3_TEMP = {BMS_BOARD, 3, 3};
const DataSegment MUX4_TEMP = {BMS_BOARD, 4, 4};
const DataSegment MUX5_TEMP = {BMS_BOARD, 5, 5};
const DataSegment MUX6_TEMP = {BMS_BOARD, 6, 6};
const DataSegment BMS_ERROR_CODE = {BMS_BOARD, 7, 7};
const Data_Segment_t MUX1_TEMP = {BMS_BOARD, 1, 1};
const Data_Segment_t MUX2_TEMP = {BMS_BOARD, 2, 2};
const Data_Segment_t MUX3_TEMP = {BMS_BOARD, 3, 3};
const Data_Segment_t MUX4_TEMP = {BMS_BOARD, 4, 4};
const Data_Segment_t MUX5_TEMP = {BMS_BOARD, 5, 5};
const Data_Segment_t MUX6_TEMP = {BMS_BOARD, 6, 6};
const Data_Segment_t BMS_ERROR_CODE = {BMS_BOARD, 8, 8};
// END BMS DEFS

// BEGIN SENSORS BOARD DEFS
const DataSegment PRESSURE_SENSOR_DATA = {SENSOR_BOARD, 1, 1};
const DataSegment IMU_DATA = {SENSOR_BOARD, 2, 3};
const DataSegment LIM_ONE_TEMP = {SENSOR_BOARD, 4, 5};
const DataSegment LIM_TWO_TEMP = {SENSOR_BOARD, 6, 7};
const DataSegment SENSORS_ERROR_CODE = {SENSOR_BOARD, 8, 8};
//FIRST FRAME
const Data_Segment_t PRESSURE = {SENSOR_BOARD_1, 1, 2};
const Data_Segment_t LIM_ONE_TEMP = {SENSOR_BOARD_1, 3, 4};
const Data_Segment_t LIM_TWO_TEMP = {SENSOR_BOARD_1, 5, 6};
const Data_Segment_t SENSORS_ERROR_CODE_1 = {SENSOR_BOARD_1, 8, 8};
//SECOND (IMU) FRAME
const Data_Segment_t X_ACCEL = {SENSOR_BOARD_2, 1, 2};
const Data_Segment_t Y_ACCEL = {SENSOR_BOARD_2, 3, 4};
const Data_Segment_t X_GYRO = {SENSOR_BOARD_2, 5, 5};
const Data_Segment_t Y_GYRO = {SENSOR_BOARD_2, 6, 6};
const Data_Segment_t Z_GYRO = {SENSOR_BOARD_2, 7, 7};
const Data_Segment_t SENSORS_ERROR_CODE_2 = {SENSOR_BOARD_2, 8, 8};
// END SENSORS BOARD DEFS
1 change: 0 additions & 1 deletion Common/Src/.placeholder

This file was deleted.

3 changes: 3 additions & 0 deletions Common/Src/can_driver.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "can_driver.h"

#define WARN_OFFSET 0xFF

static uint32_t tx_mailbox;
#define WARN_OFFSET 0xFF

CAN_Frame_t CAN_frame_init(CAN_HandleTypeDef* handler, uint32_t id) {
// default conditions
Expand Down
1 change: 1 addition & 0 deletions Sensors/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,5 @@
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="refreshScope"/>
</cproject>
Loading