rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions | Variables
can_dash.cpp File Reference

Detailed Description

This file handles transmission of ECU data to various OE dashboards.

Date
Mar 19, 2020
Author
Matthew Kennedy, (c) 2020

Definition in file can_dash.cpp.

Functions

void canDashboardFiat (CanCycle cycle)
 
void canMazdaRX8 (CanCycle cycle)
 
void canDashboardW202 (CanCycle cycle)
 
void canDashboardVagMqb (CanCycle cycle)
 
void canDashboardGenesisCoupe (CanCycle cycle)
 
void canDashboardAim (CanCycle cycle)
 
static void canDashboardBmwE46 (CanCycle cycle)
 
void canDashboardVAG (CanCycle cycle)
 
static void canDashboardBmwE90 (CanCycle cycle)
 
static void populateFrame (Aim5f0 &msg)
 
static void populateFrame (Aim5f1 &msg)
 
static void populateFrame (Aim5f2 &msg)
 
static void populateFrame (Aim5f3 &msg)
 
static void populateFrame (Aim5f4 &msg)
 
static void populateFrame (Aim5f5 &msg)
 
static void populateFrame (Aim5f6 &msg)
 
static void populateFrame (Aim5f7 &msg)
 
PUBLIC_API_WEAK void boardUpdateDash (CanCycle cycle)
 
void updateDash (CanCycle cycle)
 

Variables

static time_msecs_t mph_timer
 
static time_msecs_t mph_ctr
 
static uint8_t rpmcounter
 
static uint8_t seatbeltcnt
 
static uint8_t abscounter = 0xF0
 
static uint8_t brakecnt_1 = 0xF0
 
static uint8_t brakecnt_2 = 0xF0
 
static uint8_t mph_a
 
static uint8_t mph_2a
 
static uint8_t mph_last
 
static uint8_t tmp_cnt
 
static uint8_t gear_cnt
 
static uint16_t mph_counter = 0xF000
 
static bool cluster_time_set
 
constexpr uint8_t e90_temp_offset = 49
 
std::optional< board_can_update_dash_typecustom_board_update_dash
 

Function Documentation

◆ boardUpdateDash()

PUBLIC_API_WEAK void boardUpdateDash ( CanCycle  cycle)

Definition at line 614 of file can_dash.cpp.

614{ UNUSED(cycle); }
UNUSED(samplingTimeSeconds)

Referenced by updateDash().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ canDashboardAim()

void canDashboardAim ( CanCycle  cycle)

Definition at line 587 of file can_dash.cpp.

587 {
588 if (!cycle.isInterval(CI::_10ms)) {
589 return;
590 }
591
593
594 transmitStruct<Aim5f0>(CanCategory::NBC, 0x5f0, false, canChannel);
595 transmitStruct<Aim5f1>(CanCategory::NBC, 0x5f1, false, canChannel);
596 transmitStruct<Aim5f2>(CanCategory::NBC, 0x5f2, false, canChannel);
597 transmitStruct<Aim5f3>(CanCategory::NBC, 0x5f3, false, canChannel);
598 transmitStruct<Aim5f4>(CanCategory::NBC, 0x5f4, false, canChannel);
599 transmitStruct<Aim5f5>(CanCategory::NBC, 0x5f5, false, canChannel);
600 transmitStruct<Aim5f6>(CanCategory::NBC, 0x5f6, false, canChannel);
601 transmitStruct<Aim5f7>(CanCategory::NBC, 0x5f7, false, canChannel);
602
603 // there are more, but less important for us
604 // transmitStruct<Aim5f8>(0x5f8, false);
605 // transmitStruct<Aim5f9>(0x5f9, false);
606 // transmitStruct<Aim5fa>(0x5fa, false);
607 // transmitStruct<Aim5fb>(0x5fb, false);
608 // transmitStruct<Aim5fc>(0x5fc, false);
609 // transmitStruct<Aim5fd>(0x5fd, false);
610}
bool isInterval(CanInterval interval)
Definition can.h:90
static constexpr engine_configuration_s * engineConfiguration
static CanTsChannel canChannel

