PROTEUS_GM_LS_4
This commit is contained in:
parent
476bf26b92
commit
0a0f803798
|
@ -176,8 +176,6 @@ void setBoardDefaultConfiguration() {
|
||||||
engineConfiguration->throttlePedalSecondaryWOTVoltage = 0.0;
|
engineConfiguration->throttlePedalSecondaryWOTVoltage = 0.0;
|
||||||
|
|
||||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
|
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
|
||||||
// would not hurt just in case no cam
|
|
||||||
engineConfiguration->twoWireBatchInjection = true;
|
|
||||||
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
||||||
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
||||||
|
|
||||||
|
@ -186,58 +184,4 @@ void setBoardDefaultConfiguration() {
|
||||||
engineConfiguration->launchActivationMode = CLUTCH_INPUT_LAUNCH;
|
engineConfiguration->launchActivationMode = CLUTCH_INPUT_LAUNCH;
|
||||||
// ? engineConfiguration->malfunctionIndicatorPin = Gpio::G4; //1E - Check Engine Light
|
// ? engineConfiguration->malfunctionIndicatorPin = Gpio::G4; //1E - Check Engine Light
|
||||||
|
|
||||||
strncpy(config->luaScript, R"(
|
|
||||||
|
|
||||||
function getBitRange(data, bitIndex, bitWidth)
|
|
||||||
byteIndex = bitIndex >> 3
|
|
||||||
shift = bitIndex - byteIndex * 8
|
|
||||||
value = data[1 + byteIndex]
|
|
||||||
if (shift + bitWidth > 8) then
|
|
||||||
value = value + data[2 + byteIndex] * 256
|
|
||||||
end
|
|
||||||
mask = (1 << bitWidth) - 1
|
|
||||||
return (value >> shift) & mask
|
|
||||||
end
|
|
||||||
|
|
||||||
STARTER_OUTPUT_INDEX = 0
|
|
||||||
startPwm(STARTER_OUTPUT_INDEX, 100, 0)
|
|
||||||
|
|
||||||
-- 201
|
|
||||||
ECMEngineStatus = 0xC9
|
|
||||||
IGN_STATUS = 0x1f1
|
|
||||||
-- 0x514
|
|
||||||
VIN_Part1 = 1300
|
|
||||||
-- 04E1
|
|
||||||
VIN_Part2 = 1249
|
|
||||||
|
|
||||||
setTickRate(100)
|
|
||||||
|
|
||||||
function canIgnStatus(bus, id, dlc, data)
|
|
||||||
crankingBits = getBitRange(data, 2, 2)
|
|
||||||
isCranking = (crankingBits == 2)
|
|
||||||
print('crankingBits ' .. crankingBits .. ', isCranking ' .. isCranking)
|
|
||||||
end
|
|
||||||
|
|
||||||
canRxAdd(IGN_STATUS, canIgnStatus)
|
|
||||||
|
|
||||||
-- todo: take VIN from configuration? encode VIN?
|
|
||||||
canVin1 = { 0x47, 0x4E, 0x4C, 0x43, 0x32, 0x45, 0x30, 0x34 }
|
|
||||||
canVin2 = { 0x42, 0x52, 0x32, 0x31, 0x36, 0x33, 0x36, 0x36 }
|
|
||||||
dataECMEngineStatus = { 0x84, 0x09, 0x99, 0x0A, 0x00, 0x40, 0x08, 0x00 }
|
|
||||||
|
|
||||||
function onTick()
|
|
||||||
txCan(1, VIN_Part1, 0, canVin1)
|
|
||||||
txCan(1, VIN_Part2, 0, canVin2)
|
|
||||||
|
|
||||||
-- good enough for fuel module!
|
|
||||||
txCan(1, ECMEngineStatus, 0, dataECMEngineStatus)
|
|
||||||
|
|
||||||
if isCranking then
|
|
||||||
setPwmDuty(STARTER_OUTPUT_INDEX, 1)
|
|
||||||
else
|
|
||||||
setPwmDuty(STARTER_OUTPUT_INDEX, 0)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
)", efi::size(config->luaScript));
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,10 @@
|
||||||
void setGmLs4() {
|
void setGmLs4() {
|
||||||
engineConfiguration->globalTriggerAngleOffset = 86;
|
engineConfiguration->globalTriggerAngleOffset = 86;
|
||||||
|
|
||||||
|
// would not hurt just in case no cam
|
||||||
|
engineConfiguration->twoWireBatchInjection = true;
|
||||||
|
|
||||||
|
|
||||||
engineConfiguration->fuelReferencePressure = 400; // 400 kPa, 58 psi
|
engineConfiguration->fuelReferencePressure = 400; // 400 kPa, 58 psi
|
||||||
engineConfiguration->injectorCompensationMode = ICM_FixedRailPressure;
|
engineConfiguration->injectorCompensationMode = ICM_FixedRailPressure;
|
||||||
engineConfiguration->injector.flow = 440;
|
engineConfiguration->injector.flow = 440;
|
||||||
|
@ -23,4 +27,65 @@ void setGmLs4() {
|
||||||
|
|
||||||
engineConfiguration->tChargeAirIncrLimit = 5;
|
engineConfiguration->tChargeAirIncrLimit = 5;
|
||||||
engineConfiguration->tChargeAirDecrLimit = 15;
|
engineConfiguration->tChargeAirDecrLimit = 15;
|
||||||
|
|
||||||
|
strncpy(config->luaScript, R"(
|
||||||
|
|
||||||
|
function getBitRange(data, bitIndex, bitWidth)
|
||||||
|
byteIndex = bitIndex >> 3
|
||||||
|
shift = bitIndex - byteIndex * 8
|
||||||
|
value = data[1 + byteIndex]
|
||||||
|
if (shift + bitWidth > 8) then
|
||||||
|
value = value + data[2 + byteIndex] * 256
|
||||||
|
end
|
||||||
|
mask = (1 << bitWidth) - 1
|
||||||
|
return (value >> shift) & mask
|
||||||
|
end
|
||||||
|
|
||||||
|
STARTER_OUTPUT_INDEX = 0
|
||||||
|
startPwm(STARTER_OUTPUT_INDEX, 100, 0)
|
||||||
|
|
||||||
|
-- 201
|
||||||
|
ECMEngineStatus = 0xC9
|
||||||
|
IGN_STATUS = 0x1f1
|
||||||
|
-- 0x514
|
||||||
|
VIN_Part1 = 1300
|
||||||
|
-- 04E1
|
||||||
|
VIN_Part2 = 1249
|
||||||
|
|
||||||
|
setTickRate(100)
|
||||||
|
|
||||||
|
function canIgnStatus(bus, id, dlc, data)
|
||||||
|
crankingBits = getBitRange(data, 2, 2)
|
||||||
|
isCranking = (crankingBits == 2)
|
||||||
|
print('crankingBits ' .. crankingBits .. ', isCranking ' .. isCranking)
|
||||||
|
end
|
||||||
|
|
||||||
|
canRxAdd(IGN_STATUS, canIgnStatus)
|
||||||
|
|
||||||
|
-- todo: take VIN from configuration? encode VIN?
|
||||||
|
canVin1 = { 0x47, 0x4E, 0x4C, 0x43, 0x32, 0x45, 0x30, 0x34 }
|
||||||
|
canVin2 = { 0x42, 0x52, 0x32, 0x31, 0x36, 0x33, 0x36, 0x36 }
|
||||||
|
dataECMEngineStatus = { 0x84, 0x09, 0x99, 0x0A, 0x00, 0x40, 0x08, 0x00 }
|
||||||
|
|
||||||
|
function onTick()
|
||||||
|
txCan(1, VIN_Part1, 0, canVin1)
|
||||||
|
txCan(1, VIN_Part2, 0, canVin2)
|
||||||
|
|
||||||
|
-- good enough for fuel module!
|
||||||
|
txCan(1, ECMEngineStatus, 0, dataECMEngineStatus)
|
||||||
|
|
||||||
|
if isCranking then
|
||||||
|
setPwmDuty(STARTER_OUTPUT_INDEX, 1)
|
||||||
|
else
|
||||||
|
setPwmDuty(STARTER_OUTPUT_INDEX, 0)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
)", efi::size(config->luaScript));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void setProteusGmLs4() {
|
||||||
|
setGmLs4();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* gm_ls_4.h
|
* gm_ls_4.h
|
||||||
*
|
*
|
||||||
* Created on: 25 îêò. 2022 ã.
|
* Created on: 25 <EFBFBD><EFBFBD><EFBFBD>. 2022 <EFBFBD>.
|
||||||
* Author: Huge
|
* Author: Huge
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -10,3 +10,4 @@
|
||||||
#include "engine_configuration.h"
|
#include "engine_configuration.h"
|
||||||
|
|
||||||
void setGmLs4();
|
void setGmLs4();
|
||||||
|
void setProteusGmLs4();
|
||||||
|
|
|
@ -870,6 +870,9 @@ void resetConfigurationExt(configuration_callback_t boardCallback, engine_type_e
|
||||||
break;
|
break;
|
||||||
#endif // HW_MICRO_RUSEFI
|
#endif // HW_MICRO_RUSEFI
|
||||||
#if HW_PROTEUS
|
#if HW_PROTEUS
|
||||||
|
case PROTEUS_GM_LS_4:
|
||||||
|
setProteusGmLs4();
|
||||||
|
break;
|
||||||
case PROTEUS_VW_B6:
|
case PROTEUS_VW_B6:
|
||||||
setProteusVwPassatB6();
|
setProteusVwPassatB6();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1959,6 +1959,7 @@ cmd_set_engine_type_microRusEFI_Miata_NB2_MAP = "@@TS_IO_TEST_COMMAND_char@@@@t
|
||||||
|
|
||||||
cmd_set_engine_type_microRusEFI_VW_B6 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_MRE_VW_B6_16_hex@@"
|
cmd_set_engine_type_microRusEFI_VW_B6 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_MRE_VW_B6_16_hex@@"
|
||||||
cmd_set_engine_type_Proteus_VW_B6 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_PROTEUS_VW_B6_16_hex@@"
|
cmd_set_engine_type_Proteus_VW_B6 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_PROTEUS_VW_B6_16_hex@@"
|
||||||
|
cmd_set_engine_type_PROTEUS_GM_LS_4 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_PROTEUS_GM_LS_4_16_hex@@"
|
||||||
cmd_set_engine_type_microRusEFI_MRE_BODY_CONTROL = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_MRE_BODY_CONTROL_16_hex@@"
|
cmd_set_engine_type_microRusEFI_MRE_BODY_CONTROL = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_MRE_BODY_CONTROL_16_hex@@"
|
||||||
cmd_set_engine_type_MRE_SECONDARY_CAN = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_MRE_SECONDARY_CAN_16_hex@@"
|
cmd_set_engine_type_MRE_SECONDARY_CAN = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_MRE_SECONDARY_CAN_16_hex@@"
|
||||||
|
|
||||||
|
@ -2010,6 +2011,7 @@ cmd_set_engine_type_Frankenso_Miata_NB2 = "@@TS_IO_TEST_COMMAND_char@@@@ts_co
|
||||||
|
|
||||||
cmd_set_engine_type_Proteus_M73 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_PROTEUS_BMW_M73_16_hex@@"
|
cmd_set_engine_type_Proteus_M73 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_PROTEUS_BMW_M73_16_hex@@"
|
||||||
cmd_set_engine_type_PROTEUS_VW_B6 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_PROTEUS_VW_B6_16_hex@@"
|
cmd_set_engine_type_PROTEUS_VW_B6 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_PROTEUS_VW_B6_16_hex@@"
|
||||||
|
cmd_set_engine_type_PROTEUS_GM_LS_4 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_PROTEUS_GM_LS_4_16_hex@@"
|
||||||
cmd_set_engine_type_PROTEUS_HONDA_K = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_PROTEUS_HONDA_K_16_hex@@"
|
cmd_set_engine_type_PROTEUS_HONDA_K = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_PROTEUS_HONDA_K_16_hex@@"
|
||||||
cmd_set_engine_type_PROTEUS_HONDA_OBD2A = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_PROTEUS_HONDA_OBD2A_16_hex@@"
|
cmd_set_engine_type_PROTEUS_HONDA_OBD2A = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_PROTEUS_HONDA_OBD2A_16_hex@@"
|
||||||
cmd_set_engine_type_PROTEUS_MIATA_NB2 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_PROTEUS_MIATA_NB2_16_hex@@"
|
cmd_set_engine_type_PROTEUS_MIATA_NB2 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_PROTEUS_MIATA_NB2_16_hex@@"
|
||||||
|
|
Loading…
Reference in New Issue