rusefi-1/unit_tests/boards.cpp

28 lines
658 B
C++

/**
* @file board.cpp
*
* @date Nov 15, 2013
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#include "pch.h"
#include "boards.h"
// see setMockVoltage
float getVoltageDivided(const char *msg, adc_channel_e hwChannel) {
return adcToVolts(engine->engineState.mockAdcState.getMockAdcValue(hwChannel));;
}
float getVoltage(const char *msg, adc_channel_e hwChannel) {
if (engine->engineState.mockAdcState.hasMockAdc[hwChannel])
return adcToVolts(engine->engineState.mockAdcState.getMockAdcValue(hwChannel) * engineConfiguration->analogInputDividerCoefficient);
return 0;
}
int getAdcValue(const char *msg, adc_channel_e hwChannel) {
return 0;
}