This commit is contained in:
hamza
2024-07-08 14:44:01 +03:00
parent 39f124efc6
commit 17e8cee0ac
7 changed files with 36 additions and 20 deletions

View File

@ -67,10 +67,10 @@ void can_handle_send_status() {
data[0] = ((state.current_state << 4) | (powerground_status >> 4)); // 1 bit emptyy | 3 bit state | 4 bit powerground
data[1] = ((powerground_status << 4) | (state.error_source >> 4)); // 4 bit powerground | 4 bit error
data[2] = ((state.error_source << 4) | (0)); // 4 bit error | 4 bit state of charge
data[3] = ((0) + (RELAY_BAT_SIDE_VOLTAGE >> 12)); // 4 bit state of charge | 4 bit battery voltage
data[4] = ((RELAY_BAT_SIDE_VOLTAGE >> 4));
data[3] = ((RELAY_BAT_SIDE_VOLTAGE >> 8)); // 4 bit state of charge | 4 bit battery voltage
data[4] = ((RELAY_BAT_SIDE_VOLTAGE >> 0));
data[5] = ((CURRENT_MEASUREMENT >> 8));
data[6] = ((CURRENT_MEASUREMENT & 0x00F0) | (highest_temp >> 12));
data[6] = ((CURRENT_MEASUREMENT & 0x000F) | (highest_temp >> 12));
data[7] = ((highest_temp) >> 4);
//data[7] = state.error_source;
ftcan_transmit(CAN_ID_OUT, data, sizeof(data));
@ -110,6 +110,14 @@ void can_handle_send_status() {
data[7] = 0;
ftcan_transmit(CAN_ID_OUT, data, sizeof(data));
021E 30
0232 50
0238 60
0246 70
0250 80
025A 90
0264 100
*/
}