Fixed pluginsystem

This commit is contained in:
CommanderRedYT
2021-11-05 20:12:18 +01:00
parent 0446a40e62
commit a9ae7b964e
2 changed files with 13 additions and 0 deletions

View File

@ -306,3 +306,14 @@ void readPotis()
gametrakDist = cpputils::mapValueClamped<float>(raw_gametrakDist, settings.boardcomputerHardware.gametrakDistMin, settings.boardcomputerHardware.gametrakDistMax, 0., 1000.);
#endif
}
float wattToAmpere(float watt) {
float voltage = std::max(controllers.front.feedback.batVoltage, controllers.back.feedback.batVoltage);
if (voltage > 50) voltage = 50;
if (voltage < 30) voltage = 30;
return watt / voltage;
}
float wattToMotorCurrent(float watt) {
return wattToAmpere(watt) / 4;
}

View File

@ -56,3 +56,5 @@ bool loadSettings();
bool saveSettings();
void updateAccumulators();
void readPotis();
float wattToAmpere(float watt);
float wattToMotorCurrent(float watt);