migrating to SensorType::Rpm API
This commit is contained in:
parent
3bc59bfbb6
commit
16b3e95865
|
@ -52,7 +52,7 @@ expected<angle_t> VvtController::observePlant() const {
|
|||
}
|
||||
|
||||
expected<angle_t> VvtController::getSetpoint() {
|
||||
int rpm = GET_RPM();
|
||||
int rpm = Sensor::getOrZero(SensorType::Rpm);
|
||||
float load = getFuelingLoad();
|
||||
float target = m_targetMap->getValue(rpm, load);
|
||||
|
||||
|
@ -90,7 +90,7 @@ expected<percent_t> VvtController::getClosedLoop(angle_t target, angle_t observa
|
|||
}
|
||||
|
||||
void VvtController::setOutput(expected<percent_t> outputValue) {
|
||||
float rpm = GET_RPM();
|
||||
float rpm = Sensor::getOrZero(SensorType::Rpm);
|
||||
|
||||
// todo: make this configurable?
|
||||
bool enabledAtCurrentRpm = rpm > engineConfiguration->cranking.rpm;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
using ::testing::StrictMock;
|
||||
using ::testing::Return;
|
||||
|
||||
TEST(Vvt, setpoint) {
|
||||
TEST(Vvt, TestSetPoint) {
|
||||
EngineTestHelper eth(TEST_ENGINE);
|
||||
|
||||
// Set up a mock target map
|
||||
|
@ -15,7 +15,7 @@ TEST(Vvt, setpoint) {
|
|||
|
||||
// Mock necessary inputs
|
||||
engine->engineState.fuelingLoad = 55;
|
||||
engine->rpmCalculator.mockRpm = 4321;
|
||||
Sensor::setMockValue(SensorType::Rpm, 4321);
|
||||
|
||||
VvtController dut;
|
||||
dut.init(0, 0, 0, &targetMap);
|
||||
|
|
Loading…
Reference in New Issue