From ef65c01a40595cc5ed7c5b370d61656b29a8fda0 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sun, 14 Mar 2021 17:40:33 -0400 Subject: [PATCH] VAG MQB --- firmware/controllers/can/can_dash.cpp | 17 +++++++++++++++++ firmware/controllers/can/can_dash.h | 3 ++- firmware/controllers/can/can_tx.cpp | 3 +++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/firmware/controllers/can/can_dash.cpp b/firmware/controllers/can/can_dash.cpp index ea3b9d861c..9a898df9d2 100644 --- a/firmware/controllers/can/can_dash.cpp +++ b/firmware/controllers/can/can_dash.cpp @@ -236,6 +236,23 @@ void canDashboardW202(void) { } } +/** + * https://docs.google.com/spreadsheets/d/1XMfeGlhgl0lBL54lNtPdmmFd8gLr2T_YTriokb30kJg + */ +void canDashboardVagMqb() { + + { // 'turn-on' + CanTxMessage msg(0x3C0, 4); + // ignition ON + msg[2] = 3; + } + { //RPM + CanTxMessage msg(0x107, 8); + msg[3] = ((int)(GET_RPM() / 3.5)) & 0xFF; + msg[4] = ((int)(GET_RPM() / 3.5)) >> 8; + } +} + void canDashboardBMWE90() { if (e90msgcounter == UINT16_MAX) diff --git a/firmware/controllers/can/can_dash.h b/firmware/controllers/can/can_dash.h index 633a3e5bac..edb1f581f4 100644 --- a/firmware/controllers/can/can_dash.h +++ b/firmware/controllers/can/can_dash.h @@ -12,4 +12,5 @@ void canDashboardFiat(); void canDashboardVAG(); void canMazdaRX8(); void canDashboardW202(); -void canDashboardBMWE90(); \ No newline at end of file +void canDashboardBMWE90(); +void canDashboardVagMqb(); diff --git a/firmware/controllers/can/can_tx.cpp b/firmware/controllers/can/can_tx.cpp index 0ca47e6491..b08004797e 100644 --- a/firmware/controllers/can/can_tx.cpp +++ b/firmware/controllers/can/can_tx.cpp @@ -61,6 +61,9 @@ void CanWrite::PeriodicTask(efitime_t nowNt) { case CAN_BUS_BMW_E90: canDashboardBMWE90(); break; + case CAN_BUS_MQB: + canDashboardVagMqb(); + break; default: break; }