2021-07-25 22:05:17 -07:00
|
|
|
#include "pch.h"
|
|
|
|
|
2020-10-09 20:34:45 -07:00
|
|
|
#include "gear_controller.h"
|
|
|
|
|
2020-12-06 04:32:38 -08:00
|
|
|
void GearControllerBase::init(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
2020-10-09 20:34:45 -07:00
|
|
|
INJECT_ENGINE_REFERENCE(&transmissionController);
|
|
|
|
transmissionController.init();
|
|
|
|
}
|
|
|
|
|
|
|
|
void GearControllerBase::update() {
|
2020-12-06 04:32:38 -08:00
|
|
|
// We are responsible for telling the transmission controller
|
|
|
|
// what gear we want.
|
2020-10-09 20:34:45 -07:00
|
|
|
transmissionController.update(getDesiredGear());
|
2020-12-06 04:32:38 -08:00
|
|
|
// Post state to TS
|
2020-10-09 20:34:45 -07:00
|
|
|
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
|
|
|
|
}
|