2021-10-02 10:25:40 -07:00
|
|
|
/*
|
|
|
|
* bmw_n73.cpp
|
|
|
|
*
|
|
|
|
* @date Oct 2, 2021
|
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2021
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "bmw_n73.h"
|
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
void setEngineProteusBMW_N73_GDI() {
|
2021-10-02 10:25:40 -07:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-12-23 13:59:30 -08:00
|
|
|
void setEngineProteusGearboxManInTheMiddle() {
|
|
|
|
strncpy(config->luaScript, R"(
|
|
|
|
|
|
|
|
CAN_BMW_E90_RPM_THROTTLE = 0x0AA
|
|
|
|
CAN_BMW_E90_TORQUE_DEMAND = 0x0B6
|
|
|
|
CAN_BMW_E90_IGNITION_KEY = 0x130
|
|
|
|
CAN_BMW_E65_GEAR_SELECTOR = 0x192
|
|
|
|
CAN_BMW_E90_COOLANT = 0x1D0
|
|
|
|
CAN_BMW_E90_DASH_ON = 0x332
|
|
|
|
|
|
|
|
ECU_BUS = 1
|
|
|
|
GEAR_BUS = 2
|
|
|
|
|
|
|
|
canRxAdd(CAN_BMW_E90_RPM_THROTTLE)
|
|
|
|
canRxAdd(CAN_BMW_E90_TORQUE_DEMAND)
|
|
|
|
canRxAdd(CAN_BMW_E90_IGNITION_KEY)
|
|
|
|
canRxAdd(CAN_BMW_E65_GEAR_SELECTOR)
|
|
|
|
canRxAdd(CAN_BMW_E90_COOLANT)
|
|
|
|
canRxAdd(CAN_BMW_E90_DASH_ON)
|
|
|
|
|
|
|
|
txPayload = {}
|
2021-12-23 20:09:52 -08:00
|
|
|
|
|
|
|
function onCanRx(bus, id, dlc, data)
|
|
|
|
id = id % 2048
|
|
|
|
-- local output = string.format("%x", id)
|
|
|
|
|
|
|
|
if id == CAN_BMW_E90_IGNITION_KEY then
|
|
|
|
print('CAN_BMW_E90_IGNITION_KEY')
|
|
|
|
else
|
|
|
|
if id == CAN_BMW_E65_GEAR_SELECTOR then
|
|
|
|
print('CAN_BMW_E65_GEAR_SELECTOR')
|
|
|
|
else
|
|
|
|
if id == CAN_BMW_E90_RPM_THROTTLE then
|
|
|
|
print('CAN_BMW_E90_RPM_THROTTLE')
|
|
|
|
else
|
|
|
|
if id == CAN_BMW_E90_COOLANT then
|
|
|
|
print('CAN_BMW_E90_COOLANT')
|
|
|
|
else
|
|
|
|
print('got CAN id=' ..id ..' dlc=' ..dlc)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2021-12-23 13:59:30 -08:00
|
|
|
function onTick()
|
|
|
|
end
|
|
|
|
)", efi::size(config->luaScript));
|
|
|
|
|
|
|
|
|
|
|
|
}
|