rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
init
sensor
init_fuel_level.cpp
Go to the documentation of this file.
1
#include "
pch.h
"
2
3
#include "
adc_subscription.h
"
4
#include "
fuel_level_sensor.h
"
5
6
static
FuelLevelSensor
fuelSensor
(
SensorType::FuelLevel
,
/* timeout = */
MS2NT(500));
7
8
void
initFuelLevel
() {
9
adc_channel_e
channel
=
engineConfiguration
->
fuelLevelSensor
;
10
11
if
(!
isAdcChannelValid
(
channel
)) {
12
return
;
13
}
14
15
// noisy data from fuel tank slosh is handled on an higher level
16
AdcSubscription::SubscribeSensor
(
fuelSensor
,
channel
,
/*lowpassCutoff =*/
100);
17
fuelSensor
.
Register
();
18
}
isAdcChannelValid
bool isAdcChannelValid(adc_channel_e hwChannel)
Definition
adc_inputs.h:23
channel
uint16_t channel
Definition
adc_inputs.h:104
adc_subscription.h
AdcSubscription::SubscribeSensor
static AdcSubscriptionEntry * SubscribeSensor(FunctionalSensorBase &sensor, adc_channel_e channel, float lowpassCutoffHZ, float voltsPerAdcVolt=0.0f)
Definition
adc_subscription.cpp:7
FuelLevelSensor
Definition
fuel_level_sensor.h:10
Sensor::Register
bool Register()
Definition
sensor.cpp:131
engineConfiguration
static constexpr engine_configuration_s * engineConfiguration
Definition
engine_configuration.h:80
fuel_level_sensor.h
fuelSensor
static FuelLevelSensor fuelSensor(SensorType::FuelLevel, MS2NT(500))
initFuelLevel
void initFuelLevel()
Definition
init_fuel_level.cpp:8
pch.h
adc_channel_e
adc_channel_e
Definition
rusefi_hw_adc_enums.h:60
SensorType::FuelLevel
@ FuelLevel
engine_configuration_s::fuelLevelSensor
adc_channel_e fuelLevelSensor
Definition
engine_configuration_generated_structures_alphax-2chan.h:1816
Generated on Sat Sep 27 2025 00:10:07 for rusEFI by
1.9.8