Referenced by updateDash().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ canDashboardBmwE46()

static void canDashboardBmwE46 ( CanCycle  cycle)
static

Definition at line 85 of file can_dash.cpp.

85 {
86
87 if (cycle.isInterval(CI::_10ms)) {
88 {
89 CanTxMessage msg(CanCategory::NBC, CAN_BMW_E46_RPM);
90 msg[0] = 0x05; // ASC message
91 msg[1] = 0x0C; // Indexed Engine Torque in % of C_TQ_STND TBD
92 msg.setShortValue((int) (Sensor::getOrZero(SensorType::Rpm) * 6.4), 2);
93 msg[4] = 0x0C;
94 msg[5] = 0x15;
95 msg[6] = 0x00;
96 msg[7] = 0x35;
97 }
98
99 {
100 CanTxMessage msg(CanCategory::NBC, CAN_BMW_E46_DME2);
101 msg[0] = 0x11;
102 msg[1] = (Sensor::getOrZero(SensorType::Clt) + 48.373) / 0.75;
103 msg[2] = 0x00; // baro sensor
104 msg[3] = 0x08;
105 msg[4] = 0x00; // TPS_VIRT_CRU_CAN, not used.
106 msg[5] = 0x00; // TPS out, but we set to 0 just in case.
107 msg[6] = 0x00; // brake system status Ok.
108 msg[7] = 0x00; // not used
109 }
110 }
111}
static float getOrZero(SensorType type)
Definition sensor.h:83

Referenced by updateDash().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ canDashboardBmwE90()

static void canDashboardBmwE90 ( CanCycle  cycle)
static

Definition at line 299 of file can_dash.cpp.

