auto-sync

This commit is contained in:
rusEfi 2016-10-01 09:02:04 -04:00
parent dcd5410fc8
commit 96c55abb00
4 changed files with 18 additions and 4 deletions

View File

@ -1671,7 +1671,7 @@ typedef enum {
CUSTOM_OBD_4 = 6004, CUSTOM_OBD_4 = 6004,
CUSTOM_OBD_5 = 6005, CUSTOM_OBD_5 = 6005,
CUSTOM_OBD_6 = 6006, CUSTOM_OBD_6 = 6006,
CUSTOM_OBD_7 = 6007, CUSTOM_NO_FSIO = 6007,
CUSTOM_OBD_8 = 6008, CUSTOM_OBD_8 = 6008,
CUSTOM_OBD_9 = 6009, CUSTOM_OBD_9 = 6009,

View File

@ -300,9 +300,13 @@ float LECalculator::getValue2(float selfValue, LEElement *fistElementInList, Eng
return getValue(selfValue, engine); return getValue(selfValue, engine);
} }
bool LECalculator::isEmpty() {
return first == NULL;
}
float LECalculator::getValue(float selfValue, Engine *engine) { float LECalculator::getValue(float selfValue, Engine *engine) {
if (first == NULL) { if (isEmpty()) {
warning(CUSTOM_OBD_7, "no FSIO code"); warning(CUSTOM_NO_FSIO, "no FSIO code");
return NAN; return NAN;
} }
LEElement *element = first; LEElement *element = first;

View File

@ -95,6 +95,7 @@ public:
float getValue(float selfValue, Engine *engine); float getValue(float selfValue, Engine *engine);
float getValue2(float selfValue, LEElement *fistElementInList, Engine *engine); float getValue2(float selfValue, LEElement *fistElementInList, Engine *engine);
void add(LEElement *element); void add(LEElement *element);
bool isEmpty();
void reset(); void reset();
void reset(LEElement *element); void reset(LEElement *element);
le_action_e calcLogAction[MAX_CALC_LOG]; le_action_e calcLogAction[MAX_CALC_LOG];

View File

@ -225,13 +225,22 @@ static const char *getGpioPinName(int index) {
return NULL; return NULL;
} }
/**
* @param index from zero for (LE_COMMAND_COUNT - 1)
*/
static void handleFsio(Engine *engine, int index) { static void handleFsio(Engine *engine, int index) {
if (boardConfiguration->fsioPins[index] == GPIO_UNASSIGNED) if (boardConfiguration->fsioPins[index] == GPIO_UNASSIGNED)
return; return;
bool isPwmMode = boardConfiguration->fsioFrequency[index] != NO_PWM; bool isPwmMode = boardConfiguration->fsioFrequency[index] != NO_PWM;
float fvalue = calc.getValue2(engine->engineConfiguration2->fsioLastValue[index], fsioLogics[index], engine); float fvalue;
if (fsioLogics[index] == NULL) {
warning(CUSTOM_NO_FSIO, "no FSIO for #%d %s", index + 1, hwPortname(boardConfiguration->fsioPins[index]));
fvalue = NAN;
} else {
fvalue = calc.getValue2(engine->engineConfiguration2->fsioLastValue[index], fsioLogics[index], engine);
}
engine->engineConfiguration2->fsioLastValue[index] = fvalue; engine->engineConfiguration2->fsioLastValue[index] = fvalue;
if (isPwmMode) { if (isPwmMode) {