genesis coupe

This commit is contained in:
rusefillc 2021-07-28 17:18:44 -04:00
parent f93e59ea3d
commit d9cc35bd31
1 changed files with 24 additions and 1 deletions

View File

@ -66,6 +66,9 @@
static time_msecs_t mph_timer;
static time_msecs_t mph_ctr;
#define GENESIS_COUPLE_RPM_316 0x316
#define GENESIS_COUPLE_COOLANT_329 0x329
#define NISSAN_RPM_1F9 0x1F9
// Nissan z33 350Z and else
// 0x23d = 573
@ -96,6 +99,7 @@ void canDashboardW202(CanCycle cycle);
void canDashboardBMWE90(CanCycle cycle);
void canDashboardVagMqb(CanCycle cycle);
void canDashboardNissanVQ(CanCycle cycle);
void canDashboardGenesisCoupe(CanCycle cycle);
void updateDash(CanCycle cycle) {
@ -125,6 +129,9 @@ void updateDash(CanCycle cycle) {
case CAN_BUS_NISSAN_VQ:
canDashboardNissanVQ(cycle);
break;
case CAN_BUS_GENESIS_COUPE:
canDashboardGenesisCoupe(cycle);
break;
default:
break;
}
@ -305,6 +312,22 @@ void canDashboardW202(CanCycle cycle) {
static int rollingId = 0;
void canDashboardGenesisCoupe(CanCycle cycle) {
if (cycle.isInterval(CI::_50ms)) {
{
CanTxMessage msg(GENESIS_COUPLE_RPM_316, 8);
int rpm8 = GET_RPM() * 4;
msg[3] = rpm8 >> 8;
msg[4] = rpm8 & 0xFF;
}
{
CanTxMessage msg(GENESIS_COUPLE_COOLANT_329, 8);
int clt = Sensor::get(SensorType::Clt).value_or(0) * 2;
msg[1] = clt;
}
}
}
void canDashboardNissanVQ(CanCycle cycle) {
if (cycle.isInterval(CI::_50ms)) {
{
@ -318,7 +341,7 @@ void canDashboardNissanVQ(CanCycle cycle) {
{
CanTxMessage msg(NISSAN_CLT_551, 8);
int clt = 40; // todo read sensor
int clt = Sensor::get(SensorType::Clt).value_or(0);
msg[0] = clt + 45;
}