299 {
300
301 if (cycle.isInterval(CI::_50ms)) {
302
303 { //T15 'turn-on'
304 CanTxMessage msg(CanCategory::NBC, E90_T15, 5);
305 msg[0] = 0x45;
306 msg[1] = 0x41;
307 msg[2] = 0x61;
308 msg[3] = 0x8F;
309 msg[4] = 0xFC;
310 }
311
312 { //Ebrake light
313 CanTxMessage msg(CanCategory::OBD, E90_EBRAKE, 2);
314 msg[0] = 0xFD;
315 msg[1] = 0xFF;
316 }
317
318 { //RPM
319 rpmcounter++;
320 if (rpmcounter > 0xFE)
321 rpmcounter = 0xF0;
322 CanTxMessage msg(CanCategory::OBD, E90_RPM, 3);
323 msg[0] = rpmcounter;
324 msg.setShortValue(Sensor::getOrZero(SensorType::Rpm) * 4, 1);
325 }
326
327 { //oil & coolant temp (all in C, despite gauge being F)
328 tmp_cnt++;
329 if (tmp_cnt >= 0x0F)
330 tmp_cnt = 0x00;
331 CanTxMessage msg(CanCategory::OBD, E90_TEMP, 8);
332 msg[0] = (int)(Sensor::getOrZero(SensorType::Clt) + e90_temp_offset); //coolant
333 msg[1] = (int)(Sensor::getOrZero(SensorType::AuxTemp1) + e90_temp_offset); //oil (AuxTemp1)
334 msg[2] = tmp_cnt;
335 msg[3] = 0xC8;
336 msg[4] = 0xA7;
337 msg[5] = 0xD3;
338 msg[6] = 0x0D;
339 msg[7] = 0xA8;
340 }
341 }
342
343 if (cycle.isInterval(CI::_100ms)) {
344 {
345 //Seatbelt counter
346 seatbeltcnt++;
347 if (seatbeltcnt > 0xFE)
348 seatbeltcnt = 0x00;
349 CanTxMessage msg(CanCategory::NBC, E90_SEATBELT_COUNTER, 2);
350 msg[0] = seatbeltcnt;
351 msg[1] = 0xFF;
352 }
353
354 {
355 //Brake counter 100ms
356 brakecnt_1 += 16;
357 brakecnt_2 += 16;
358 if (brakecnt_1 > 0xEF)
359 brakecnt_1 = 0x0F;
360 if (brakecnt_2 > 0xF0)
361 brakecnt_2 = 0xA0;
362 CanTxMessage msg(CanCategory::NBC, E90_BRAKE_COUNTER, 8);
363 msg[0] = 0x00;
364 msg[1] = 0xE0;
365 msg[2] = brakecnt_1;
366 msg[3] = 0xFC;
367 msg[4] = 0xFE;
368 msg[5] = 0x41;
369 msg[6] = 0x00;
370 msg[7] = brakecnt_2;
371 }
372
373 { //ABS counter
374 abscounter++;
375 if (abscounter > 0xFE)
376 abscounter = 0xF0;
377 CanTxMessage msg(CanCategory::NBC, E90_ABS_COUNTER, 2);
378 msg[0] = abscounter;
379 msg[1] = 0xFF;
380 }
381
382 { //Fuel gauge
383 CanTxMessage msg(CanCategory::NBC, E90_FUEL, 5); //fuel gauge
384 msg[0] = 0x76;
385 msg[1] = 0x0F;
386 msg[2] = 0xBE;
387 msg[3] = 0x1A;
388 msg[4] = 0x00;
389 }
390
391 { //Gear indicator/counter
392 gear_cnt++;
393 if (gear_cnt >= 0x0F)
394 gear_cnt = 0x00;
395 CanTxMessage msg(CanCategory::NBC, E90_GEAR, 6);
396 msg[0] = 0x78;
397 msg[1] = 0x0F;
398 msg[2] = 0xFF;
399 msg[3] = (gear_cnt << 4) | 0xC;
400 msg[4] = 0xF1;
401 msg[5] = 0xFF;
402 }
403
404 { //E90_SPEED
405 auto vehicleSpeed = Sensor::getOrZero(SensorType::VehicleSpeed);
406 float mph = vehicleSpeed * 0.6213712;
407 mph_ctr = ((TIME_I2MS(chVTGetSystemTime()) - mph_timer) / 50);
408 mph_a = (mph_ctr * mph / 2);
411 mph_counter += mph_ctr * 100;
412 if(mph_counter >= 0xFFF0)
413 mph_counter = 0xF000;
414 mph_timer = TIME_I2MS(chVTGetSystemTime());
415 CanTxMessage msg(CanCategory::NBC, E90_SPEED, 8);
416 msg.setShortValue(mph_2a, 0);
417 msg.setShortValue(mph_2a, 2);
418 msg.setShortValue(mph_2a, 4);
419 msg[6] = mph_counter & 0xFF;
420 // todo: what are we packing into what exactly? note the '| 0xF0'
421 msg[7] = (mph_counter >> 8) | 0xF0;
422 }
423 }
424
425 {
426 if (!cluster_time_set) {
427#if EFI_RTC
428 efidatetime_t dateTime = getRtcDateTime();
429#else // EFI_RTC
430 efidatetime_t dateTime = {
431 .year = 0, .month = 0, .day = 0,
432 .hour = 0, .minute = 0, .second = 0,
433 };
434#endif // EFI_RTC
435 CanTxMessage msg(CanCategory::NBC, E90_TIME, 8);
436 msg[0] = dateTime.hour;
437 msg[1] = dateTime.minute;
438 msg[2] = dateTime.second;
439 msg[3] = dateTime.day;
440 msg[4] = (dateTime.month << 4) | 0x0F;
441 msg[5] = dateTime.year & 0xFF;
442 msg[6] = (dateTime.year >> 8) | 0xF0; // collides CAN dash at 4096!
443 msg[7] = 0xF2;
445 }
446 }
447}
static uint8_t mph_last
Definition can_dash.cpp:69
static uint8_t brakecnt_2
Definition can_dash.cpp:68
static uint8_t tmp_cnt
Definition can_dash.cpp:69
constexpr uint8_t e90_temp_offset
Definition can_dash.cpp:73
static time_msecs_t mph_ctr
Definition can_dash.cpp:53
static uint8_t rpmcounter
Definition can_dash.cpp:65
static uint8_t gear_cnt
Definition can_dash.cpp:69
static uint16_t mph_counter
Definition can_dash.cpp:70
static uint8_t abscounter
Definition can_dash.cpp:67
static uint8_t mph_2a
Definition can_dash.cpp:69
static uint8_t brakecnt_1
Definition can_dash.cpp:68
static uint8_t seatbeltcnt
Definition can_dash.cpp:66
static uint8_t mph_a
Definition can_dash.cpp:69
static bool cluster_time_set
Definition can_dash.cpp:71
static time_msecs_t mph_timer
Definition can_dash.cpp:52
efidatetime_t getRtcDateTime()
uint32_t year

