auto-sync
This commit is contained in:
parent
aaabf3afa5
commit
d4a2ab4c56
|
@ -36,6 +36,7 @@
|
|||
#include "trigger_central.h"
|
||||
#include "engine_state.h"
|
||||
#include "io_pins.h"
|
||||
#include "efiGpio.h"
|
||||
#include "mmc_card.h"
|
||||
#include "console_io.h"
|
||||
#include "malfunction_central.h"
|
||||
|
|
|
@ -169,26 +169,3 @@ float getStartingFuel(float coolantTemperature) {
|
|||
engineConfiguration->crankingSettings.coolantTempMaxC,
|
||||
engineConfiguration->crankingSettings.fuelAtMaxTempMs, coolantTemperature);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 0 for OM_DEFAULT and OM_OPENDRAIN
|
||||
*/
|
||||
|
||||
inline static int getElectricalValue0(pin_output_mode_e mode) {
|
||||
return mode == OM_INVERTED || mode == OM_OPENDRAIN_INVERTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 1 for OM_DEFAULT and OM_OPENDRAIN
|
||||
*/
|
||||
inline static int getElectricalValue1(pin_output_mode_e mode) {
|
||||
return mode == OM_DEFAULT || mode == OM_OPENDRAIN;
|
||||
}
|
||||
|
||||
// todo: this method is here for unit test visibility. todo: move to a bette place!
|
||||
int getElectricalValue(int logicalValue, pin_output_mode_e mode) {
|
||||
efiAssert(mode <= OM_OPENDRAIN_INVERTED, "invalid pin_output_mode_e", -1);
|
||||
|
||||
return logicalValue ? getElectricalValue1(mode) : getElectricalValue0(mode);
|
||||
}
|
||||
|
||||
|
|
|
@ -133,8 +133,6 @@ io_pin_e getPinByName(const char *name);
|
|||
void turnOutputPinOn(io_pin_e pin);
|
||||
void turnOutputPinOff(io_pin_e pin);
|
||||
void setOutputPinValue(io_pin_e pin, int logicValue);
|
||||
int getElectricalValue(int logicalValue, pin_output_mode_e mode);
|
||||
int getOutputPinValue(io_pin_e pin);
|
||||
void setDefaultPinState(io_pin_e pin, pin_output_mode_e *defaultState);
|
||||
|
||||
void outputPinRegisterExt2(const char *msg, io_pin_e ioPin, brain_pin_e brainPin, pin_output_mode_e *outputMode);
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "engine.h"
|
||||
#include "rtc_helper.h"
|
||||
#include "io_pins.h"
|
||||
#include "efiGpio.h"
|
||||
|
||||
extern Engine engine;
|
||||
extern engine_configuration_s *engineConfiguration;
|
||||
|
|
|
@ -12,7 +12,33 @@
|
|||
// todo: clean this mess, this should become 'static'/private
|
||||
OutputPin outputs[IO_PIN_COUNT];
|
||||
|
||||
int getOutputPinValue(io_pin_e pin) {
|
||||
return getLogicPinValue(&outputs[pin]);
|
||||
}
|
||||
|
||||
int getLogicPinValue(OutputPin * outputPin) {
|
||||
return outputPin->currentLogicValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 0 for OM_DEFAULT and OM_OPENDRAIN
|
||||
*/
|
||||
|
||||
inline static int getElectricalValue0(pin_output_mode_e mode) {
|
||||
return mode == OM_INVERTED || mode == OM_OPENDRAIN_INVERTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 1 for OM_DEFAULT and OM_OPENDRAIN
|
||||
*/
|
||||
inline static int getElectricalValue1(pin_output_mode_e mode) {
|
||||
return mode == OM_DEFAULT || mode == OM_OPENDRAIN;
|
||||
}
|
||||
|
||||
// todo: this method is here for unit test visibility. todo: move to a bette place!
|
||||
int getElectricalValue(int logicalValue, pin_output_mode_e mode) {
|
||||
efiAssert(mode <= OM_OPENDRAIN_INVERTED, "invalid pin_output_mode_e", -1);
|
||||
|
||||
return logicalValue ? getElectricalValue1(mode) : getElectricalValue0(mode);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#define EFIGPIO_H_
|
||||
|
||||
#include "main.h"
|
||||
#include "io_pins.h"
|
||||
|
||||
/**
|
||||
* @brief Single output pin reference and state
|
||||
|
@ -30,6 +31,8 @@ extern "C"
|
|||
#endif /* __cplusplus */
|
||||
|
||||
int getLogicPinValue(OutputPin * outputPin);
|
||||
int getOutputPinValue(io_pin_e pin);
|
||||
int getElectricalValue(int logicalValue, pin_output_mode_e mode);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -68,10 +68,6 @@ void setOutputPinValue(io_pin_e pin, int logicValue) {
|
|||
setPinValue(&outputs[pin], getElectricalValue(logicValue, mode), logicValue);
|
||||
}
|
||||
|
||||
int getOutputPinValue(io_pin_e pin) {
|
||||
return getLogicPinValue(&outputs[pin]);
|
||||
}
|
||||
|
||||
void setDefaultPinState(io_pin_e pin, pin_output_mode_e *outputMode) {
|
||||
pin_output_mode_e mode = *outputMode;
|
||||
assertOMode(mode);
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
#include "ec2.h"
|
||||
#include "trigger_decoder.h"
|
||||
#include "engine_test_helper.h"
|
||||
#include "efiGpio.h"
|
||||
|
||||
extern float testMafValue;
|
||||
|
||||
|
||||
extern engine_configuration_s *engineConfiguration;
|
||||
extern engine_configuration2_s *engineConfiguration2;
|
||||
|
||||
|
|
Loading…
Reference in New Issue