2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file board.c
|
|
|
|
*
|
|
|
|
* @date Nov 15, 2013
|
2018-01-20 17:42:19 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2018
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "boards.h"
|
2019-09-22 14:19:08 -07:00
|
|
|
#include "engine.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-09-22 14:19:08 -07:00
|
|
|
// todo: migrate to engine->engineState.mockAdcState
|
2015-07-10 06:01:56 -07:00
|
|
|
float testMafValue = 0;
|
2019-01-12 12:32:40 -08:00
|
|
|
float testCltValue = 0;
|
|
|
|
float testIatValue = 0;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-09-22 14:58:27 -07:00
|
|
|
// see setMockVoltage
|
2019-09-22 14:19:08 -07:00
|
|
|
float getVoltageDivided(const char *msg, adc_channel_e hwChannel DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
|
|
|
switch(hwChannel) {
|
2015-07-10 06:01:56 -07:00
|
|
|
case TEST_MAF_CHANNEL:
|
|
|
|
return testMafValue;
|
2019-01-12 12:32:40 -08:00
|
|
|
case TEST_CLT_CHANNEL:
|
|
|
|
return testCltValue;
|
2019-09-22 14:19:08 -07:00
|
|
|
//return adcToVolts(engine->engineState.mockAdcState.getMockAdcValue(hwChannel));
|
2019-01-12 12:32:40 -08:00
|
|
|
case TEST_IAT_CHANNEL:
|
|
|
|
return testIatValue;
|
2019-09-22 14:19:08 -07:00
|
|
|
//return adcToVolts(engine->engineState.mockAdcState.getMockAdcValue(hwChannel));
|
2019-12-02 07:18:13 -08:00
|
|
|
default:
|
|
|
|
return adcToVolts(engine->engineState.mockAdcState.getMockAdcValue(hwChannel));;
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-22 14:19:08 -07:00
|
|
|
float getVoltage(const char *msg, adc_channel_e hwChannel DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
|
|
|
if (engine->engineState.mockAdcState.hasMockAdc[hwChannel])
|
|
|
|
return adcToVolts(engine->engineState.mockAdcState.getMockAdcValue(hwChannel) * engineConfiguration->analogInputDividerCoefficient);
|
2015-07-10 06:01:56 -07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-09-22 14:19:08 -07:00
|
|
|
int getAdcValue(const char *msg, adc_channel_e hwChannel) {
|
2015-07-10 06:01:56 -07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|