Referenced by updateDash().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ canDashboardFiat()

void canDashboardFiat ( CanCycle  cycle)

Definition at line 172 of file can_dash.cpp.

172 {
173 if (cycle.isInterval(CI::_50ms)) {
174 {
175 //Fiat Dashboard
176 CanTxMessage msg(CanCategory::NBC, CAN_FIAT_MOTOR_INFO);
177 msg.setShortValue((int) (Sensor::getOrZero(SensorType::Clt) - 40), 3); //Coolant Temp
178 msg.setShortValue(Sensor::getOrZero(SensorType::Rpm) / 32, 6); //RPM
179 }
180 }
181}

Referenced by updateDash().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ canDashboardGenesisCoupe()

void canDashboardGenesisCoupe ( CanCycle  cycle)

Definition at line 266 of file can_dash.cpp.

266 {
267 if (cycle.isInterval(CI::_50ms)) {
268 {
269 CanTxMessage msg(CanCategory::NBC, GENESIS_COUPLE_RPM_316, 8);
270 msg.setShortValueMsb(Sensor::getOrZero(SensorType::Rpm) * 4, /*offset*/ 3);
271 }
272 {
273 CanTxMessage msg(CanCategory::NBC, GENESIS_COUPLE_COOLANT_329, 8);
275 msg[1] = clt;
276 }
277 }
278}
static CCM_OPTIONAL FunctionalSensor clt(SensorType::Clt, MS2NT(10))

Referenced by updateDash().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ canDashboardVAG()

void canDashboardVAG ( CanCycle  cycle)

Definition at line 183 of file can_dash.cpp.

183 {
184 if (cycle.isInterval(CI::_10ms)) {
185 {
186 // https://github.com/commaai/opendbc/blob/57c8340a180dd8c75139b18050eb17c72c9cb6e4/vw_golf_mk4.dbc#L394
187 //VAG Dashboard
188 CanTxMessage msg(CanCategory::NBC, CAN_VAG_Motor_1);
189 msg.setShortValue(Sensor::getOrZero(SensorType::Rpm) * 4, 2); //RPM
190 }
191
193
194 {
195 CanTxMessage msg(CanCategory::NBC, CAN_VAG_Motor_2);
196 msg.setShortValue((int) ((clt + 48.373) / 0.75), 1); //Coolant Temp
197 }
198
199 {
200 CanTxMessage msg(CanCategory::NBC, CAN_VAG_CLT_V2);
201 msg.setShortValue((int) ((clt + 48.373) / 0.75), 4); //Coolant Temp
202 }
203
204 {
205 CanTxMessage msg(CanCategory::NBC, CAN_VAG_IMMO);
206 msg.setShortValue(0x80, 1);
207 }
208 }
209}

Referenced by updateDash().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ canDashboardVagMqb()

void canDashboardVagMqb ( CanCycle  cycle)

https://docs.google.com/spreadsheets/d/1XMfeGlhgl0lBL54lNtPdmmFd8gLr2T_YTriokb30kJg

Definition at line 283 of file can_dash.cpp.

283 {
284 if (cycle.isInterval(CI::_50ms)) {
285
286 { // 'turn-on'
287 CanTxMessage msg(CanCategory::NBC, 0x3C0, 4);
288 // ignition ON
289 msg[2] = 3;
290 }
291
292 { //RPM
293 CanTxMessage msg(CanCategory::NBC, 0x107, 8);
294 msg.setShortValue(Sensor::getOrZero(SensorType::Rpm) / 3.5, /*offset*/ 3);
295 }
296 }
297}

Referenced by updateDash().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ canDashboardW202()

void canDashboardW202 ( CanCycle  cycle)

Definition at line 211 of file can_dash.cpp.

211 {
212 if (cycle.isInterval(CI::_20ms)) {
213 {
214 CanTxMessage msg(CanCategory::NBC, W202_STAT_1);
215 msg[0] = 0x08; // Unknown
216 msg.setShortValueMsb(Sensor::getOrZero(SensorType::Rpm), 1);
217 msg[3] = 0x00; // 0x01 - tank blink, 0x02 - EPC
218 msg[4] = 0x00; // Unknown
219 msg[5] = 0x00; // Unknown
220 msg[6] = 0x00; // Unknown - oil info
221 msg[7] = 0x00; // Unknown - oil info
222 }
223 }
224
225 if (cycle.isInterval(CI::_100ms)) {
226 {
227 CanTxMessage msg(CanCategory::NBC, W202_STAT_2); //dlc 7
228 msg[0] = (int)(Sensor::getOrZero(SensorType::Clt) + 40); // CLT -40 offset
229 msg[1] = 0x3D; // TBD
230 msg[2] = 0x63; // Const
231 msg[3] = 0x41; // Const
232 msg[4] = 0x00; // Unknown
233 msg[5] = 0x05; // Const
234 msg[6] = 0x50; // TBD
235 msg[7] = 0x00; // Unknown
236 }
237 }
238
239 if (cycle.isInterval(CI::_200ms)) {
240 {
241 CanTxMessage msg(CanCategory::NBC, W202_ALIVE);
242 msg[0] = 0x0A; // Const
243 msg[1] = 0x18; // Const
244 msg[2] = 0x00; // Const
245 msg[3] = 0x00; // Const
246 msg[4] = 0xC0; // Const
247 msg[5] = 0x00; // Const
248 msg[6] = 0x00; // Const
249 msg[7] = 0x00; // Const
250 }
251
252 {
253 CanTxMessage msg(CanCategory::NBC, W202_STAT_3);
254 msg[0] = 0x00; // Const
255 msg[1] = 0x00; // Const
256 msg[2] = 0x6D; // TBD
257 msg[3] = 0x7B; // Const
258 msg[4] = 0x21; // TBD
259 msg[5] = 0x07; // Const
260 msg[6] = 0x33; // Const
261 msg[7] = 0x05; // Const
262 }
263 }
264}

Referenced by updateDash().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ canMazdaRX8()

void canMazdaRX8 ( CanCycle  cycle)

Definition at line 114 of file can_dash.cpp.

