diff --git a/src/torque_converter.cpp b/src/torque_converter.cpp index 1b6bef18..da80ffad 100644 --- a/src/torque_converter.cpp +++ b/src/torque_converter.cpp @@ -38,8 +38,10 @@ TorqueConverter::TorqueConverter(uint16_t max_gb_rating) { this->slip_average = new FirstOrderAverage(50); // 20ms div * 50 = 1 second moving average } -void TorqueConverter::set_shift_target_state(InternalTccState target_state) { - this->shift_req_tcc_state = target_state; +void TorqueConverter::set_shift_target_state(SensorData* sd, InternalTccState target_state) { + if (sd->output_rpm < TCC_CURRENT_SETTINGS.force_lock_min_output_rpm) { + this->shift_req_tcc_state = target_state; + } this->is_shifting = true; } @@ -232,11 +234,6 @@ void TorqueConverter::update(GearboxGear curr_gear, GearboxGear targ_gear, Press pm->set_target_tcc_pressure(this->tcc_pressure_current); } -uint8_t TorqueConverter::progress_to_next_phase(void) { - uint8_t ret = 100; - return ret; -} - TccClutchStatus TorqueConverter::get_clutch_state(void) { TccClutchStatus ret = TccClutchStatus::Open; InternalTccState targ = this->target_tcc_state; diff --git a/src/torque_converter.h b/src/torque_converter.h index 7e509e7c..ab48bc25 100644 --- a/src/torque_converter.h +++ b/src/torque_converter.h @@ -42,14 +42,11 @@ class TorqueConverter { this->tcc_slip_map->save_to_eeprom(); } }; - void set_shift_target_state(InternalTccState target_state); + void set_shift_target_state(SensorData* sd, InternalTccState target_state); void on_shift_ending(void); void diag_toggle_tcc_sol(bool en); - // In % (0-100) - 100 is returned if already at next phase - uint8_t progress_to_next_phase(void); - void set_stationary(); int16_t get_slip_filtered();