|
|
|
@ -143,17 +143,17 @@ void canDashboardBMW(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
if (cycle.isInterval(CI::_50ms)) {
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(CAN_BMW_E46_SPEED);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, CAN_BMW_E46_SPEED);
|
|
|
|
|
msg.setShortValue(10 * 8, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(CAN_BMW_E46_RPM);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, CAN_BMW_E46_RPM);
|
|
|
|
|
msg.setShortValue((int) (Sensor::getOrZero(SensorType::Rpm) * 6.4), 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(CAN_BMW_E46_DME2);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, CAN_BMW_E46_DME2);
|
|
|
|
|
msg.setShortValue((int) ((Sensor::getOrZero(SensorType::Clt) + 48.373) / 0.75), 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -163,12 +163,12 @@ void canDashboardBMW(CanCycle cycle) {
|
|
|
|
|
void canMazdaRX8(CanCycle cycle) {
|
|
|
|
|
if (cycle.isInterval(CI::_50ms)) {
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(CAN_MAZDA_RX_STEERING_WARNING);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, CAN_MAZDA_RX_STEERING_WARNING);
|
|
|
|
|
// todo: something needs to be set here? see http://rusefi.com/wiki/index.php?title=Vehicle:Mazda_Rx8_2004
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(CAN_MAZDA_RX_RPM_SPEED);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, CAN_MAZDA_RX_RPM_SPEED);
|
|
|
|
|
|
|
|
|
|
float kph = Sensor::getOrZero(SensorType::VehicleSpeed);
|
|
|
|
|
|
|
|
|
@ -179,7 +179,7 @@ void canMazdaRX8(CanCycle cycle) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(CAN_MAZDA_RX_STATUS_1);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, CAN_MAZDA_RX_STATUS_1);
|
|
|
|
|
msg[0] = 0xFE; //Unknown
|
|
|
|
|
msg[1] = 0xFE; //Unknown
|
|
|
|
|
msg[2] = 0xFE; //Unknown
|
|
|
|
@ -191,7 +191,7 @@ void canMazdaRX8(CanCycle cycle) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(CAN_MAZDA_RX_STATUS_2);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, CAN_MAZDA_RX_STATUS_2);
|
|
|
|
|
auto clt = Sensor::get(SensorType::Clt);
|
|
|
|
|
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
|
|
|
|
|
// TODO: fixme!
|
|
|
|
@ -220,7 +220,7 @@ void canDashboardFiat(CanCycle cycle) {
|
|
|
|
|
if (cycle.isInterval(CI::_50ms)) {
|
|
|
|
|
{
|
|
|
|
|
//Fiat Dashboard
|
|
|
|
|
CanTxMessage msg(CAN_FIAT_MOTOR_INFO);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, CAN_FIAT_MOTOR_INFO);
|
|
|
|
|
msg.setShortValue((int) (Sensor::getOrZero(SensorType::Clt) - 40), 3); //Coolant Temp
|
|
|
|
|
msg.setShortValue(Sensor::getOrZero(SensorType::Rpm) / 32, 6); //RPM
|
|
|
|
|
}
|
|
|
|
@ -231,24 +231,24 @@ void canDashboardVAG(CanCycle cycle) {
|
|
|
|
|
if (cycle.isInterval(CI::_10ms)) {
|
|
|
|
|
{
|
|
|
|
|
//VAG Dashboard
|
|
|
|
|
CanTxMessage msg(CAN_VAG_Motor_1);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, CAN_VAG_Motor_1);
|
|
|
|
|
msg.setShortValue(Sensor::getOrZero(SensorType::Rpm) * 4, 2); //RPM
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float clt = Sensor::getOrZero(SensorType::Clt);
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(CAN_VAG_Motor_2);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, CAN_VAG_Motor_2);
|
|
|
|
|
msg.setShortValue((int) ((clt + 48.373) / 0.75), 1); //Coolant Temp
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(CAN_VAG_CLT_V2);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, CAN_VAG_CLT_V2);
|
|
|
|
|
msg.setShortValue((int) ((clt + 48.373) / 0.75), 4); //Coolant Temp
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(CAN_VAG_IMMO);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, CAN_VAG_IMMO);
|
|
|
|
|
msg.setShortValue(0x80, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -257,7 +257,7 @@ void canDashboardVAG(CanCycle cycle) {
|
|
|
|
|
void canDashboardW202(CanCycle cycle) {
|
|
|
|
|
if (cycle.isInterval(CI::_20ms)) {
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(W202_STAT_1);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, W202_STAT_1);
|
|
|
|
|
uint16_t tmp = Sensor::getOrZero(SensorType::Rpm);
|
|
|
|
|
msg[0] = 0x08; // Unknown
|
|
|
|
|
msg[1] = (tmp >> 8); //RPM
|
|
|
|
@ -272,7 +272,7 @@ void canDashboardW202(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
if (cycle.isInterval(CI::_100ms)) {
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(W202_STAT_2); //dlc 7
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, W202_STAT_2); //dlc 7
|
|
|
|
|
msg[0] = (int)(Sensor::getOrZero(SensorType::Clt) + 40); // CLT -40 offset
|
|
|
|
|
msg[1] = 0x3D; // TBD
|
|
|
|
|
msg[2] = 0x63; // Const
|
|
|
|
@ -286,7 +286,7 @@ void canDashboardW202(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
if (cycle.isInterval(CI::_200ms)) {
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(W202_ALIVE);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, W202_ALIVE);
|
|
|
|
|
msg[0] = 0x0A; // Const
|
|
|
|
|
msg[1] = 0x18; // Const
|
|
|
|
|
msg[2] = 0x00; // Const
|
|
|
|
@ -298,7 +298,7 @@ void canDashboardW202(CanCycle cycle) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(W202_STAT_3);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, W202_STAT_3);
|
|
|
|
|
msg[0] = 0x00; // Const
|
|
|
|
|
msg[1] = 0x00; // Const
|
|
|
|
|
msg[2] = 0x6D; // TBD
|
|
|
|
@ -316,13 +316,13 @@ static int rollingId = 0;
|
|
|
|
|
void canDashboardGenesisCoupe(CanCycle cycle) {
|
|
|
|
|
if (cycle.isInterval(CI::_50ms)) {
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(GENESIS_COUPLE_RPM_316, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, GENESIS_COUPLE_RPM_316, 8);
|
|
|
|
|
int rpm8 = Sensor::getOrZero(SensorType::Rpm) * 4;
|
|
|
|
|
msg[3] = rpm8 >> 8;
|
|
|
|
|
msg[4] = rpm8 & 0xFF;
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(GENESIS_COUPLE_COOLANT_329, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, GENESIS_COUPLE_COOLANT_329, 8);
|
|
|
|
|
int clt = Sensor::getOrZero(SensorType::Clt) * 2;
|
|
|
|
|
msg[1] = clt;
|
|
|
|
|
}
|
|
|
|
@ -332,7 +332,7 @@ void canDashboardGenesisCoupe(CanCycle cycle) {
|
|
|
|
|
void canDashboardNissanVQ(CanCycle cycle) {
|
|
|
|
|
if (cycle.isInterval(CI::_50ms)) {
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(NISSAN_RPM_1F9, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, NISSAN_RPM_1F9, 8);
|
|
|
|
|
msg[0] = 0x20;
|
|
|
|
|
int rpm8 = (int)(Sensor::getOrZero(SensorType::Rpm) * 8);
|
|
|
|
|
msg[2] = rpm8 >> 8;
|
|
|
|
@ -340,7 +340,7 @@ void canDashboardNissanVQ(CanCycle cycle) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(NISSAN_CLT_551, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::OBD, NISSAN_CLT_551, 8);
|
|
|
|
|
|
|
|
|
|
int clt = Sensor::getOrZero(SensorType::Clt);
|
|
|
|
|
msg[0] = clt + 45;
|
|
|
|
@ -348,7 +348,7 @@ void canDashboardNissanVQ(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(NISSAN_RPM_CLT, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, NISSAN_RPM_CLT, 8);
|
|
|
|
|
|
|
|
|
|
rollingId = (rollingId + 1) % 4;
|
|
|
|
|
const uint8_t magicByte[4] = {0x03, 0x23, 0x42, 0x63};
|
|
|
|
@ -374,13 +374,13 @@ void canDashboardVagMqb(CanCycle cycle) {
|
|
|
|
|
if (cycle.isInterval(CI::_50ms)) {
|
|
|
|
|
|
|
|
|
|
{ // 'turn-on'
|
|
|
|
|
CanTxMessage msg(0x3C0, 4);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x3C0, 4);
|
|
|
|
|
// ignition ON
|
|
|
|
|
msg[2] = 3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{ //RPM
|
|
|
|
|
CanTxMessage msg(0x107, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x107, 8);
|
|
|
|
|
msg[3] = ((int)(Sensor::getOrZero(SensorType::Rpm) / 3.5)) & 0xFF;
|
|
|
|
|
msg[4] = ((int)(Sensor::getOrZero(SensorType::Rpm) / 3.5)) >> 8;
|
|
|
|
|
}
|
|
|
|
@ -393,7 +393,7 @@ void canDashboardBMWE90(CanCycle cycle)
|
|
|
|
|
if (cycle.isInterval(CI::_50ms)) {
|
|
|
|
|
|
|
|
|
|
{ //T15 'turn-on'
|
|
|
|
|
CanTxMessage msg(E90_T15, 5);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, E90_T15, 5);
|
|
|
|
|
msg[0] = 0x45;
|
|
|
|
|
msg[1] = 0x41;
|
|
|
|
|
msg[2] = 0x61;
|
|
|
|
@ -402,7 +402,7 @@ void canDashboardBMWE90(CanCycle cycle)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{ //Ebrake light
|
|
|
|
|
CanTxMessage msg(E90_EBRAKE, 2);
|
|
|
|
|
CanTxMessage msg(CanCategory::OBD, E90_EBRAKE, 2);
|
|
|
|
|
msg[0] = 0xFD;
|
|
|
|
|
msg[1] = 0xFF;
|
|
|
|
|
}
|
|
|
|
@ -411,7 +411,7 @@ void canDashboardBMWE90(CanCycle cycle)
|
|
|
|
|
rpmcounter++;
|
|
|
|
|
if (rpmcounter > 0xFE)
|
|
|
|
|
rpmcounter = 0xF0;
|
|
|
|
|
CanTxMessage msg(E90_RPM, 3);
|
|
|
|
|
CanTxMessage msg(CanCategory::OBD, E90_RPM, 3);
|
|
|
|
|
msg[0] = rpmcounter;
|
|
|
|
|
msg[1] = ((int)(Sensor::getOrZero(SensorType::Rpm)) * 4) & 0xFF;
|
|
|
|
|
msg[2] = ((int)(Sensor::getOrZero(SensorType::Rpm)) * 4) >> 8;
|
|
|
|
@ -421,7 +421,7 @@ void canDashboardBMWE90(CanCycle cycle)
|
|
|
|
|
tmp_cnt++;
|
|
|
|
|
if (tmp_cnt >= 0x0F)
|
|
|
|
|
tmp_cnt = 0x00;
|
|
|
|
|
CanTxMessage msg(E90_TEMP, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::OBD, E90_TEMP, 8);
|
|
|
|
|
msg[0] = (int)(Sensor::getOrZero(SensorType::Clt) + e90_temp_offset); //coolant
|
|
|
|
|
msg[1] = (int)(Sensor::getOrZero(SensorType::AuxTemp1) + e90_temp_offset); //oil (AuxTemp1)
|
|
|
|
|
msg[2] = tmp_cnt;
|
|
|
|
@ -439,7 +439,7 @@ void canDashboardBMWE90(CanCycle cycle)
|
|
|
|
|
seatbeltcnt++;
|
|
|
|
|
if (seatbeltcnt > 0xFE)
|
|
|
|
|
seatbeltcnt = 0x00;
|
|
|
|
|
CanTxMessage msg(E90_SEATBELT_COUNTER, 2);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, E90_SEATBELT_COUNTER, 2);
|
|
|
|
|
msg[0] = seatbeltcnt;
|
|
|
|
|
msg[1] = 0xFF;
|
|
|
|
|
}
|
|
|
|
@ -452,7 +452,7 @@ void canDashboardBMWE90(CanCycle cycle)
|
|
|
|
|
brakecnt_1 = 0x0F;
|
|
|
|
|
if (brakecnt_2 > 0xF0)
|
|
|
|
|
brakecnt_2 = 0xA0;
|
|
|
|
|
CanTxMessage msg(E90_BRAKE_COUNTER, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, E90_BRAKE_COUNTER, 8);
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0xE0;
|
|
|
|
|
msg[2] = brakecnt_1;
|
|
|
|
@ -467,13 +467,13 @@ void canDashboardBMWE90(CanCycle cycle)
|
|
|
|
|
abscounter++;
|
|
|
|
|
if (abscounter > 0xFE)
|
|
|
|
|
abscounter = 0xF0;
|
|
|
|
|
CanTxMessage msg(E90_ABS_COUNTER, 2);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, E90_ABS_COUNTER, 2);
|
|
|
|
|
msg[0] = abscounter;
|
|
|
|
|
msg[1] = 0xFF;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{ //Fuel gauge
|
|
|
|
|
CanTxMessage msg(E90_FUEL, 5); //fuel gauge
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, E90_FUEL, 5); //fuel gauge
|
|
|
|
|
msg[0] = 0x76;
|
|
|
|
|
msg[1] = 0x0F;
|
|
|
|
|
msg[2] = 0xBE;
|
|
|
|
@ -485,7 +485,7 @@ void canDashboardBMWE90(CanCycle cycle)
|
|
|
|
|
gear_cnt++;
|
|
|
|
|
if (gear_cnt >= 0x0F)
|
|
|
|
|
gear_cnt = 0x00;
|
|
|
|
|
CanTxMessage msg(E90_GEAR, 6);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, E90_GEAR, 6);
|
|
|
|
|
msg[0] = 0x78;
|
|
|
|
|
msg[1] = 0x0F;
|
|
|
|
|
msg[2] = 0xFF;
|
|
|
|
@ -505,7 +505,7 @@ void canDashboardBMWE90(CanCycle cycle)
|
|
|
|
|
if(mph_counter >= 0xFFF0)
|
|
|
|
|
mph_counter = 0xF000;
|
|
|
|
|
mph_timer = TIME_I2MS(chVTGetSystemTime());
|
|
|
|
|
CanTxMessage msg(E90_SPEED, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, E90_SPEED, 8);
|
|
|
|
|
msg[0] = mph_2a & 0xFF;
|
|
|
|
|
msg[1] = mph_2a >> 8;
|
|
|
|
|
msg[2] = mph_2a & 0xFF;
|
|
|
|
@ -521,7 +521,7 @@ void canDashboardBMWE90(CanCycle cycle)
|
|
|
|
|
if (!cluster_time_set) {
|
|
|
|
|
struct tm timp;
|
|
|
|
|
date_get_tm(&timp);
|
|
|
|
|
CanTxMessage msg(E90_TIME, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, E90_TIME, 8);
|
|
|
|
|
msg[0] = timp.tm_hour;
|
|
|
|
|
msg[1] = timp.tm_min;
|
|
|
|
|
msg[2] = timp.tm_sec;
|
|
|
|
@ -542,7 +542,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
if (cycle.isInterval(CI::_20ms)) {
|
|
|
|
|
/* 0x360 - 50Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x360, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x360, 8);
|
|
|
|
|
tmp = Sensor::getOrZero(SensorType::Rpm);
|
|
|
|
|
/* RPM */
|
|
|
|
|
msg[0] = (tmp >> 8);
|
|
|
|
@ -562,7 +562,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x361 - 50Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x361, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x361, 8);
|
|
|
|
|
/* Fuel pressure */
|
|
|
|
|
tmp = (uint16_t)(Sensor::getOrZero(SensorType::FuelPressureLow));
|
|
|
|
|
msg[0] = (tmp >> 8);
|
|
|
|
@ -582,7 +582,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x362 - 50Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x362, 6);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x362, 6);
|
|
|
|
|
/* Injection Stage 1 Duty Cycle - y = x/10 */
|
|
|
|
|
uint16_t rpm = Sensor::getOrZero(SensorType::Rpm);
|
|
|
|
|
tmp = (uint16_t)( getInjectorDutyCycle(rpm) * 10) ;
|
|
|
|
@ -600,7 +600,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* todo: 0x3E5 = 50Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x3E5, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x3E5, 8);
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
|
msg[2] = 0x00;
|
|
|
|
@ -613,7 +613,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* todo: 0x3EA = 50Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x3EA, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x3EA, 8);
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
|
msg[2] = 0x00;
|
|
|
|
@ -626,7 +626,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* todo: 0x3EB = 50Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x3EB, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x3EB, 8);
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
|
msg[2] = 0x00;
|
|
|
|
@ -639,7 +639,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* todo: 0x3EC = 50Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x3EC, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x3EC, 8);
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
|
msg[2] = 0x00;
|
|
|
|
@ -652,14 +652,14 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* todo: 0x3ED = 50Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x3ED, 2);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x3ED, 2);
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* todo: 0x471 = 50Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x471, 2);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x471, 2);
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
|
msg[2] = 0x00;
|
|
|
|
@ -671,7 +671,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x363 - 20Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x363, 4);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x363, 4);
|
|
|
|
|
/* Wheel Slip */
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
@ -682,7 +682,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x368 - 20Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x368, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x368, 8);
|
|
|
|
|
/* Wideband Sensor 1 */
|
|
|
|
|
tmp = (uint16_t)(Sensor::getOrZero(SensorType::Lambda1)) * 1000;
|
|
|
|
|
msg[0] = (tmp >> 8);
|
|
|
|
@ -702,7 +702,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
#if EFI_SHAFT_POSITION_INPUT
|
|
|
|
|
/* 0x369 - 20Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x369, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x369, 8);
|
|
|
|
|
/* Trigger System Error Count */
|
|
|
|
|
tmp = engine->triggerCentral.triggerState.totalTriggerErrorCounter;
|
|
|
|
|
msg[0] = (tmp >> 8);
|
|
|
|
@ -723,7 +723,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
/* 0x36A - 20Hz rate */
|
|
|
|
|
/* todo: one day we should split this */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x36A, 4);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x36A, 4);
|
|
|
|
|
/* Knock Level 1 */
|
|
|
|
|
tmp = (engine->outputChannels.knockLevel * 100);
|
|
|
|
|
msg[0] = (tmp >> 8);
|
|
|
|
@ -735,7 +735,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x36B - 20Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x36B, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x36B, 8);
|
|
|
|
|
/* Break Pressure */
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
@ -752,7 +752,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x36C = 20Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x36C, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x36C, 8);
|
|
|
|
|
/* Wheel Speed Front Left */
|
|
|
|
|
auto vehicleSpeed = Sensor::getOrZero(SensorType::VehicleSpeed);
|
|
|
|
|
tmp = (vehicleSpeed * 10 );
|
|
|
|
@ -771,7 +771,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x36D = 20Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x36D, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x36D, 8);
|
|
|
|
|
/* Unused */
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
@ -787,7 +787,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x36E = 20Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x36E, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x36E, 8);
|
|
|
|
|
/* Engine Limiting Active 0 = off/1=on*/
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
@ -804,7 +804,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x36F = 20Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x36F, 4);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x36F, 4);
|
|
|
|
|
/* Generic Output 1 Duty Cycle */
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
@ -815,7 +815,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x370 = 20Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x370, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x370, 8);
|
|
|
|
|
/* Vehicle Speed */
|
|
|
|
|
auto vehicleSpeed = Sensor::getOrZero(SensorType::VehicleSpeed);
|
|
|
|
|
tmp = (vehicleSpeed * 10 );
|
|
|
|
@ -834,7 +834,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* todo: 0x3E6 = 20Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x3E6, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x3E6, 8);
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
|
msg[2] = 0x00;
|
|
|
|
@ -847,7 +847,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* todo: 0x3E7 = 20Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x3E7, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x3E7, 8);
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
|
msg[2] = 0x00;
|
|
|
|
@ -860,7 +860,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* todo: 0x3E8 = 20Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x3E8, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x3E8, 8);
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
|
msg[2] = 0x00;
|
|
|
|
@ -873,7 +873,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* todo: 0x3E9 = 20Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x3E9, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x3E9, 8);
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
|
msg[2] = 0x00;
|
|
|
|
@ -886,7 +886,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* todo: 0x3EE = 20Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x3EE, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x3EE, 8);
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
|
msg[2] = 0x00;
|
|
|
|
@ -899,7 +899,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* todo: 0x3EF = 20Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x3EF, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x3EF, 8);
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
|
msg[2] = 0x00;
|
|
|
|
@ -912,7 +912,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* todo: 0x470 = 20Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x470, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x470, 8);
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
|
msg[2] = 0x00;
|
|
|
|
@ -925,7 +925,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* todo: 0x472 = 20Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x472, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x472, 8);
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
|
msg[2] = 0x00;
|
|
|
|
@ -941,7 +941,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x371 = 10Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x371, 4);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x371, 4);
|
|
|
|
|
/* Fuel Flow */
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
@ -952,7 +952,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x372 = 10Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x372, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x372, 8);
|
|
|
|
|
/* Battery Voltage */
|
|
|
|
|
tmp = (uint16_t)(Sensor::getOrZero(SensorType::BatteryVoltage) * 10);
|
|
|
|
|
msg[0] = (tmp >> 8);
|
|
|
|
@ -971,7 +971,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x373 = 10Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x373, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x373, 8);
|
|
|
|
|
/* EGT1 */
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
@ -988,7 +988,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x374 = 10Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x374, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x374, 8);
|
|
|
|
|
/* EGT5 */
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
@ -1005,7 +1005,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x375 = 10Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x375, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x375, 8);
|
|
|
|
|
/* EGT9 */
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
@ -1022,7 +1022,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x376 = 10Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x376, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x376, 8);
|
|
|
|
|
/* Ambient Air Temperature */
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
@ -1041,7 +1041,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
if (cycle.isInterval(CI::_200ms)) {
|
|
|
|
|
/* 0x3E0 = 5Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x3E0, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x3E0, 8);
|
|
|
|
|
/* Coolant temperature in K y = x/10 */
|
|
|
|
|
tmp = ((Sensor::getOrZero(SensorType::Clt) + 273.15) * 10);
|
|
|
|
|
msg[0] = (tmp >> 8);
|
|
|
|
@ -1060,7 +1060,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x3E1 = 5Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x3E1, 6);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x3E1, 6);
|
|
|
|
|
/* Gearbox Oil Temperature */
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
@ -1074,7 +1074,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x3E2 = 5Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x3E2, 2);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x3E2, 2);
|
|
|
|
|
/* Fuel Level in Liters */
|
|
|
|
|
tmp = (Sensor::getOrZero(SensorType::FuelLevel)* 10);
|
|
|
|
|
msg[0] = (tmp >> 8);
|
|
|
|
@ -1083,7 +1083,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* 0x3E3 = 5Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x3E3, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x3E3, 8);
|
|
|
|
|
/* Fuel Trim Short Term Bank 1*/
|
|
|
|
|
msg[0] = 0x00;
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
@ -1100,7 +1100,7 @@ void canDashboardHaltech(CanCycle cycle) {
|
|
|
|
|
|
|
|
|
|
/* todo: 0x3E4 = 5Hz rate */
|
|
|
|
|
{
|
|
|
|
|
CanTxMessage msg(0x3E4, 8);
|
|
|
|
|
CanTxMessage msg(CanCategory::NBC, 0x3E4, 8);
|
|
|
|
|
msg[0] = 0x00; //unused
|
|
|
|
|
/* Switch status */
|
|
|
|
|
msg[1] = 0x00;
|
|
|
|
@ -1247,14 +1247,14 @@ void canDashboardAim(CanCycle cycle) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
transmitStruct<Aim5f0>(0x5f0, false);
|
|
|
|
|
transmitStruct<Aim5f1>(0x5f1, false);
|
|
|
|
|
transmitStruct<Aim5f2>(0x5f2, false);
|
|
|
|
|
transmitStruct<Aim5f3>(0x5f3, false);
|
|
|
|
|
transmitStruct<Aim5f4>(0x5f4, false);
|
|
|
|
|
transmitStruct<Aim5f5>(0x5f5, false);
|
|
|
|
|
transmitStruct<Aim5f6>(0x5f6, false);
|
|
|
|
|
transmitStruct<Aim5f7>(0x5f7, false);
|
|
|
|
|
transmitStruct<Aim5f0>(CanCategory::NBC, 0x5f0, false);
|
|
|
|
|
transmitStruct<Aim5f1>(CanCategory::NBC, 0x5f1, false);
|
|
|
|
|
transmitStruct<Aim5f2>(CanCategory::NBC, 0x5f2, false);
|
|
|
|
|
transmitStruct<Aim5f3>(CanCategory::NBC, 0x5f3, false);
|
|
|
|
|
transmitStruct<Aim5f4>(CanCategory::NBC, 0x5f4, false);
|
|
|
|
|
transmitStruct<Aim5f5>(CanCategory::NBC, 0x5f5, false);
|
|
|
|
|
transmitStruct<Aim5f6>(CanCategory::NBC, 0x5f6, false);
|
|
|
|
|
transmitStruct<Aim5f7>(CanCategory::NBC, 0x5f7, false);
|
|
|
|
|
|
|
|
|
|
// there are more, but less important for us
|
|
|
|
|
// transmitStruct<Aim5f8>(0x5f8, false);
|
|
|
|
|