refactoring: better code names

This commit is contained in:
rusEfi 2017-04-19 22:03:14 -04:00
parent cc5ab32192
commit be18c73836
13 changed files with 32 additions and 32 deletions

View File

@ -137,7 +137,7 @@ floatms_t getInjectionDuration(int rpm DECLARE_ENGINE_PARAMETER_S) {
engineConfiguration->crankingInjectionMode :
engineConfiguration->injectionMode PASS_ENGINE_PARAMETER);
if (numberOfCylinders == 0) {
warning(CUSTOM_ERR_6509, "config not ready");
warning(CUSTOM_CONFIG_NOT_READY, "config not ready");
return 0; // we can end up here during configuration reset
}
if (isCranking) {

View File

@ -1678,20 +1678,20 @@ typedef enum {
CUSTOM_NAN_ENGINE_LOAD_2 = 6002,
CUSTOM_NEGATIVE_DURATION = 6003,
CUSTOM_NAN_DURACTION = 6004,
CUSTOM_OBD_5 = 6005,
CUSTOM_OBD_6 = 6006,
CUSTOM_EMPTY_FSIO_STACK = 6005,
CUSTOM_UNKNOWN_FSIO = 6006,
CUSTOM_NO_FSIO = 6007,
CUSTOM_OBD_8 = 6008,
CUSTOM_OBD_9 = 6009,
CUSTOM_FSIO_STACK_SIZE = 6008,
CUSTOM_FSIO_UNEXPECTED = 6009,
CUSTOM_OBD_10 = 6010,
CUSTOM_FSIO_PARSING = 6010,
CUSTOM_OBD_11 = 6011,
CUSTOM_OBD_12 = 6012,
CUSTOM_OBD_13 = 6013,
CUSTOM_OBD_14 = 6014,
CUSTOM_OBD_15 = 6015,
CUSTOM_OBD_16 = 6016,
CUSTOM_OBD_17 = 6017,
CUSTOM_PARAM_RANGE = 6016,
CUSTOM_MAF_NEEDED = 6017,
CUSTOM_UNKNOWN_ALGORITHM = 6018,
CUSTOM_OBD_COIL_PIN_NOT_ASSIGNED = 6019,
@ -1700,17 +1700,17 @@ typedef enum {
CUSTOM_OBD_ANGLE_CONSTRAINT_VIOLATION = 6022,
CUSTOM_OBD_UNKNOWN_FIRING_ORDER = 6023,
CUSTOM_OBD_WRONG_FIRING_ORDER = 6024,
CUSTOM_OBD_25 = 6025,
CUSTOM_OBD_IGNITION_MODE = 6025,
CUSTOM_OBD_26 = 6026,
CUSTOM_UNEXPECTED_ENGINE_TYPE = 6027,
CUSTOM_INVALID_TPS_SETTING = 6028,
CUSTOM_OBD_29 = 6029,
CUSTOM_RE_ADDING = 6029,
CUSTOM_OBD_NAN_INJECTION = 6030,
CUSTOM_OBD_NEG_INJECTION = 6031,
CUSTOM_ZERO_DWELL = 6032,
CUSTOM_OBD_33 = 6033,
CUSTOM_OBD_34 = 6034,
CUSTOM_DWELL_TOO_LONG = 6033,
CUSTOM_SKIPPING_STROKE = 6034,
CUSTOM_OBD_TRG_DECODING = 6035,
// todo: looks like following two errors always happen together, it's just timing affects which one is published?
CUSTOM_SYNC_ERROR = 6036,
@ -1860,15 +1860,15 @@ typedef enum {
CUSTOM_ERR_ASSERT_VOID = 6501,
CUSTOM_ERR_6502 = 6502,
CUSTOM_ERR_FSIO_POOL = 6503,
CUSTOM_ERR_6504 = 6504,
CUSTOM_FLSTACK = 6504,
CUSTOM_ERR_6505 = 6505,
CUSTOM_ERR_6506 = 6506,
CUSTOM_ERR_6507 = 6507,
CUSTOM_EGO_TYPE = 6506,
CUSTOM_LIST_LOOP = 6507,
CUSTOM_ERR_6508 = 6508,
CUSTOM_ERR_6509 = 6509,
CUSTOM_CONFIG_NOT_READY = 6509,
CUSTOM_ERR_TRG_ANGLE_ORDER = 6510,
CUSTOM_ERR_STATE_NULL = 6511,
CUSTOM_ERR_6512 = 6512,
CUSTOM_ERR_SAME_ANGLE = 6512,
CUSTOM_ERR_6513 = 6513,
CUSTOM_ERR_6514 = 6514,
CUSTOM_ERR_6515 = 6515,

View File

@ -69,7 +69,7 @@ void FLStack<T, MAXSIZE>::push(T value) {
template<typename T, int MAXSIZE>
T FLStack<T, MAXSIZE>::pop() {
if (currentSize == 0) {
firmwareError(CUSTOM_ERR_6504, "FLStack is empty");
firmwareError(CUSTOM_FLSTACK, "FLStack is empty");
}
return values[--currentSize];
}

View File

@ -124,7 +124,7 @@ static bool float2bool(float v) {
float LECalculator::pop(le_action_e action) {
if (stack.size() == 0) {
warning(CUSTOM_OBD_5, "empty stack for action=%d", action);
warning(CUSTOM_EMPTY_FSIO_STACK, "empty stack for action=%d", action);
return NAN;
}
return stack.pop();
@ -291,7 +291,7 @@ bool LECalculator::processElement(Engine *engine, LEElement *element) {
push(element->action, engine->knockCount);
break;
case LE_UNDEFINED:
warning(CUSTOM_OBD_6, "FSIO undefined action");
warning(CUSTOM_UNKNOWN_FSIO, "FSIO undefined action");
return true;
default:
push(element->action, getLEValue(engine, &stack, element->action));
@ -334,7 +334,7 @@ float LECalculator::getValue(float selfValue, Engine *engine) {
counter++;
}
if (stack.size() != 1) {
warning(CUSTOM_OBD_8, "unexpected FSIO stack size: %d", stack.size());
warning(CUSTOM_FSIO_STACK_SIZE, "unexpected FSIO stack size: %d", stack.size());
return NAN;
}
return stack.pop();

View File

@ -103,7 +103,7 @@ float getLEValue(Engine *engine, calc_stack_t *s, le_action_e action) {
case LE_METHOD_VBATT:
return getVBatt(PASS_ENGINE_PARAMETER_F);
default:
warning(CUSTOM_OBD_9, "FSIO unexpected %d", action);
warning(CUSTOM_FSIO_UNEXPECTED, "FSIO unexpected %d", action);
return NAN;
}
}
@ -193,7 +193,7 @@ void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_F) {
const char *formula = config->le_formulas[i];
LEElement *logic = userPool.parseExpression(formula);
if (logic == NULL) {
warning(CUSTOM_OBD_10, "parsing [%s]", formula);
warning(CUSTOM_FSIO_PARSING, "parsing [%s]", formula);
}
fsioLogics[i] = logic;

View File

@ -89,7 +89,7 @@ template<int RPM_BIN_SIZE, int LOAD_BIN_SIZE, typename vType>
float Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE, vType>::getValue(float xRpm, float y) {
efiAssert(initialized, "map not initialized", NAN);
if (cisnan(y)) {
warning(CUSTOM_OBD_16, "%s: y is NaN", name);
warning(CUSTOM_PARAM_RANGE, "%s: y is NaN", name);
return NAN;
}
// todo: we have a bit of a mess: in TunerStudio, RPM is X-axis

View File

@ -60,7 +60,7 @@ float getEngineLoadT(DECLARE_ENGINE_PARAMETER_F) {
switch (engineConfiguration->fuelAlgorithm) {
case LM_PLAIN_MAF:
if (!hasMafSensor(PASS_ENGINE_PARAMETER_F)) {
warning(CUSTOM_OBD_17, "MAF sensor needed for current fuel algorithm");
warning(CUSTOM_MAF_NEEDED, "MAF sensor needed for current fuel algorithm");
return NAN;
}
return getMafT(engineConfiguration);
@ -457,7 +457,7 @@ static int getIgnitionPinForIndex(int i DECLARE_ENGINE_PARAMETER_S) {
break;
default:
warning(CUSTOM_OBD_25, "unsupported ignitionMode %d in initializeIgnitionActions()", engineConfiguration->ignitionMode);
warning(CUSTOM_OBD_IGNITION_MODE, "unsupported ignitionMode %d in initializeIgnitionActions()", engineConfiguration->ignitionMode);
return 0;
}
}

View File

@ -60,7 +60,7 @@ static void initEgoSensor(afr_sensor_s *sensor, ego_sensor_e type) {
sensor->value2 = 14;
break;
default:
firmwareError(CUSTOM_ERR_6506, "Unexpected EGO %d", type);
firmwareError(CUSTOM_EGO_TYPE, "Unexpected EGO %d", type);
break;
}
}

View File

@ -133,7 +133,7 @@ int EventQueue::executeAll(efitime_t now) {
{
efiAssert(current->callback != NULL, "callback==null1", 0);
if (++listIterationCounter > QUEUE_LENGTH_LIMIT) {
firmwareError(CUSTOM_ERR_6507, "Is this list looped?");
firmwareError(CUSTOM_LIST_LOOP, "Is this list looped?");
return false;
}
if (current->momentX <= now) {

View File

@ -35,7 +35,7 @@ bool assertNotInList(T *head, T*element) {
* was not scheduled by angle but was scheduled by time. In case of scheduling
* by time with slow RPM the whole next fast revolution might be within the wait period
*/
warning(CUSTOM_OBD_29, "re-adding element into event_queue");
warning(CUSTOM_RE_ADDING, "re-adding element into event_queue");
return true;
}
}

View File

@ -499,7 +499,7 @@ void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t trgEventIndex D
if (limitedSpark || limitedFuel) {
// todo: this is not really a warning
warning(CUSTOM_OBD_34, "skipping stroke due to rpm=%d", rpm);
warning(CUSTOM_SKIPPING_STROKE, "skipping stroke due to rpm=%d", rpm);
}
#if (EFI_HISTOGRAMS && EFI_PROD_CODE) || defined(__DOXYGEN__)

View File

@ -290,7 +290,7 @@ static ALWAYS_INLINE void prepareIgnitionSchedule(int rpm DECLARE_ENGINE_PARAMET
warning(CUSTOM_ZERO_DWELL, "dwell is zero?");
}
if (engine->engineState.dwellAngle > maxAllowedDwellAngle) {
warning(CUSTOM_OBD_33, "dwell angle too long: %f", engine->engineState.dwellAngle);
warning(CUSTOM_DWELL_TOO_LONG, "dwell angle too long: %f", engine->engineState.dwellAngle);
}
// todo: add some check for dwell overflow? like 4 times 6 ms while engine cycle is less then that

View File

@ -343,7 +343,7 @@ void TriggerShape::addEvent2(angle_t angle, trigger_wheel_e const waveIndex, tri
int exactMatch = wave.findAngleMatch(angle, size);
if (exactMatch != EFI_ERROR_CODE) {
warning(CUSTOM_ERR_6512, "same angle: not supported");
warning(CUSTOM_ERR_SAME_ANGLE, "same angle: not supported");
shapeDefinitionError = true;
return;
}