2019-09-21 12:33:13 -07:00
|
|
|
/**
|
|
|
|
* @file init_sensorss.cpp
|
|
|
|
*/
|
|
|
|
|
2019-09-21 11:33:38 -07:00
|
|
|
#include "cli_registry.h"
|
|
|
|
#include "init.h"
|
|
|
|
#include "sensor.h"
|
|
|
|
|
2020-02-08 01:22:23 -08:00
|
|
|
static void initSensorCli();
|
|
|
|
|
|
|
|
// Sensor init/config
|
2020-02-03 22:54:05 -08:00
|
|
|
void initTps();
|
2019-09-21 11:33:38 -07:00
|
|
|
void initOilPressure();
|
|
|
|
|
2020-02-08 13:34:29 -08:00
|
|
|
void initSensors() {
|
2020-02-03 22:54:05 -08:00
|
|
|
initTps();
|
2019-09-21 11:33:38 -07:00
|
|
|
initOilPressure();
|
|
|
|
|
|
|
|
// Init CLI functionality for sensors (mocking)
|
|
|
|
initSensorCli();
|
|
|
|
}
|
|
|
|
|
2020-02-08 01:22:23 -08:00
|
|
|
// Sensor reconfiguration
|
|
|
|
void reconfigureTps();
|
|
|
|
void reconfigureOilPressure();
|
|
|
|
|
|
|
|
void reconfigureSensors() {
|
|
|
|
reconfigureTps();
|
|
|
|
reconfigureOilPressure();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Mocking/testing helpers
|
|
|
|
static void initSensorCli() {
|
2019-09-21 11:33:38 -07:00
|
|
|
addConsoleActionIF("set_sensor_mock", Sensor::setMockValue);
|
|
|
|
addConsoleAction("reset_sensor_mocks", Sensor::resetAllMocks);
|
|
|
|
}
|