remove GetInternalBatteryVoltage helper

This commit is contained in:
Matthew Kennedy
2023-06-23 14:45:50 -07:00
parent 2628d1d05c
commit c0609b0da2
4 changed files with 2 additions and 10 deletions

View File

@@ -36,7 +36,7 @@ void SamplingUpdateLiveData()
data->heaterState = (uint8_t)GetHeaterState(ch); data->heaterState = (uint8_t)GetHeaterState(ch);
} }
livedata_common.vbatt = GetInternalBatteryVoltage(0); livedata_common.vbatt = GetSampler(0).GetInternalBatteryVoltage();
} }
template<> template<>

View File

@@ -173,9 +173,3 @@ void StartSampling()
adcStart(&ADCD1, nullptr); adcStart(&ADCD1, nullptr);
chThdCreateStatic(waSamplingThread, sizeof(waSamplingThread), NORMALPRIO + 5, SamplingThread, nullptr); chThdCreateStatic(waSamplingThread, sizeof(waSamplingThread), NORMALPRIO + 5, SamplingThread, nullptr);
} }
// TODO: remove these helpers
float GetInternalBatteryVoltage(int ch)
{
return samplers[ch].GetInternalBatteryVoltage();
}

View File

@@ -14,5 +14,3 @@ struct ISampler
const ISampler& GetSampler(int ch); const ISampler& GetSampler(int ch);
void StartSampling(); void StartSampling();
float GetInternalBatteryVoltage(int ch);

View File

@@ -39,7 +39,7 @@ static void UartThread(void*)
float lambda = GetLambda(ch); float lambda = GetLambda(ch);
int lambdaIntPart = lambda; int lambdaIntPart = lambda;
int lambdaThousandths = (lambda - lambdaIntPart) * 1000; int lambdaThousandths = (lambda - lambdaIntPart) * 1000;
int batteryVoltageMv = GetInternalBatteryVoltage(ch) * 1000; int batteryVoltageMv = GetSampler(ch).GetInternalBatteryVoltage() * 1000;
int duty = GetHeaterDuty(ch) * 100; int duty = GetHeaterDuty(ch) * 100;
size_t writeCount = chsnprintf(printBuffer, 200, size_t writeCount = chsnprintf(printBuffer, 200,