added DRS control

This commit is contained in:
Tim-Erik Düntzsch 2022-03-17 00:51:16 +01:00
parent 1a72d6aa0f
commit 28b4e15ed2
2 changed files with 3 additions and 1 deletions

View File

@ -88,6 +88,7 @@ typedef struct {
uint8_t t_trr; // Tire temp rear right
uint8_t u_batt; // Batteriespannung
uint8_t rev_lim; // Drehzahllimit Bit
bool drs_active; // DRS status from BCU
uint8_t p_wat;
uint8_t p_fuel;
uint8_t p_oil;

View File

@ -71,6 +71,7 @@ void Receive_Can_0(CAN_FRAME *temp_message) {
case CAN_ID_BCU_APS_BRAKE: {
Vehicle_data.p_brake_front = temp_message->data.byte[1];
Vehicle_data.p_brake_rear = temp_message->data.byte[2];
Vehicle_data.drs_active = ((temp_message->data.byte[0] >> 7) & 0b00000001);
break;
}
case CAN_ID_BCU_ETC: { // eDrossel error bit
@ -154,7 +155,7 @@ void update_LED() {
((Vehicle_data.t_mot - 40) >= 0x69) and
((Vehicle_data.t_mot - 40) != 0xC8); // 105°C temp.water und !=200
bool g_auto = Vehicle_data.g_auto;
bool g_auto = Vehicle_data.drs_active;
bool u_batt = Vehicle_data.u_batt <= 0xA9; // 11.95V batt.spann.
bool e_dros = Vehicle_data.e_thro; // error-bit