don't expose private state (#2696)

* don't expose private state

* fix tle init
This commit is contained in:
Matthew Kennedy 2021-05-14 11:56:45 -07:00 committed by GitHub
parent 70f65e0652
commit c2cdc382a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -18,9 +18,12 @@ public:
bool init(brain_pin_e scl, brain_pin_e sda); bool init(brain_pin_e scl, brain_pin_e sda);
expected<float> readPressureKpa(); expected<float> readPressureKpa();
// todo: make this private and get getter? bool hasInit() const {
bool m_hasInit = false; return m_hasInit;
}
private: private:
BitbangI2c m_i2c; BitbangI2c m_i2c;
bool m_hasInit = false;
}; };

View File

@ -240,7 +240,6 @@ void initSmartGpio() {
} }
void tle8888startup() { void tle8888startup() {
tle8888startup();
static efitick_t tle8888CrankingResetTime = 0; static efitick_t tle8888CrankingResetTime = 0;
if (CONFIG(useTLE8888_cranking_hack) && ENGINE(rpmCalculator).isCranking()) { if (CONFIG(useTLE8888_cranking_hack) && ENGINE(rpmCalculator).isCranking()) {

View File

@ -22,7 +22,7 @@ void initBaro(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
void baroLps25Update() { void baroLps25Update() {
#if EFI_PROD_CODE #if EFI_PROD_CODE
if (device.m_hasInit) { if (device.hasInit()) {
sensor.update(); sensor.update();
} }
#endif // EFI_PROD_CODE #endif // EFI_PROD_CODE