2022-07-18 12:31:09 -07:00
|
|
|
#include "livedata.h"
|
|
|
|
|
|
|
|
#include "lambda_conversion.h"
|
|
|
|
#include "sampling.h"
|
|
|
|
#include "pump_dac.h"
|
|
|
|
#include "heater_control.h"
|
|
|
|
|
2022-07-18 15:26:00 -07:00
|
|
|
#include <rusefi/arrays.h>
|
|
|
|
#include <rusefi/fragments.h>
|
|
|
|
|
2022-07-18 12:31:09 -07:00
|
|
|
static livedata_common_s livedata_common;
|
|
|
|
static livedata_afr_s livedata_afr;
|
|
|
|
|
|
|
|
void SamplingUpdateLiveData()
|
|
|
|
{
|
|
|
|
livedata_afr.afr = GetLambda();
|
|
|
|
livedata_afr.temperature = GetSensorTemperature();
|
|
|
|
livedata_afr.nernstVoltage = GetNernstDc();
|
|
|
|
livedata_afr.pumpCurrentTarget = GetPumpCurrent();
|
|
|
|
livedata_afr.pumpCurrentMeasured = GetPumpNominalCurrent();
|
|
|
|
livedata_afr.heaterDuty = GetHeaterDuty();
|
|
|
|
|
|
|
|
livedata_common.vbatt = GetInternalBatteryVoltage();
|
|
|
|
}
|
|
|
|
|
|
|
|
const livedata_common_s * getCommonLiveDataStructAddr()
|
|
|
|
{
|
|
|
|
return &livedata_common;
|
|
|
|
}
|
|
|
|
|
|
|
|
const livedata_afr_s * getAfrLiveDataStructAddr()
|
|
|
|
{
|
|
|
|
return &livedata_afr;
|
|
|
|
}
|
2022-07-18 15:26:00 -07:00
|
|
|
|
|
|
|
static const FragmentEntry fragments[] = {
|
|
|
|
getCommonLiveDataStructAddr(),
|
|
|
|
getAfrLiveDataStructAddr(),
|
|
|
|
};
|
|
|
|
|
|
|
|
FragmentList getFragments() {
|
|
|
|
return { fragments, efi::size(fragments) };
|
|
|
|
}
|