114 {
115 if (cycle.isInterval(CI::_50ms)) {
116 {
117 CanTxMessage msg(CanCategory::NBC, CAN_MAZDA_RX_STEERING_WARNING);
118 // todo: something needs to be set here? see http://rusefi.com/wiki/index.php?title=Vehicle:Mazda_Rx8_2004
119 }
120
121 {
122 CanTxMessage msg(CanCategory::NBC, CAN_MAZDA_RX_RPM_SPEED);
123
125
126 // todo: LSB+SWAP? lol, that's MSB?
127 msg.setShortValue(SWAP_UINT16(Sensor::getOrZero(SensorType::Rpm) * 4), 0);
128 msg.setShortValue(0xFFFF, 2);
129 // todo: LSB+SWAP? lol, that's MSB?
130 msg.setShortValue(SWAP_UINT16((int )(100 * kph + 10000)), 4);
131 msg.setShortValue(0, 6);
132 }
133
134 {
135 CanTxMessage msg(CanCategory::NBC, CAN_MAZDA_RX_STATUS_1);
136 msg[0] = 0xFE; //Unknown
137 msg[1] = 0xFE; //Unknown
138 msg[2] = 0xFE; //Unknown
139 msg[3] = 0x34; //DSC OFF in combo with byte 5 Live data only seen 0x34
140 msg[4] = 0x00; // B01000000; // Brake warning B00001000; //ABS warning
141 msg[5] = 0x40; // TCS in combo with byte 3
142 msg[6] = 0x00; // Unknown
143 msg[7] = 0x00; // Unused
144 }
145
146 {
147 CanTxMessage msg(CanCategory::NBC, CAN_MAZDA_RX_STATUS_2);
149 msg[0] = (uint8_t)(clt.value_or(0) + 69); //temp gauge //~170 is red, ~165 last bar, 152 centre, 90 first bar, 92 second bar
150 // TODO: fixme!
151 //msg[1] = ((int16_t)(engine->engineState.vssEventCounter*(engineConfiguration->vehicleSpeedCoef*0.277*2.58))) & 0xff;
152 msg[2] = 0x00; // unknown
153 msg[3] = 0x00; //unknown
154 msg[4] = 0x01; //Oil Pressure (not really a gauge)
155 msg[5] = 0x00; //check engine light
156 msg[6] = 0x00; //Coolant, oil and battery
157 if ((Sensor::getOrZero(SensorType::Rpm)>0) && (Sensor::get(SensorType::BatteryVoltage).value_or(VBAT_FALLBACK_VALUE)<13)) {
158 msg.setBit(6, 6); // battery light
159 }
160 if (!clt.Valid || clt.Value > 105) {
161 // coolant light, 101 - red zone, light means its get too hot
162 // Also turn on the light in case of sensor failure
163 msg.setBit(6, 1);
164 }
165 //oil pressure warning lamp bit is 7
166 msg[7] = 0x00; //unused
167 }
168 }
169
170}
virtual SensorResult get() const =0
uint16_t SWAP_UINT16(uint16_t x)
Definition efilib.h:22

Referenced by updateDash().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ populateFrame() [1/8]

static void populateFrame ( Aim5f0 &  msg)
static

Definition at line 459 of file can_dash.cpp.

Referenced by transmitStruct().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ populateFrame() [2/8]

static void populateFrame ( Aim5f1 &  msg)
static

Definition at line 473 of file can_dash.cpp.

473 {
474 // We don't handle wheel speed, just set to 0?
475 msg.WheelSpeedFR = 0;
476 msg.WheelSpeedFL = 0;
477 msg.WheelSpeedRR = 0;
478 msg.WheelSpeedRL = 0;
479}

◆ populateFrame() [3/8]

static void populateFrame ( Aim5f2 &  msg)
static

Definition at line 488 of file can_dash.cpp.

488 {
489 msg.Iat = Sensor::getOrZero(SensorType::Iat) + 45;
490 msg.Ect = Sensor::getOrZero(SensorType::Clt) + 45;
493}
Here is the call graph for this function:

◆ populateFrame() [4/8]

static void populateFrame ( Aim5f3 &  msg)
static

Definition at line 502 of file can_dash.cpp.

502 {
503 // MAP/Baro are sent in millibar -> 10 millibar per kpa
504 msg.Map = 10 * Sensor::getOrZero(SensorType::Map);
506
507 // Oil/Fuel P use bar -> 100 kpa per bar
510}
@ FuelPressureInjector
@ BarometricPressure
Here is the call graph for this function:

◆ populateFrame() [5/8]

static void populateFrame ( Aim5f4 &  msg)
static

Definition at line 519 of file can_dash.cpp.

