hiding 8888 mess under the rug
making LPS25 one step more available to Hellen
This commit is contained in:
parent
1d10fbc7a8
commit
08de271407
|
@ -224,17 +224,7 @@ void Engine::periodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
standardAirCharge = getStandardAirCharge(PASS_ENGINE_PARAMETER_SIGNATURE);
|
standardAirCharge = getStandardAirCharge(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
#if (BOARD_TLE8888_COUNT > 0)
|
#if (BOARD_TLE8888_COUNT > 0)
|
||||||
static efitick_t tle8888CrankingResetTime = 0;
|
tle8888startup();
|
||||||
|
|
||||||
if (CONFIG(useTLE8888_cranking_hack) && ENGINE(rpmCalculator).isCranking()) {
|
|
||||||
efitick_t nowNt = getTimeNowNt();
|
|
||||||
if (nowNt - tle8888CrankingResetTime > MS2NT(300)) {
|
|
||||||
tle8888_req_init();
|
|
||||||
// let's reset TLE8888 every 300ms while cranking since that's the best we can do to deal with undervoltage reset
|
|
||||||
// PS: oh yes, it's a horrible design! Please suggest something better!
|
|
||||||
tle8888CrankingResetTime = nowNt;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if EFI_DYNO_VIEW
|
#if EFI_DYNO_VIEW
|
||||||
|
@ -243,10 +233,10 @@ void Engine::periodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
|
|
||||||
slowCallBackWasInvoked = true;
|
slowCallBackWasInvoked = true;
|
||||||
|
|
||||||
#if HW_PROTEUS
|
#if EFI_PROD_CODE
|
||||||
void baroUpdate();
|
void baroLps25Update();
|
||||||
baroUpdate();
|
baroLps25Update();
|
||||||
#endif
|
#endif // EFI_PROD_CODE
|
||||||
|
|
||||||
#if ANALOG_HW_CHECK_MODE
|
#if ANALOG_HW_CHECK_MODE
|
||||||
efiAssertVoid(OBD_PCM_Processor_Fault, isAdcChannelValid(CONFIG(clt).adcChannel), "No CLT setting");
|
efiAssertVoid(OBD_PCM_Processor_Fault, isAdcChannelValid(CONFIG(clt).adcChannel), "No CLT setting");
|
||||||
|
|
|
@ -18,8 +18,9 @@ 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 m_hasInit = false;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BitbangI2c m_i2c;
|
BitbangI2c m_i2c;
|
||||||
bool m_hasInit = false;
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,8 +20,9 @@
|
||||||
#include "drivers/gpio/mc33810.h"
|
#include "drivers/gpio/mc33810.h"
|
||||||
#include "drivers/gpio/tle8888.h"
|
#include "drivers/gpio/tle8888.h"
|
||||||
#include "drivers/gpio/drv8860.h"
|
#include "drivers/gpio/drv8860.h"
|
||||||
|
#include "engine.h"
|
||||||
|
|
||||||
EXTERN_CONFIG;
|
EXTERN_ENGINE;
|
||||||
|
|
||||||
#if (BOARD_TLE6240_COUNT > 0)
|
#if (BOARD_TLE6240_COUNT > 0)
|
||||||
// todo: migrate to TS or board config
|
// todo: migrate to TS or board config
|
||||||
|
@ -238,6 +239,21 @@ void initSmartGpio() {
|
||||||
gpiochips_init();
|
gpiochips_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tle8888startup() {
|
||||||
|
tle8888startup();
|
||||||
|
static efitick_t tle8888CrankingResetTime = 0;
|
||||||
|
|
||||||
|
if (CONFIG(useTLE8888_cranking_hack) && ENGINE(rpmCalculator).isCranking()) {
|
||||||
|
efitick_t nowNt = getTimeNowNt();
|
||||||
|
if (nowNt - tle8888CrankingResetTime > MS2NT(300)) {
|
||||||
|
tle8888_req_init();
|
||||||
|
// let's reset TLE8888 every 300ms while cranking since that's the best we can do to deal with undervoltage reset
|
||||||
|
// PS: oh yes, it's a horrible design! Please suggest something better!
|
||||||
|
tle8888CrankingResetTime = nowNt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void stopSmartCsPins() {
|
void stopSmartCsPins() {
|
||||||
#if (BOARD_TLE8888_COUNT > 0)
|
#if (BOARD_TLE8888_COUNT > 0)
|
||||||
efiSetPadUnused(activeConfiguration.tle8888_cs);
|
efiSetPadUnused(activeConfiguration.tle8888_cs);
|
||||||
|
|
|
@ -25,3 +25,5 @@ void initSmartGpio(void);
|
||||||
void startSmartCsPins(void);
|
void startSmartCsPins(void);
|
||||||
void stopSmartCsPins(void);
|
void stopSmartCsPins(void);
|
||||||
|
|
||||||
|
void tle8888startup(void);
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,10 @@ void initBaro(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void baroUpdate() {
|
void baroLps25Update() {
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
|
if (device.m_hasInit) {
|
||||||
sensor.update();
|
sensor.update();
|
||||||
#endif
|
}
|
||||||
|
#endif // EFI_PROD_CODE
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue