fuelCutCode for lack of GDI4 communications #5631

only:proteus_f7
This commit is contained in:
rusefi 2023-10-23 13:25:53 -04:00
parent d17a2231ff
commit 381b9bb9e7
5 changed files with 17 additions and 2 deletions

View File

@ -12,6 +12,7 @@
#include "rusefi_lua.h"
#include "can_bench_test.h"
#include "can_common.h"
// todo: consume from fresh wideband_can.h https://github.com/rusefi/rusefi/issues/5208
#define WB_ACK 0x727573
@ -196,6 +197,12 @@ void processCanRxMessage(const size_t busIndex, const CANRxFrame &frame, efitick
obdOnCanPacketRx(frame, busIndex);
}
if (CAN_EID(frame) == GDI4_BASE_ADDRESS && frame.data8[7] == GDI4_MAGIC) {
efiPrintf("CAN GDI4 says hi");
getLimpManager()->gdiComms.reset();
}
#if EFI_WIDEBAND_FIRMWARE_UPDATE
// Bootloader acks with address 0x727573 aka ascii "rus"
if (CAN_EID(frame) == WB_ACK) {

View File

@ -69,6 +69,12 @@ void LimpManager::updateState(int rpm, efitick_t nowNt) {
}
#endif
if (isGdiEngine()) {
if (gdiComms.getElapsedSeconds() > 1) {
allowFuel.clear(ClearReason::GdiComms);
}
}
if (engine->engineState.lua.luaIgnCut) {
allowSpark.clear(ClearReason::Lua);
}

View File

@ -24,6 +24,7 @@ enum class ClearReason : uint8_t {
Lua, // 15
ACR, // 16 - Harley Automatic Compression Release
LambdaProtection, // 17
GdiComms,
// Keep this list in sync with fuelIgnCutCodeList in rusefi.input!
// todo: add a code generator between ClearReason and fuelIgnCutCodeList in rusefi.input
@ -124,6 +125,7 @@ public:
// Other subsystems call these APIs to indicate a problem has occurred
void reportEtbProblem();
void fatalError();
Timer gdiComms;
private:
void setFaultRevLimit(int limit);

@ -1 +1 @@
Subproject commit f58a5527ff6e40afd1e728763b819ab11cd48d57
Subproject commit 6b48a7ce0c60a9066a1d5876e2795fd0b58c7a22

View File

@ -237,7 +237,7 @@ enable2ndByteCanID = false
ignModeList = bits, U08, [0:3], "Single Coil", "Sequential", "Wasted", "Two Coils"
; ClearReason
fuelIgnCutCodeList = bits, U08, [0:7], "None", "fatal error", "setting disabled", "RPM limit", "fault RPM limit", "boost cut", "oil pressure", "stop requested", "ETB problem", "launch control", "max injector duty", "flood clear", "engine sync", "kickstart", "ign off", "Lua", "ACR", "Lambda Prot"
fuelIgnCutCodeList = bits, U08, [0:7], "None", "fatal error", "setting disabled", "RPM limit", "fault RPM limit", "boost cut", "oil pressure", "stop requested", "ETB problem", "launch control", "max injector duty", "flood clear", "engine sync", "kickstart", "ign off", "Lua", "ACR", "Lambda Prot", "GDI Comms"
; TpsState
etbCutCodeList = bits, U08, [0:7], "None", "engine stopped", "TPS error", "PPS error", "TPS noise", "PID noise", "Lua", "Manual", "N/A", "Redundancy", "PPS noise"