519 {
520 float deltaKpa = Sensor::getOrZero(SensorType::Map)
521 - Sensor::get(SensorType::BarometricPressure).value_or(STD_ATMOSPHERE);
522 float boostBar = deltaKpa / 100;
523
524#ifdef MODULE_ODOMETER
525 float gPerSecond = engine->module<TripOdometer>()->getConsumptionGramPerSecond();
526#else
527 float gPerSecond = 0;
528#endif // MODULE_ODOMETER
529
530 float gPerHour = gPerSecond * 3600.0f;
531 float literPerHour = gPerHour * 0.00139f;
532
533 msg.Boost = boostBar;
535 msg.FuelConsumptionLH = 10 * literPerHour;
537}
constexpr auto & module()
Definition engine.h:200
static EngineAccessor engine
Definition engine.h:413
Here is the call graph for this function:

◆ populateFrame() [6/8]

static void populateFrame ( Aim5f5 &  msg)
static

Definition at line 546 of file can_dash.cpp.

546 {
548
549 // Dunno what to do with these
550 msg.ShiftFlag = 0;
551 msg.GearTime = 0;
552 msg.TpsV = 0;
553}
Here is the call graph for this function:

◆ populateFrame() [7/8]

static void populateFrame ( Aim5f6 &  msg)
static

Definition at line 562 of file can_dash.cpp.

562 {
565 msg.LambdaTemp1 = 0;
566 msg.LambdaTemp2 = 0;
567}
Here is the call graph for this function:

◆ populateFrame() [8/8]

static void populateFrame ( Aim5f7 &  msg)
static

Definition at line 576 of file can_dash.cpp.

576 {
577#if EFI_ENGINE_CONTROL
578 // We don't handle wheel speed, just set to 0?
579 msg.LambdaErr1 = 0;
580 msg.LambdaErr2 = 0;
581 // both targets are the same for now
582 msg.LambdaTarget1 = (float)engine->fuelComputer.targetLambda;
583 msg.LambdaTarget2 = (float)engine->fuelComputer.targetLambda;
584#endif // EFI_ENGINE_CONTROL
585}
FuelComputer fuelComputer
Definition engine.h:139
scaled_channel< uint16_t, 10000, 1 > targetLambda

◆ updateDash()

void updateDash ( CanCycle  cycle)

Definition at line 616 of file can_dash.cpp.

616 {
617 if (custom_board_update_dash.has_value()) {
618 custom_board_update_dash.value()(cycle);
619 }
620
621 boardUpdateDash(cycle);
622
623 // Transmit dash data, if enabled
625 case CAN_BUS_NBC_NONE:
626 break;
627 case CAN_BUS_BMW_E46:
628 canDashboardBmwE46(cycle);
629 break;
630 case CAN_BUS_Haltech:
631 canDashboardHaltech(cycle);
632 break;
633 case CAN_BUS_NBC_FIAT:
634 canDashboardFiat(cycle);
635 break;
636 case CAN_BUS_NBC_VAG:
637 canDashboardVAG(cycle);
638 break;
639 case CAN_BUS_MAZDA_RX8:
640 canMazdaRX8(cycle);
641 break;
642 case CAN_BUS_W202_C180:
643 canDashboardW202(cycle);
644 break;
645 case CAN_BUS_BMW_E90:
646 canDashboardBmwE90(cycle);
647 break;
648 case CAN_BUS_MQB:
649 canDashboardVagMqb(cycle);
650 break;
651 case CAN_BUS_NISSAN_VQ:
653 break;
654 case CAN_BUS_GENESIS_COUPE:
656 break;
657 case CAN_BUS_HONDA_K:
658 canDashboardHondaK(cycle);
659 break;
660 case CAN_AIM_DASH:
661 canDashboardAim(cycle);
662 break;
663 case CAN_BUS_MS_SIMPLE_BROADCAST:
664 canDashboardTS(cycle);
665 break;
666 default:
667 criticalError("Nothing for canNbcType %d/%s", engineConfiguration->canNbcType, getCan_nbc_e(engineConfiguration->canNbcType));
668 break;
669 }
670}
const char * getCan_nbc_e(can_nbc_e value)
static void canDashboardBmwE46(CanCycle cycle)
Definition can_dash.cpp:85
std::optional< board_can_update_dash_type > custom_board_update_dash
Definition can_dash.cpp:612
void canMazdaRX8(CanCycle cycle)
Definition can_dash.cpp:114
static void canDashboardBmwE90(CanCycle cycle)
Definition can_dash.cpp:299
PUBLIC_API_WEAK void boardUpdateDash(CanCycle cycle)
Definition can_dash.cpp:614
void canDashboardW202(CanCycle cycle)
Definition can_dash.cpp:211
void canDashboardAim(CanCycle cycle)
Definition can_dash.cpp:587
void canDashboardVAG(CanCycle cycle)
Definition can_dash.cpp:183
void canDashboardGenesisCoupe(CanCycle cycle)
Definition can_dash.cpp:266
void canDashboardFiat(CanCycle cycle)
Definition can_dash.cpp:172
void canDashboardVagMqb(CanCycle cycle)
Definition can_dash.cpp:283
void canDashboardHaltech(CanCycle cycle)
void canDashboardHondaK(CanCycle cycle)
void canDashboardTS(CanCycle cycle)
void canDashboardNissanVQ(CanCycle cycle)

