auto-sync

This commit is contained in:
rusEfi 2015-02-25 16:07:10 -06:00
parent 9c27b94c0f
commit 21a383083a
8 changed files with 36 additions and 5 deletions

View File

@ -109,7 +109,7 @@ extern TunerStudioOutputChannels tsOutputChannels;
extern tunerstudio_counters_s tsState;
static void resetTs(void) {
memset(&tsState, sizeof(tsState), 0);
memset(&tsState, 0, sizeof(tsState));
}
/**

View File

@ -74,12 +74,19 @@ int FLStack<T, MAXSIZE>::size() {
template <class Type, int Dimention>
class ArrayList {
public:
ArrayList();
int size;
Type elements[Dimention];
void reset(void);
Type *add(void);
};
template <class Type, int Dimention>
ArrayList< Type, Dimention>::ArrayList(void) {
memset(&elements, 0, sizeof(elements));
reset();
}
template <class Type, int Dimention>
void ArrayList< Type, Dimention>::reset(void) {
size = 0;

View File

@ -57,6 +57,8 @@ LENameOrdinalPair::LENameOrdinalPair(le_action_e action, const char *name) {
LEElement::LEElement() {
action = LE_UNDEFINED;
next = NULL;
fValue = NAN;
iValue = 0;
}
//void LEElement::init(le_action_e action, int iValue) {
@ -260,13 +262,17 @@ float LECalculator::getValue(Engine *engine) {
stack.reset();
int counter = 0;
while (element != NULL) {
efiAssert(counter < 200, "FSIOcount", NAN); // just in case
bool_t isError = doJob(engine, element);
if (isError) {
// error already reported
return NAN;
}
element = element->next;
counter++;
}
if (stack.size() != 1) {
warning(OBD_PCM_Processor_Fault, "unexpected FSIO stack size: %d", stack.size());
@ -277,7 +283,7 @@ float LECalculator::getValue(Engine *engine) {
LEElementPool::LEElementPool(LEElement *pool, int size) {
this->pool = pool;
this->capacity = capacity;
this->size = size;
reset();
}
@ -290,7 +296,7 @@ int LEElementPool::getSize() {
}
LEElement *LEElementPool::next() {
if (index == capacity - 1) {
if (index >= size) {
// todo: this should not be a fatal error, just an error
firmwareError("LE_ELEMENT_POOL_SIZE overflow");
return NULL;
@ -353,6 +359,9 @@ LEElement *LEElementPool::parseExpression(const char * line) {
}
LEElement *n = next();
if (n == NULL) {
return first;
}
if (isNumeric(parsingBuffer)) {
n->init(LE_NUMERIC_VALUE, atoff(parsingBuffer));

View File

@ -72,7 +72,7 @@ public:
int getSize();
private:
int index;
int capacity;
int size;
};

View File

@ -50,6 +50,9 @@ static void extCallback(EXTDriver *extp, expchannel_t channel) {
} else if (channel == getHwPin(boardConfiguration->joystickDPin)) {
joyD++;
button = JB_BUTTON_D;
} else {
// unexpected channel
return;
}
#if EFI_HD44780_LCD || defined(__DOXYGEN__)
onJoystick(button);

View File

@ -89,7 +89,7 @@ brain_pin_e parseBrainPin(const char *str) {
if (strEqual(str, "none"))
return GPIO_UNASSIGNED;
// todo: create method toLowerCase?
if (str[0] != 'p' && str[0] != 'p') {
if (str[0] != 'p' && str[0] != 'P') {
return GPIO_INVALID;
}
char port = str[1];

View File

@ -31,6 +31,7 @@ static msg_t stThread(StepperMotor *motor) {
motor->pulse();
}
return 0;
}
void StepperMotor::pulse() {

View File

@ -0,0 +1,11 @@
/*
* @file kill_for_coverity.c
*
* See http://rusefi.com/forum/viewtopic.php?f=5&t=655&p=10491#p10491
*
* @date Feb 25, 2015
*/
void special_abort(const char msg) {
__coverity_panic__();
}