interpret value from openLoopMap according to boostOpenLoopYAxis constant (fixes #4778)
This commit is contained in:
parent
867fd3d746
commit
f4b3b00d4d
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
#include "boost_control.h"
|
#include "boost_control.h"
|
||||||
#include "electronic_throttle.h"
|
#include "electronic_throttle.h"
|
||||||
|
#include "gppwm_channel_reader.h"
|
||||||
|
|
||||||
#define NO_PIN_PERIOD 500
|
#define NO_PIN_PERIOD 500
|
||||||
|
|
||||||
|
@ -96,7 +97,7 @@ expected<percent_t> BoostController::getOpenLoop(float target) {
|
||||||
UNUSED(target);
|
UNUSED(target);
|
||||||
|
|
||||||
float rpm = Sensor::getOrZero(SensorType::Rpm);
|
float rpm = Sensor::getOrZero(SensorType::Rpm);
|
||||||
auto driverIntent = Sensor::get(SensorType::DriverThrottleIntent);
|
auto driverIntent = readGppwmChannel(engineConfiguration->boostOpenLoopYAxis);
|
||||||
|
|
||||||
isTpsInvalid = !driverIntent.Valid;
|
isTpsInvalid = !driverIntent.Valid;
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ TEST(BoostControl, OpenLoop) {
|
||||||
bc.init(nullptr, &openMap, nullptr, nullptr);
|
bc.init(nullptr, &openMap, nullptr, nullptr);
|
||||||
|
|
||||||
// Should pass TPS value thru
|
// Should pass TPS value thru
|
||||||
Sensor::setMockValue(SensorType::DriverThrottleIntent, 47.0f);
|
Sensor::setMockValue(SensorType::Tps1, 47.0f);
|
||||||
EXPECT_FLOAT_EQ(bc.getOpenLoop(0).value_or(-1), 47.0f);
|
EXPECT_FLOAT_EQ(bc.getOpenLoop(0).value_or(-1), 47.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue