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

Detailed Description

This file implements MegaSquirt CAN realtime data broadcasting format

Date
May 8, 2023
Author
AndreyGusakov, (c) 2023

Definition in file can_dash_ms.cpp.

Functions

static void populateFrame (ms1512 &msg)
 
static void populateFrame (ms1513 &msg)
 
static void populateFrame (ms1514 &msg)
 
static void populateFrame (ms1515 &msg)
 
static void populateFrame (ms1516 &msg)
 
void canDashboardTS (CanCycle cycle)
 

Function Documentation

◆ canDashboardTS()

void canDashboardTS ( CanCycle  cycle)

Definition at line 117 of file can_dash_ms.cpp.

117 {
118 /* TODO: get from settings */
119 uint32_t baseId = 1512; /* 0x5e8 */
120
121 if (!cycle.isInterval(CI::_10ms)) {
122 return;
123 }
124
125 bool busIndex = 0;
126 transmitStruct<ms1512>(CanCategory::NBC, baseId + 0, false, busIndex);
127 transmitStruct<ms1513>(CanCategory::NBC, baseId + 1, false, busIndex);
128 transmitStruct<ms1514>(CanCategory::NBC, baseId + 2, false, busIndex);
129 transmitStruct<ms1515>(CanCategory::NBC, baseId + 3, false, busIndex);
130 transmitStruct<ms1516>(CanCategory::NBC, baseId + 4, false, busIndex);
131}
bool isInterval(CanInterval interval)
Definition can.h:90

Referenced by updateDash().

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

◆ populateFrame() [1/5]

static void populateFrame ( ms1512 &  msg)
static

Definition at line 34 of file can_dash_ms.cpp.

35{
38 /* Celsius to Fahrenheit */
39 msg.Clt = Sensor::getOrZero(SensorType::Clt) * 9 / 5 + 32;
41}
static float getOrZero(SensorType type)
Definition sensor.h:83
Here is the call graph for this function:

◆ populateFrame() [2/5]

static void populateFrame ( ms1513 &  msg)
static

Definition at line 51 of file can_dash_ms.cpp.

52{
53 /* TODO: per-bank */
54 msg.pw1 = msg.pw2 = engine->engineState.injectionDuration;
55 /* Celsius to Fahrenheit */
56 msg.mat = Sensor::getOrZero(SensorType::Iat) * 9 / 5 + 32;
57 float timing = engine->engineState.timingAdvance[0];
58 msg.adv_deg = timing > 360 ? timing - 720 : timing;
59}
EngineState engineState
Definition engine.h:344
floatms_t injectionDuration
angle_t timingAdvance[MAX_CYLINDER_COUNT]
static EngineAccessor engine
Definition engine.h:413
Here is the call graph for this function:

◆ populateFrame() [3/5]

static void populateFrame ( ms1514 &  msg)
static

Definition at line 69 of file can_dash_ms.cpp.

70{
71#if EFI_ENGINE_CONTROL
72 msg.afrtgt1 = (float)engine->fuelComputer.targetLambda * STOICH_RATIO;
73 msg.AFR1 = Sensor::getOrZero(SensorType::Lambda1) * STOICH_RATIO;
74 /* TODO: banks? */
75 msg.EGOcor1 = engine->engineState.stftCorrection[0];
76 /* TODO */
77 msg.egt1 = 0;
79#endif // EFI_ENGINE_CONTROL
80}
FuelComputer fuelComputer
Definition engine.h:139
float stftCorrection[FT_BANK_COUNT]
scaled_channel< uint16_t, 10000, 1 > targetLambda
Here is the call graph for this function:

◆ populateFrame() [4/5]

static void populateFrame ( ms1515 &  msg)
static

Definition at line 90 of file can_dash_ms.cpp.

91{
93 /* TODO */
94 msg.sensor1 = 0;
95 msg.sensor2 = 0;
96 msg.knk_rtd = engine->module<KnockController>()->m_knockLevel;
97 msg.unused = 0;
98}
constexpr auto & module()
Definition engine.h:200
m_knockLevel("Knock: Current level", SensorCategory.SENSOR_INPUTS, FieldType.INT, 996, 1.0, 0.0, 0.0, "Volts")
Here is the call graph for this function:

◆ populateFrame() [5/5]

static void populateFrame ( ms1516 &  msg)
static

Definition at line 107 of file can_dash_ms.cpp.

108{
109 /* ms-1 ??? */
111 /* TODO */
112 msg.tc_retard = 0;
113 msg.launch_timing = 0;
114 msg.unsused = 0;
115}
Here is the call graph for this function:

Go to the source code of this file.