Improve tps error message (#1244)
* improve error messages * fix Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
parent
0edb791cff
commit
8151793ec7
|
@ -123,6 +123,12 @@ public:
|
|||
*/
|
||||
static void resetAllMocks();
|
||||
|
||||
/*
|
||||
* Get a friendly name for the sensor.
|
||||
* For example, CLT, IAT, Throttle Position 2, etc.
|
||||
*/
|
||||
const char* getSensorName() { return getSensorName(m_type); }
|
||||
|
||||
protected:
|
||||
// Protected constructor - only subclasses call this
|
||||
explicit Sensor(SensorType type)
|
||||
|
|
|
@ -47,7 +47,7 @@ static void initTpsFunc(LinearFunc& func, FunctionalSensor& sensor, adc_channel_
|
|||
AdcSubscription::SubscribeSensor(sensor, channel);
|
||||
|
||||
if (!sensor.Register()) {
|
||||
firmwareError(CUSTOM_INVALID_TPS_SETTING, "Duplicate TPS registration for TPS sensor");
|
||||
firmwareError(CUSTOM_INVALID_TPS_SETTING, "Duplicate registration for sensor \"%s\"", sensor.getSensorName());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ void initTps() {
|
|||
}
|
||||
|
||||
if (!driverIntent.Register()) {
|
||||
firmwareError(CUSTOM_INVALID_TPS_SETTING, "Duplicate TPS registration for TPS sensor");
|
||||
firmwareError(CUSTOM_INVALID_TPS_SETTING, "Duplicate registration for driver acc intent sensor");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue