only: Detected gear is not current gear? fix #5850
This commit is contained in:
parent
3526c8789f
commit
2b692470bf
|
@ -14,6 +14,7 @@ DDEFS += -DHW_ATLAS=1
|
||||||
# Atlas needs networking library
|
# Atlas needs networking library
|
||||||
LWIP = yes
|
LWIP = yes
|
||||||
ALLOW_SHADOW = yes
|
ALLOW_SHADOW = yes
|
||||||
|
DDEFS += -DEFI_TCU=TRUE
|
||||||
DDEFS += -DEFI_ETHERNET=TRUE
|
DDEFS += -DEFI_ETHERNET=TRUE
|
||||||
DDEFS += -DSTATIC_BOARD_ID=STATIC_BOARD_ID_ATLAS
|
DDEFS += -DSTATIC_BOARD_ID=STATIC_BOARD_ID_ATLAS
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,7 @@ const knock_controller_s* getLiveData(size_t) {
|
||||||
template<>
|
template<>
|
||||||
const tcu_controller_s* getLiveData(size_t) {
|
const tcu_controller_s* getLiveData(size_t) {
|
||||||
#if EFI_TCU
|
#if EFI_TCU
|
||||||
fix me here
|
return engine->gearController->transmissionController;
|
||||||
return &engine->
|
|
||||||
#else
|
#else
|
||||||
return nullptr;
|
return nullptr;
|
||||||
#endif // EFI_TCU
|
#endif // EFI_TCU
|
||||||
|
|
|
@ -16,10 +16,10 @@ public:
|
||||||
virtual GearControllerMode getMode() const {
|
virtual GearControllerMode getMode() const {
|
||||||
return GearControllerMode::ButtonShift;
|
return GearControllerMode::ButtonShift;
|
||||||
}
|
}
|
||||||
|
TransmissionControllerBase *transmissionController;
|
||||||
protected:
|
protected:
|
||||||
virtual gear_e setDesiredGear(gear_e);
|
virtual gear_e setDesiredGear(gear_e);
|
||||||
void initTransmissionController();
|
void initTransmissionController();
|
||||||
TransmissionControllerBase *transmissionController;
|
|
||||||
uint8_t* getRangeStateArray(int);
|
uint8_t* getRangeStateArray(int);
|
||||||
private:
|
private:
|
||||||
gear_e desiredGear = NEUTRAL;
|
gear_e desiredGear = NEUTRAL;
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
|
|
||||||
#if EFI_TCU
|
#if EFI_TCU
|
||||||
Gm4l6xTransmissionController gm4l6xTransmissionController;
|
Gm4l6xTransmissionController gm4l6xTransmissionController;
|
||||||
static SimplePwm tccPwm("TCC Control");
|
static SimplePwm tccPwm("TCC Control");
|
||||||
static SimplePwm pcPwm("Pressure Control");
|
static SimplePwm pcPwm("Pressure Control");
|
||||||
static SimplePwm shift32Pwm("3-2 Shift Control");
|
static SimplePwm shift32Pwm("3-2 Shift Control");
|
||||||
|
|
||||||
void Gm4l6xTransmissionController::init() {
|
void Gm4l6xTransmissionController::init() {
|
||||||
for (size_t i = 0; i < efi::size(engineConfiguration->tcu_solenoid); i++) {
|
for (size_t i = 0; i < efi::size(engineConfiguration->tcu_solenoid); i++) {
|
||||||
|
@ -56,7 +56,7 @@ void Gm4l6xTransmissionController::update(gear_e gear) {
|
||||||
|
|
||||||
float time = isShiftCompleted();
|
float time = isShiftCompleted();
|
||||||
if (time != 0) {
|
if (time != 0) {
|
||||||
engine->outputChannels.lastShiftTime = time;
|
lastShiftTime = time;
|
||||||
isShifting = false;
|
isShifting = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ void Gm4l6xTransmissionController::set32State(gear_e gear) {
|
||||||
int pct = interpolate2d(vss.Value, config->tcu_32SpeedBins, config->tcu_32Vals);
|
int pct = interpolate2d(vss.Value, config->tcu_32SpeedBins, config->tcu_32Vals);
|
||||||
shift32Pwm.setSimplePwmDutyCycle(pct*0.01);
|
shift32Pwm.setSimplePwmDutyCycle(pct*0.01);
|
||||||
} else {
|
} else {
|
||||||
shift32Pwm.setSimplePwmDutyCycle(0);
|
shift32Pwm.setSimplePwmDutyCycle(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include <rusefi/timer.h>
|
#include <rusefi/timer.h>
|
||||||
|
|
||||||
#if EFI_TCU
|
#if EFI_TCU
|
||||||
class TransmissionControllerBase, public tcu_controller_s {
|
class TransmissionControllerBase: public tcu_controller_s {
|
||||||
private:
|
private:
|
||||||
Timer m_shiftTimer;
|
Timer m_shiftTimer;
|
||||||
bool m_shiftTime;
|
bool m_shiftTime;
|
||||||
|
|
|
@ -2,5 +2,5 @@ struct_no_prefix tcu_controller_s
|
||||||
int8_t tcuCurrentGear;@@GAUGE_NAME_CURRENT_GEAR@@;"gear", 1, 0, -1, 10, 0
|
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
|
uint16_t autoscale tcRatio;@@GAUGE_NAME_TC_RATIO@@;"value",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0
|
||||||
float lastShiftTime
|
float lastShiftTime
|
||||||
! uint8_t tcu_currentRange;"TCU: Current Range";"", 1, 0, 0, 0, 0
|
uint8_t tcu_currentRange;"TCU: Current Range";"", 1, 0, 0, 0, 0
|
||||||
end_struct
|
end_struct
|
||||||
|
|
Loading…
Reference in New Issue