Referenced by CanWrite::PeriodicTask().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ abscounter

uint8_t abscounter = 0xF0
static

Definition at line 67 of file can_dash.cpp.

Referenced by canDashboardBmwE90().

◆ brakecnt_1

uint8_t brakecnt_1 = 0xF0
static

Definition at line 68 of file can_dash.cpp.

Referenced by canDashboardBmwE90().

◆ brakecnt_2

uint8_t brakecnt_2 = 0xF0
static

Definition at line 68 of file can_dash.cpp.

Referenced by canDashboardBmwE90().

◆ cluster_time_set

bool cluster_time_set
static

Definition at line 71 of file can_dash.cpp.

Referenced by canDashboardBmwE90().

◆ custom_board_update_dash

std::optional<board_can_update_dash_type> custom_board_update_dash

Definition at line 612 of file can_dash.cpp.

Referenced by updateDash().

◆ e90_temp_offset

constexpr uint8_t e90_temp_offset = 49
constexpr

Definition at line 73 of file can_dash.cpp.

Referenced by canDashboardBmwE90().

◆ gear_cnt

uint8_t gear_cnt
static

Definition at line 69 of file can_dash.cpp.

Referenced by canDashboardBmwE90().

◆ mph_2a

uint8_t mph_2a
static

Definition at line 69 of file can_dash.cpp.

Referenced by canDashboardBmwE90().

◆ mph_a

uint8_t mph_a
static

Definition at line 69 of file can_dash.cpp.

Referenced by canDashboardBmwE90().

◆ mph_counter

uint16_t mph_counter = 0xF000
static

Definition at line 70 of file can_dash.cpp.

Referenced by canDashboardBmwE90().

◆ mph_ctr

time_msecs_t mph_ctr
static

Definition at line 53 of file can_dash.cpp.

Referenced by canDashboardBmwE90().

◆ mph_last

uint8_t mph_last
static

Definition at line 69 of file can_dash.cpp.

Referenced by canDashboardBmwE90().

◆ mph_timer

time_msecs_t mph_timer
static

Definition at line 52 of file can_dash.cpp.

Referenced by canDashboardBmwE90().

◆ rpmcounter

uint8_t rpmcounter
static

Definition at line 65 of file can_dash.cpp.

Referenced by canDashboardBmwE90().

◆ seatbeltcnt

uint8_t seatbeltcnt
static

Definition at line 66 of file can_dash.cpp.

Referenced by canDashboardBmwE90().

◆ tmp_cnt

uint8_t tmp_cnt
static

Definition at line 69 of file can_dash.cpp.

Referenced by canDashboardBmwE90().

Go to the source code of this file.