rusefi-1/firmware/controllers/gear_controller.cpp

31 lines
766 B
C++

#include "gear_controller.h"
#include "tunerstudio_outputs.h"
void GearControllerBase::init(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
INJECT_ENGINE_REFERENCE(&transmissionController);
transmissionController.init();
}
void GearControllerBase::update() {
// We are responsible for telling the transmission controller
// what gear we want.
transmissionController.update(getDesiredGear());
// Post state to TS
postState();
}
gear_e GearControllerBase::getDesiredGear() const {
return desiredGear;
}
gear_e GearControllerBase::setDesiredGear(gear_e gear) {
desiredGear = gear;
return getDesiredGear();
}
void GearControllerBase::postState() {
#if EFI_TUNER_STUDIO
tsOutputChannels.tcuDesiredGear = getDesiredGear();
#endif
}