2021-01-05 04:57:26 -08:00
|
|
|
#include "init.h"
|
2021-01-08 17:01:26 -08:00
|
|
|
#include "pin_repository.h"
|
2021-01-05 04:57:26 -08:00
|
|
|
#include "engine.h"
|
2021-01-05 14:13:56 -08:00
|
|
|
#include "flex_sensor.h"
|
2021-01-05 04:57:26 -08:00
|
|
|
|
2021-01-05 14:13:56 -08:00
|
|
|
static FlexFuelSensor flexSensor;
|
|
|
|
|
2021-01-05 04:57:26 -08:00
|
|
|
// https://rusefi.com/forum/viewtopic.php?p=37452&sid=829804c90d5b2e1fecd1b900cf1b1811#p37452
|
|
|
|
|
|
|
|
void initFlexSensor(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
|
|
|
auto pin = CONFIG(flexSensorPin);
|
|
|
|
|
|
|
|
// Nothing to do if no sensor configured
|
2021-01-08 17:01:26 -08:00
|
|
|
if (!isBrainPinValid(pin)) {
|
2021-01-05 04:57:26 -08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-01-05 14:13:56 -08:00
|
|
|
flexSensor.init(pin);
|
|
|
|
flexSensor.Register();
|
2021-01-05 04:57:26 -08:00
|
|
|
}
|