suggestion to improve naming (#294)

* Rename GetInternalBatteryVoltage() to GetInternalHeaterVoltage()

* sampling, heater: fix Battery vs Heater naming mess

---------

Co-authored-by: Andrey Gusakov <dron0gus@gmail.com>
This commit is contained in:
rusefillc
2024-06-26 02:44:32 -04:00
committed by GitHub
parent 867082f276
commit d8e65a2c24
11 changed files with 34 additions and 28 deletions

View File

@@ -38,13 +38,12 @@ float Sampler::GetPumpNominalCurrent() const
return pumpCurrentSenseVoltage * ratio;
}
float Sampler::GetInternalBatteryVoltage() const
float Sampler::GetInternalHeaterVoltage() const
{
#ifdef BATTERY_INPUT_DIVIDER
// Dual HW can measure heater voltage for each channel
// by measuring voltage on Heater- while FET is off
// TODO: rename function?
return internalBatteryVoltage;
return internalHeaterVoltage;
#else
// After 5 seconds, pretend that we get battery voltage.
// This makes the controller usable without CAN control
@@ -116,7 +115,7 @@ void Sampler::ApplySample(AnalogChannelResult& result, float virtualGroundVoltag
PUMP_FILTER_ALPHA * (result.PumpCurrentVoltage - virtualGroundVoltageInt);
#ifdef BATTERY_INPUT_DIVIDER
internalBatteryVoltage = result.BatteryVoltage;
internalHeaterVoltage = result.HeaterSupplyVoltage;
#endif
// Shift history over by one