This commit is contained in:
rusefillc 2021-07-05 18:28:26 -04:00
parent 43e6cef77d
commit 9814264bdf
4 changed files with 15 additions and 0 deletions

View File

@ -143,6 +143,7 @@ void setBoardDefaultConfiguration(void) {
engineConfiguration->isSdCardEnabled = true;
CONFIG(enableSoftwareKnock) = true;
CONFIG(canNbcType) = CAN_BUS_NISSAN_VQ;
engineConfiguration->canTxPin = GPIOD_1;
engineConfiguration->canRxPin = GPIOD_0;

View File

@ -299,7 +299,14 @@ void canDashboardW202(CanCycle cycle) {
void canDashboardNissanVQ(CanCycle cycle) {
if (cycle.isInterval(CI::_50ms)) {
{
CanTxMessage msg(NISSAN_RPM_CLT, 8);
msg[4] = ((int)(GET_RPM() / 4)) & 0xFF;
msg[5] = ((int)(GET_RPM() / 4)) >> 8;
msg[7] = 0x70; // todo: CLT decoding?
}
}
}

View File

@ -362,6 +362,12 @@ void TriggerCentral::validateCamVvtCounters() {
}
}
void TriggerState::syncSymmetricalCrank(int mod, int remainder) {
while (getTotalRevolutionCounter() % mod != remainder) {
incrementTotalEventCounter();
}
}
void TriggerState::incrementTotalEventCounter() {
totalRevolutionCounter++;
}

View File

@ -91,6 +91,7 @@ public:
*/
bool isEvenRevolution() const;
void incrementTotalEventCounter();
void syncSymmetricalCrank(int mod, int remainder);
efitime_t getTotalEventCounter() const;
void decodeTriggerEvent(