only: Detected gear is not current gear? #5850

This commit is contained in:
rusefillc 2024-01-02 21:49:28 -05:00 committed by Andrey
parent 521fc4254d
commit 8167fcebad
7 changed files with 28 additions and 10 deletions

View File

@ -290,7 +290,7 @@
#endif
#ifndef EFI_TCU
#define EFI_TCU TRUE
#define EFI_TCU FALSE
#endif
#ifndef EFI_ENGINE_EMULATOR

View File

@ -6,6 +6,7 @@
#include "wideband_state_generated.h"
#include "electronic_throttle_impl.h"
#include "knock_controller_generated.h"
#include "tcu_controller_generated.h"
#include "fuel_computer.h"
#include "antilag_system_state_generated.h"
#include "vvt_generated.h"
@ -20,6 +21,16 @@ const knock_controller_s* getLiveData(size_t) {
return &engine->module<KnockController>().unmock();
}
template<>
const tcu_controller_s* getLiveData(size_t) {
#if EFI_TCU
fix me here
return &engine->
#else
return nullptr;
#endif // EFI_TCU
}
template<>
const high_pressure_fuel_pump_s* getLiveData(size_t) {
#if EFI_HPFP

View File

@ -183,7 +183,6 @@ int16_t rpmAcceleration;dRPM;"RPM acceleration",1, 0, 0, 5, 2
int16_t autoscale rawOilPressure;;"V",{1/@@PACK_MULT_VOLTAGE@@}, 0, 0, 5, 3
uint8_t fuelClosedLoopBinIdx;;"", 1, 0, 0, 0, 0
int8_t tcuCurrentGear;@@GAUGE_NAME_CURRENT_GEAR@@;"gear", 1, 0, -1, 10, 0
int16_t autoscale rawPpsSecondary;;"V",{1/@@PACK_MULT_VOLTAGE@@}, 0, 0, 5, 3
@ -243,11 +242,6 @@ int16_t rpmAcceleration;dRPM;"RPM acceleration",1, 0, 0, 5, 2
uint32_t luaInvocationCounter;Lua: Tick counter;"count",1, 0, 0, 0, 0
uint32_t luaLastCycleDuration;Lua: Last tick duration;"nt",1, 0, 0, 0, 0
uint8_t tcu_currentRange;"TCU: Current Range";"", 1, 0, 0, 0, 0
uint16_t autoscale tcRatio;@@GAUGE_NAME_TC_RATIO@@;"value",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0
float lastShiftTime
uint32_t vssEdgeCounter
uint32_t issEdgeCounter

View File

@ -33,9 +33,9 @@ void TransmissionControllerBase::postState() {
auto iss = Sensor::get(SensorType::InputShaftSpeed);
auto rpm = Sensor::get(SensorType::Rpm);
if (iss.Valid && rpm.Valid) {
engine->outputChannels.tcRatio = rpm.Value / iss.Value;
tcRatio = rpm.Value / iss.Value;
}
engine->outputChannels.tcuCurrentGear = getCurrentGear();
tcuCurrentGear = getCurrentGear();
#endif
}

View File

@ -11,10 +11,11 @@
#include "io_pins.h"
#include "persistent_configuration.h"
#include "generated_lookup_engine_configuration.h"
#include "tcu_controller_generated.h"
#include <rusefi/timer.h>
#if EFI_TCU
class TransmissionControllerBase {
class TransmissionControllerBase, public tcu_controller_s {
private:
Timer m_shiftTimer;
bool m_shiftTime;

View File

@ -0,0 +1,6 @@
struct_no_prefix tcu_controller_s
int8_t tcuCurrentGear;@@GAUGE_NAME_CURRENT_GEAR@@;"gear", 1, 0, -1, 10, 0
uint16_t autoscale tcRatio;@@GAUGE_NAME_TC_RATIO@@;"value",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0
float lastShiftTime
! uint8_t tcu_currentRange;"TCU: Current Range";"", 1, 0, 0, 0, 0
end_struct

View File

@ -42,6 +42,12 @@ Usages:
constexpr: "___engine.module<KnockController>()"
isPtr: true
- name: tcu_controller
java: TcuController.java
folder: controllers/tcu
prepend: integration/rusefi_config_shared.txt
conditional_compilation: "EFI_TCU"
- name: throttle_model
java: ThrottleModel.java
folder: controllers/math