mirror of https://github.com/FOME-Tech/fome-fw.git
Engine modules participate in the build system (#452)
* infrastructure for engine modules in the build * fully move fuel pump * fan * gear detector * gear detect * fan control cleanup * trip odometer * shuffle makefiles around a little * minor format
This commit is contained in:
parent
c641a685b7
commit
ff5e47c95d
|
@ -23,8 +23,9 @@ err.txt
|
||||||
log.txt
|
log.txt
|
||||||
*.rusefi_binary
|
*.rusefi_binary
|
||||||
*.msq
|
*.msq
|
||||||
gitversion.h
|
gitversion.h*
|
||||||
gitversion.h.gen
|
engine_modules_generated.h*
|
||||||
|
modules_list_generated.h*
|
||||||
|
|
||||||
# Eclipse
|
# Eclipse
|
||||||
.metadata/
|
.metadata/
|
||||||
|
|
|
@ -200,6 +200,7 @@ endif
|
||||||
|
|
||||||
include $(PROJECT_DIR)/hw_layer/mass_storage/mass_storage.mk
|
include $(PROJECT_DIR)/hw_layer/mass_storage/mass_storage.mk
|
||||||
include $(PROJECT_DIR)/common.mk
|
include $(PROJECT_DIR)/common.mk
|
||||||
|
include $(PROJECT_DIR)/controllers/modules/modules.mk
|
||||||
|
|
||||||
ifeq ($(USE_OPENBLT),yes)
|
ifeq ($(USE_OPENBLT),yes)
|
||||||
# Reserve start of flash for OpenBLT
|
# Reserve start of flash for OpenBLT
|
||||||
|
@ -239,6 +240,7 @@ CPPSRC = \
|
||||||
$(HW_LAYER_DRIVERS_CORE_CPP) \
|
$(HW_LAYER_DRIVERS_CORE_CPP) \
|
||||||
$(HW_LAYER_DRIVERS_CPP) \
|
$(HW_LAYER_DRIVERS_CPP) \
|
||||||
$(CONSOLE_SRC_CPP) \
|
$(CONSOLE_SRC_CPP) \
|
||||||
|
$(MODULES_CPPSRC) \
|
||||||
$(RUSEFI_LIB_CPP) \
|
$(RUSEFI_LIB_CPP) \
|
||||||
rusefi.cpp \
|
rusefi.cpp \
|
||||||
main.cpp
|
main.cpp
|
||||||
|
@ -275,6 +277,7 @@ INCDIR = \
|
||||||
$(PCH_DIR) \
|
$(PCH_DIR) \
|
||||||
$(BOARDINC) \
|
$(BOARDINC) \
|
||||||
$(ALLINC) \
|
$(ALLINC) \
|
||||||
|
$(MODULES_INC) \
|
||||||
$(TESTINC) \
|
$(TESTINC) \
|
||||||
$(CHIBIOS)/os/various \
|
$(CHIBIOS)/os/various \
|
||||||
$(RUSEFI_LIB_INC) \
|
$(RUSEFI_LIB_INC) \
|
||||||
|
@ -360,6 +363,7 @@ include $(RULESFILE)
|
||||||
include $(PROJECT_DIR)/rusefi_pch.mk
|
include $(PROJECT_DIR)/rusefi_pch.mk
|
||||||
include $(PROJECT_DIR)/fome_generated.mk
|
include $(PROJECT_DIR)/fome_generated.mk
|
||||||
include $(PROJECT_DIR)/gitversion.mk
|
include $(PROJECT_DIR)/gitversion.mk
|
||||||
|
include $(PROJECT_DIR)/controllers/modules/modules_header_gen.mk
|
||||||
|
|
||||||
.PHONY: CLEAN_RULE_HOOK CLEAN_PCH_HOOK CLEAN_BUNDLE_HOOK
|
.PHONY: CLEAN_RULE_HOOK CLEAN_PCH_HOOK CLEAN_BUNDLE_HOOK
|
||||||
|
|
||||||
|
|
|
@ -341,6 +341,7 @@ include $(RULESFILE)
|
||||||
include $(PROJECT_DIR)/rusefi_pch.mk
|
include $(PROJECT_DIR)/rusefi_pch.mk
|
||||||
include $(PROJECT_DIR)/fome_generated.mk
|
include $(PROJECT_DIR)/fome_generated.mk
|
||||||
include $(PROJECT_DIR)/gitversion.mk
|
include $(PROJECT_DIR)/gitversion.mk
|
||||||
|
include $(PROJECT_DIR)/controllers/modules/modules_header_gen.mk
|
||||||
|
|
||||||
.PHONY: CLEAN_RULE_HOOK CLEAN_PCH_HOOK CLEAN_BUNDLE_HOOK
|
.PHONY: CLEAN_RULE_HOOK CLEAN_PCH_HOOK CLEAN_BUNDLE_HOOK
|
||||||
|
|
||||||
|
|
|
@ -344,9 +344,12 @@ static void updateVvtSensors() {
|
||||||
static void updateVehicleSpeed() {
|
static void updateVehicleSpeed() {
|
||||||
#if EFI_VEHICLE_SPEED
|
#if EFI_VEHICLE_SPEED
|
||||||
engine->outputChannels.vehicleSpeedKph = Sensor::getOrZero(SensorType::VehicleSpeed);
|
engine->outputChannels.vehicleSpeedKph = Sensor::getOrZero(SensorType::VehicleSpeed);
|
||||||
|
#endif // EFI_VEHICLE_SPEED
|
||||||
|
|
||||||
|
#ifdef MODULE_GEAR_DETECT
|
||||||
engine->outputChannels.speedToRpmRatio = engine->module<GearDetector>()->getGearboxRatio();
|
engine->outputChannels.speedToRpmRatio = engine->module<GearDetector>()->getGearboxRatio();
|
||||||
engine->outputChannels.detectedGear = Sensor::getOrZero(SensorType::DetectedGear);
|
engine->outputChannels.detectedGear = Sensor::getOrZero(SensorType::DetectedGear);
|
||||||
#endif /* EFI_VEHICLE_SPEED */
|
#endif // MODULE_GEAR_DETECT
|
||||||
}
|
}
|
||||||
|
|
||||||
static void updateRawSensors() {
|
static void updateRawSensors() {
|
||||||
|
@ -424,6 +427,7 @@ static void updateFuelCorrections() {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void updateFuelResults() {
|
static void updateFuelResults() {
|
||||||
|
#ifdef MODULE_TRIP_ODO
|
||||||
engine->outputChannels.fuelFlowRate = engine->module<TripOdometer>()->getConsumptionGramPerSecond();
|
engine->outputChannels.fuelFlowRate = engine->module<TripOdometer>()->getConsumptionGramPerSecond();
|
||||||
engine->outputChannels.totalFuelConsumption = engine->module<TripOdometer>()->getConsumedGrams();
|
engine->outputChannels.totalFuelConsumption = engine->module<TripOdometer>()->getConsumedGrams();
|
||||||
engine->outputChannels.ignitionOnTime = engine->module<TripOdometer>()->getIgnitionOnTime();
|
engine->outputChannels.ignitionOnTime = engine->module<TripOdometer>()->getIgnitionOnTime();
|
||||||
|
@ -431,6 +435,7 @@ static void updateFuelResults() {
|
||||||
|
|
||||||
// output channel in km
|
// output channel in km
|
||||||
engine->outputChannels.distanceTraveled = 0.001f * engine->module<TripOdometer>()->getDistanceMeters();
|
engine->outputChannels.distanceTraveled = 0.001f * engine->module<TripOdometer>()->getDistanceMeters();
|
||||||
|
#endif // MODULE_TRIP_ODO
|
||||||
}
|
}
|
||||||
|
|
||||||
static void updateFuelInfo() {
|
static void updateFuelInfo() {
|
||||||
|
|
|
@ -14,7 +14,6 @@ CONTROLLERS_ALGO_SRC_CPP = $(PROJECT_DIR)/controllers/algo/advance_map.cpp \
|
||||||
$(PROJECT_DIR)/controllers/algo/engine_configuration.cpp \
|
$(PROJECT_DIR)/controllers/algo/engine_configuration.cpp \
|
||||||
$(PROJECT_DIR)/controllers/algo/engine.cpp \
|
$(PROJECT_DIR)/controllers/algo/engine.cpp \
|
||||||
$(PROJECT_DIR)/controllers/algo/engine2.cpp \
|
$(PROJECT_DIR)/controllers/algo/engine2.cpp \
|
||||||
$(PROJECT_DIR)/controllers/algo/gear_detector.cpp \
|
|
||||||
$(PROJECT_DIR)/controllers/algo/event_registry.cpp \
|
$(PROJECT_DIR)/controllers/algo/event_registry.cpp \
|
||||||
$(PROJECT_DIR)/controllers/algo/airmass/airmass.cpp \
|
$(PROJECT_DIR)/controllers/algo/airmass/airmass.cpp \
|
||||||
$(PROJECT_DIR)/controllers/algo/airmass/alphan_airmass.cpp \
|
$(PROJECT_DIR)/controllers/algo/airmass/alphan_airmass.cpp \
|
||||||
|
@ -24,7 +23,6 @@ CONTROLLERS_ALGO_SRC_CPP = $(PROJECT_DIR)/controllers/algo/advance_map.cpp \
|
||||||
$(PROJECT_DIR)/controllers/algo/fuel/fuel_computer.cpp \
|
$(PROJECT_DIR)/controllers/algo/fuel/fuel_computer.cpp \
|
||||||
$(PROJECT_DIR)/controllers/algo/fuel/injector_model.cpp \
|
$(PROJECT_DIR)/controllers/algo/fuel/injector_model.cpp \
|
||||||
$(PROJECT_DIR)/controllers/algo/fuel/dfco.cpp \
|
$(PROJECT_DIR)/controllers/algo/fuel/dfco.cpp \
|
||||||
$(PROJECT_DIR)/controllers/algo/trip_odometer.cpp \
|
|
||||||
$(PROJECT_DIR)/controllers/algo/defaults/default_base_engine.cpp \
|
$(PROJECT_DIR)/controllers/algo/defaults/default_base_engine.cpp \
|
||||||
$(PROJECT_DIR)/controllers/algo/defaults/default_cranking.cpp \
|
$(PROJECT_DIR)/controllers/algo/defaults/default_cranking.cpp \
|
||||||
$(PROJECT_DIR)/controllers/algo/defaults/default_fuel.cpp \
|
$(PROJECT_DIR)/controllers/algo/defaults/default_fuel.cpp \
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
#include "speedometer.h"
|
#include "speedometer.h"
|
||||||
#include "dynoview.h"
|
#include "dynoview.h"
|
||||||
#include "boost_control.h"
|
#include "boost_control.h"
|
||||||
#include "fan_control.h"
|
|
||||||
#include "ac_control.h"
|
#include "ac_control.h"
|
||||||
#include "vr_pwm.h"
|
#include "vr_pwm.h"
|
||||||
#if EFI_MC33816
|
#if EFI_MC33816
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
#include "launch_control.h"
|
#include "launch_control.h"
|
||||||
#include "antilag_system.h"
|
#include "antilag_system.h"
|
||||||
#include "trigger_scheduler.h"
|
#include "trigger_scheduler.h"
|
||||||
#include "fuel_pump.h"
|
|
||||||
#include "main_relay.h"
|
#include "main_relay.h"
|
||||||
#include "ac_control.h"
|
#include "ac_control.h"
|
||||||
#include "type_list.h"
|
#include "type_list.h"
|
||||||
|
@ -42,16 +41,15 @@
|
||||||
#include "harley_acr.h"
|
#include "harley_acr.h"
|
||||||
#include "dfco.h"
|
#include "dfco.h"
|
||||||
#include "fuel_computer.h"
|
#include "fuel_computer.h"
|
||||||
#include "gear_detector.h"
|
|
||||||
#include "advance_map.h"
|
#include "advance_map.h"
|
||||||
#include "fan_control.h"
|
|
||||||
#include "sensor_checker.h"
|
#include "sensor_checker.h"
|
||||||
#include "fuel_schedule.h"
|
#include "fuel_schedule.h"
|
||||||
#include "prime_injection.h"
|
#include "prime_injection.h"
|
||||||
#include "throttle_model.h"
|
#include "throttle_model.h"
|
||||||
#include "lambda_monitor.h"
|
#include "lambda_monitor.h"
|
||||||
#include "vvt.h"
|
#include "vvt.h"
|
||||||
#include "trip_odometer.h"
|
|
||||||
|
#include "engine_modules_generated.h"
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
|
@ -156,20 +154,13 @@ public:
|
||||||
#if EFI_ALTERNATOR_CONTROL
|
#if EFI_ALTERNATOR_CONTROL
|
||||||
AlternatorController,
|
AlternatorController,
|
||||||
#endif /* EFI_ALTERNATOR_CONTROL */
|
#endif /* EFI_ALTERNATOR_CONTROL */
|
||||||
FuelPumpController,
|
|
||||||
MainRelayController,
|
MainRelayController,
|
||||||
IgnitionController,
|
IgnitionController,
|
||||||
Mockable<AcController>,
|
Mockable<AcController>,
|
||||||
FanControl1,
|
|
||||||
FanControl2,
|
|
||||||
PrimeController,
|
PrimeController,
|
||||||
DfcoController,
|
DfcoController,
|
||||||
HarleyAcr,
|
HarleyAcr,
|
||||||
Mockable<WallFuelController>,
|
Mockable<WallFuelController>,
|
||||||
#if EFI_VEHICLE_SPEED
|
|
||||||
GearDetector,
|
|
||||||
TripOdometer,
|
|
||||||
#endif // EFI_VEHICLE_SPEED
|
|
||||||
KnockController,
|
KnockController,
|
||||||
SensorChecker,
|
SensorChecker,
|
||||||
LimpManager,
|
LimpManager,
|
||||||
|
@ -183,6 +174,9 @@ public:
|
||||||
BoostController,
|
BoostController,
|
||||||
#endif // EFI_BOOST_CONTROL
|
#endif // EFI_BOOST_CONTROL
|
||||||
LedBlinkingTask,
|
LedBlinkingTask,
|
||||||
|
|
||||||
|
#include "modules_list_generated.h"
|
||||||
|
|
||||||
EngineModule // dummy placeholder so the previous entries can all have commas
|
EngineModule // dummy placeholder so the previous entries can all have commas
|
||||||
> engineModules;
|
> engineModules;
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,10 @@ static void populateFrame(Status& msg) {
|
||||||
|
|
||||||
msg.gear = Sensor::getOrZero(SensorType::DetectedGear);
|
msg.gear = Sensor::getOrZero(SensorType::DetectedGear);
|
||||||
|
|
||||||
|
#ifdef MODULE_TRIP_ODO
|
||||||
// scale to units of 0.1km
|
// scale to units of 0.1km
|
||||||
msg.distanceTraveled = engine->module<TripOdometer>()->getDistanceMeters() / 100;
|
msg.distanceTraveled = engine->module<TripOdometer>()->getDistanceMeters() / 100;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Speeds {
|
struct Speeds {
|
||||||
|
@ -158,8 +160,10 @@ struct Fueling2 {
|
||||||
};
|
};
|
||||||
|
|
||||||
static void populateFrame(Fueling2& msg) {
|
static void populateFrame(Fueling2& msg) {
|
||||||
msg.fuelConsumedGram = engine->module<TripOdometer>()->getConsumedGrams();
|
#ifdef MODULE_TRIP_ODO
|
||||||
msg.fuelFlowRate = engine->module<TripOdometer>()->getConsumptionGramPerSecond();
|
msg.fuelConsumedGram = engine->module<TripOdometer>()->getConsumedGrams();
|
||||||
|
msg.fuelFlowRate = engine->module<TripOdometer>()->getConsumptionGramPerSecond();
|
||||||
|
#endif // MODULE_TRIP_ODO
|
||||||
|
|
||||||
for (size_t i = 0; i < 2; i++) {
|
for (size_t i = 0; i < 2; i++) {
|
||||||
msg.fuelTrim[i] = 100.0f * (engine->stftCorrection[i] - 1.0f);
|
msg.fuelTrim[i] = 100.0f * (engine->stftCorrection[i] - 1.0f);
|
||||||
|
|
|
@ -160,12 +160,15 @@ static void handleGetDataRequest(const CANRxFrame& rx, CanBusIndex busIndex) {
|
||||||
|
|
||||||
obdSendPacket(1, pid, 4, scaled << 16, busIndex);
|
obdSendPacket(1, pid, 4, scaled << 16, busIndex);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef MODULE_TRIP_ODO
|
||||||
} case PID_FUEL_RATE: {
|
} case PID_FUEL_RATE: {
|
||||||
float gPerSecond = engine->module<TripOdometer>()->getConsumptionGramPerSecond();
|
float gPerSecond = engine->module<TripOdometer>()->getConsumptionGramPerSecond();
|
||||||
float gPerHour = gPerSecond * 3600;
|
float gPerHour = gPerSecond * 3600;
|
||||||
float literPerHour = gPerHour * 0.00139f;
|
float literPerHour = gPerHour * 0.00139f;
|
||||||
obdSendValue(_1_MODE, pid, 2, literPerHour * 20.0f, busIndex); // L/h. (A*256+B)/20
|
obdSendValue(_1_MODE, pid, 2, literPerHour * 20.0f, busIndex); // L/h. (A*256+B)/20
|
||||||
break;
|
break;
|
||||||
|
#endif // MODULE_TRIP_ODO
|
||||||
} default:
|
} default:
|
||||||
// ignore unhandled PIDs
|
// ignore unhandled PIDs
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -13,8 +13,6 @@ CONTROLLERS_SRC_CPP = \
|
||||||
$(CONTROLLERS_DIR)/actuators/alternator_controller.cpp \
|
$(CONTROLLERS_DIR)/actuators/alternator_controller.cpp \
|
||||||
$(CONTROLLERS_DIR)/actuators/boost_control.cpp \
|
$(CONTROLLERS_DIR)/actuators/boost_control.cpp \
|
||||||
$(CONTROLLERS_DIR)/actuators/dc_motors.cpp \
|
$(CONTROLLERS_DIR)/actuators/dc_motors.cpp \
|
||||||
$(CONTROLLERS_DIR)/actuators/fan_control.cpp \
|
|
||||||
$(CONTROLLERS_DIR)/actuators/fuel_pump.cpp \
|
|
||||||
$(CONTROLLERS_DIR)/actuators/harley_acr.cpp \
|
$(CONTROLLERS_DIR)/actuators/harley_acr.cpp \
|
||||||
$(CONTROLLERS_DIR)/actuators/idle_thread_io.cpp \
|
$(CONTROLLERS_DIR)/actuators/idle_thread_io.cpp \
|
||||||
$(CONTROLLERS_DIR)/actuators/idle_hardware.cpp \
|
$(CONTROLLERS_DIR)/actuators/idle_hardware.cpp \
|
||||||
|
|
|
@ -115,12 +115,14 @@ void InjectionEvent::onTriggerTooth(efitick_t nowNt, float currentPhase, float n
|
||||||
{
|
{
|
||||||
// Log this fuel as consumed
|
// Log this fuel as consumed
|
||||||
|
|
||||||
|
#ifdef MODULE_TRIP_ODO
|
||||||
bool isCranking = getEngineRotationState()->isCranking();
|
bool isCranking = getEngineRotationState()->isCranking();
|
||||||
int numberOfInjections = isCranking ? getNumberOfInjections(engineConfiguration->crankingInjectionMode) : getNumberOfInjections(engineConfiguration->injectionMode);
|
int numberOfInjections = isCranking ? getNumberOfInjections(engineConfiguration->crankingInjectionMode) : getNumberOfInjections(engineConfiguration->injectionMode);
|
||||||
|
|
||||||
float actualInjectedMass = numberOfInjections * (injectionMassStage1 + injectionMassStage2);
|
float actualInjectedMass = numberOfInjections * (injectionMassStage1 + injectionMassStage2);
|
||||||
|
|
||||||
engine->module<TripOdometer>()->consumeFuel(actualInjectedMass, nowNt);
|
engine->module<TripOdometer>()->consumeFuel(actualInjectedMass, nowNt);
|
||||||
|
#endif // MODULE_TRIP_ODO
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doSplitInjection) {
|
if (doSplitInjection) {
|
||||||
|
|
|
@ -893,7 +893,7 @@ void configureRusefiLuaHooks(lua_State* l) {
|
||||||
return 1;
|
return 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
#if EFI_VEHICLE_SPEED
|
#ifdef MODULE_GEAR_DETECT
|
||||||
lua_register(l, "getCurrentGear", [](lua_State* l2) {
|
lua_register(l, "getCurrentGear", [](lua_State* l2) {
|
||||||
lua_pushinteger(l2, Sensor::getOrZero(SensorType::DetectedGear));
|
lua_pushinteger(l2, Sensor::getOrZero(SensorType::DetectedGear));
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -904,7 +904,7 @@ void configureRusefiLuaHooks(lua_State* l) {
|
||||||
lua_pushinteger(l2, engine->module<GearDetector>()->getRpmInGear(idx));
|
lua_pushinteger(l2, engine->module<GearDetector>()->getRpmInGear(idx));
|
||||||
return 1;
|
return 1;
|
||||||
});
|
});
|
||||||
#endif // EFI_VEHICLE_SPEED
|
#endif // MODULE_GEAR_DETECT
|
||||||
|
|
||||||
#if !EFI_UNIT_TEST
|
#if !EFI_UNIT_TEST
|
||||||
lua_register(l, "startPwm", lua_startPwm);
|
lua_register(l, "startPwm", lua_startPwm);
|
||||||
|
@ -940,8 +940,10 @@ void configureRusefiLuaHooks(lua_State* l) {
|
||||||
lua_register(l, "txCan", lua_txCan);
|
lua_register(l, "txCan", lua_txCan);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MODULE_TRIP_ODO
|
||||||
lua_register(l, "resetOdometer", [](lua_State*) {
|
lua_register(l, "resetOdometer", [](lua_State*) {
|
||||||
engine->module<TripOdometer>()->reset();
|
engine->module<TripOdometer>()->reset();
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
#endif // MODULE_TRIP_ODO
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
MODULES_INC += $(PROJECT_DIR)/controllers/modules/fan
|
||||||
|
MODULES_CPPSRC += $(PROJECT_DIR)/controllers/modules/fan/fan_control.cpp
|
||||||
|
MODULES_INCLUDE += \#include "fan_control.h"\n
|
||||||
|
MODULES_LIST += FanControl1,FanControl2,
|
|
@ -0,0 +1,4 @@
|
||||||
|
MODULES_INC += $(PROJECT_DIR)/controllers/modules/fuel_pump
|
||||||
|
MODULES_CPPSRC += $(PROJECT_DIR)/controllers/modules/fuel_pump/fuel_pump.cpp
|
||||||
|
MODULES_INCLUDE += \#include "fuel_pump.h"\n
|
||||||
|
MODULES_LIST += FuelPumpController,
|
|
@ -0,0 +1,6 @@
|
||||||
|
MODULES_INC += $(PROJECT_DIR)/controllers/modules/gear_detector
|
||||||
|
MODULES_CPPSRC += $(PROJECT_DIR)/controllers/modules/gear_detector/gear_detector.cpp
|
||||||
|
MODULES_INCLUDE += \#include "gear_detector.h"\n
|
||||||
|
MODULES_LIST += GearDetector,
|
||||||
|
|
||||||
|
DDEFS += -DMODULE_GEAR_DETECT
|
|
@ -0,0 +1,4 @@
|
||||||
|
include $(PROJECT_DIR)/controllers/modules/fan/fan.mk
|
||||||
|
include $(PROJECT_DIR)/controllers/modules/fuel_pump/fuel_pump.mk
|
||||||
|
include $(PROJECT_DIR)/controllers/modules/gear_detector/gear_detector.mk
|
||||||
|
include $(PROJECT_DIR)/controllers/modules/trip_odometer/trip_odometer.mk
|
|
@ -0,0 +1,16 @@
|
||||||
|
# Generate header to include all built modules
|
||||||
|
engine_modules_generated.h.gen : .FORCE
|
||||||
|
printf '$(MODULES_INCLUDE)' > $@
|
||||||
|
|
||||||
|
engine_modules_generated.h : engine_modules_generated.h.gen
|
||||||
|
rsync --checksum $< $@
|
||||||
|
|
||||||
|
modules_list_generated.h.gen : .FORCE
|
||||||
|
printf '$(MODULES_LIST)' > $@
|
||||||
|
|
||||||
|
modules_list_generated.h : modules_list_generated.h.gen
|
||||||
|
rsync --checksum $< $@
|
||||||
|
|
||||||
|
# All objects could depend on module list
|
||||||
|
$(OBJS) : engine_modules_generated.h
|
||||||
|
$(OBJS) : modules_list_generated.h
|
|
@ -0,0 +1,6 @@
|
||||||
|
MODULES_INC += $(PROJECT_DIR)/controllers/modules/trip_odometer
|
||||||
|
MODULES_CPPSRC += $(PROJECT_DIR)/controllers/modules/trip_odometer/trip_odometer.cpp
|
||||||
|
MODULES_INCLUDE += \#include "trip_odometer.h"\n
|
||||||
|
MODULES_LIST += TripOdometer,
|
||||||
|
|
||||||
|
DDEFS += -DMODULE_TRIP_ODO
|
|
@ -69,13 +69,13 @@ Usages:
|
||||||
output_name: ac
|
output_name: ac
|
||||||
|
|
||||||
- name: fan_control
|
- name: fan_control
|
||||||
folder: controllers/actuators
|
folder: controllers/modules/fan
|
||||||
output_name: [ "fan1", "fan2" ]
|
output_name: [ "fan1", "fan2" ]
|
||||||
constexpr: "___engine.module<FanControl1>()"
|
constexpr: "___engine.module<FanControl1>()"
|
||||||
isPtr: true
|
isPtr: true
|
||||||
|
|
||||||
- name: fuel_pump_control
|
- name: fuel_pump_control
|
||||||
folder: controllers/actuators
|
folder: controllers/modules/fuel_pump
|
||||||
output_name: fuelPump
|
output_name: fuelPump
|
||||||
|
|
||||||
- name: main_relay
|
- name: main_relay
|
||||||
|
|
|
@ -282,7 +282,9 @@ void runRusEfiWithConfig() {
|
||||||
*/
|
*/
|
||||||
initEngineController();
|
initEngineController();
|
||||||
|
|
||||||
|
#ifdef MODULE_GEAR_DETECT
|
||||||
engine->module<GearDetector>()->onConfigurationChange(nullptr);
|
engine->module<GearDetector>()->onConfigurationChange(nullptr);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if EFI_ENGINE_EMULATOR
|
#if EFI_ENGINE_EMULATOR
|
||||||
initEngineEmulator();
|
initEngineEmulator();
|
||||||
|
|
|
@ -158,6 +158,7 @@ endif
|
||||||
include $(PROJECT_DIR)/console/binary/tunerstudio.mk
|
include $(PROJECT_DIR)/console/binary/tunerstudio.mk
|
||||||
include $(PROJECT_DIR)/console/console.mk
|
include $(PROJECT_DIR)/console/console.mk
|
||||||
include $(PROJECT_DIR)/common.mk
|
include $(PROJECT_DIR)/common.mk
|
||||||
|
include $(PROJECT_DIR)/controllers/modules/modules.mk
|
||||||
|
|
||||||
|
|
||||||
# C sources that can be compiled in ARM or THUMB mode depending on the global
|
# C sources that can be compiled in ARM or THUMB mode depending on the global
|
||||||
|
@ -181,6 +182,7 @@ CPPSRC = $(ALLCPPSRC) \
|
||||||
simulator/system/signal_executor_sleep.cpp \
|
simulator/system/signal_executor_sleep.cpp \
|
||||||
simulator/boards.cpp \
|
simulator/boards.cpp \
|
||||||
$(TEST_SRC_CPP) \
|
$(TEST_SRC_CPP) \
|
||||||
|
$(MODULES_CPPSRC) \
|
||||||
$(RUSEFI_LIB_CPP) \
|
$(RUSEFI_LIB_CPP) \
|
||||||
main.cpp
|
main.cpp
|
||||||
|
|
||||||
|
@ -191,6 +193,7 @@ ASMSRC = $(PORTASM)
|
||||||
INCDIR = . \
|
INCDIR = . \
|
||||||
$(PCH_DIR) \
|
$(PCH_DIR) \
|
||||||
$(ALLINC) \
|
$(ALLINC) \
|
||||||
|
$(MODULES_INC) \
|
||||||
$(CHIBIOS)/os/various/cpp_wrappers \
|
$(CHIBIOS)/os/various/cpp_wrappers \
|
||||||
$(PROJECT_DIR)/hw_layer/drivers/can \
|
$(PROJECT_DIR)/hw_layer/drivers/can \
|
||||||
${CHIBIOS}/os/various \
|
${CHIBIOS}/os/various \
|
||||||
|
@ -290,6 +293,7 @@ include $(RULESPATH)/rules.mk
|
||||||
include $(PROJECT_DIR)/rusefi_pch.mk
|
include $(PROJECT_DIR)/rusefi_pch.mk
|
||||||
include $(PROJECT_DIR)/fome_generated.mk
|
include $(PROJECT_DIR)/fome_generated.mk
|
||||||
include $(PROJECT_DIR)/gitversion.mk
|
include $(PROJECT_DIR)/gitversion.mk
|
||||||
|
include $(PROJECT_DIR)/controllers/modules/modules_header_gen.mk
|
||||||
|
|
||||||
.PHONY: CLEAN_RULE_HOOK CLEAN_PCH_HOOK CLEAN_BUNDLE_HOOK
|
.PHONY: CLEAN_RULE_HOOK CLEAN_PCH_HOOK CLEAN_BUNDLE_HOOK
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ include $(UNIT_TESTS_DIR)/test.mk
|
||||||
include $(UNIT_TESTS_DIR)/tests/tests.mk
|
include $(UNIT_TESTS_DIR)/tests/tests.mk
|
||||||
include $(PROJECT_DIR)/../unit_tests/tests/util/test_util.mk
|
include $(PROJECT_DIR)/../unit_tests/tests/util/test_util.mk
|
||||||
include $(PROJECT_DIR)/common.mk
|
include $(PROJECT_DIR)/common.mk
|
||||||
|
include $(PROJECT_DIR)/controllers/modules/modules.mk
|
||||||
|
|
||||||
RUSEFI_LIB = $(PROJECT_DIR)/libfirmware
|
RUSEFI_LIB = $(PROJECT_DIR)/libfirmware
|
||||||
include $(RUSEFI_LIB)/util/util.mk
|
include $(RUSEFI_LIB)/util/util.mk
|
||||||
|
@ -47,11 +48,13 @@ CPPSRC += $(ALLCPPSRC) \
|
||||||
$(PROJECT_DIR)/../unit_tests/mocks.cpp \
|
$(PROJECT_DIR)/../unit_tests/mocks.cpp \
|
||||||
$(RUSEFI_LIB_CPP) \
|
$(RUSEFI_LIB_CPP) \
|
||||||
$(RUSEFI_LIB_CPP_TEST) \
|
$(RUSEFI_LIB_CPP_TEST) \
|
||||||
|
$(MODULES_CPPSRC) \
|
||||||
|
|
||||||
INCDIR += \
|
INCDIR += \
|
||||||
$(PCH_DIR) \
|
$(PCH_DIR) \
|
||||||
$(UNIT_TESTS_DIR) \
|
$(UNIT_TESTS_DIR) \
|
||||||
$(ALLINC) \
|
$(ALLINC) \
|
||||||
|
$(MODULES_INC) \
|
||||||
$(GENERATED_DIR) \
|
$(GENERATED_DIR) \
|
||||||
$(PROJECT_DIR)/config/boards/hellen \
|
$(PROJECT_DIR)/config/boards/hellen \
|
||||||
$(UNIT_TESTS_DIR)/test_data_structures \
|
$(UNIT_TESTS_DIR)/test_data_structures \
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
|
||||||
#include "fan_control.h"
|
|
||||||
|
|
||||||
static void updateFans() {
|
static void updateFans() {
|
||||||
engine->module<FanControl1>()->onSlowCallback();
|
engine->module<FanControl1>()->onSlowCallback();
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,6 +197,7 @@ include $(UNIT_TESTS_DIR)/rules.mk
|
||||||
include $(PROJECT_DIR)/rusefi_pch.mk
|
include $(PROJECT_DIR)/rusefi_pch.mk
|
||||||
include $(PROJECT_DIR)/fome_generated.mk
|
include $(PROJECT_DIR)/fome_generated.mk
|
||||||
include $(PROJECT_DIR)/gitversion.mk
|
include $(PROJECT_DIR)/gitversion.mk
|
||||||
|
include $(PROJECT_DIR)/controllers/modules/modules_header_gen.mk
|
||||||
|
|
||||||
.PHONY: CLEAN_RULE_HOOK CLEAN_PCH_HOOK CLEAN_BUNDLE_HOOK
|
.PHONY: CLEAN_RULE_HOOK CLEAN_PCH_HOOK CLEAN_BUNDLE_HOOK
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue