better error code names
This commit is contained in:
parent
959aaf840a
commit
d280141ac2
|
@ -1749,7 +1749,7 @@ typedef enum {
|
|||
CUSTOM_OBD_TS_OUTPUT_MISMATCH = 6053,
|
||||
CUSTOM_TOO_LONG_CRANKING_FUEL_INJECTION = 6054,
|
||||
CUSTOM_OBD_55 = 6055,
|
||||
CUSTOM_OBD_56 = 6056,
|
||||
ERROR_HISTO_NAME = 6056,
|
||||
CUSTOM_OBD_57 = 6057,
|
||||
CUSTOM_OBD_58 = 6058,
|
||||
CUSTOM_OBD_59 = 6059,
|
||||
|
@ -1858,10 +1858,10 @@ typedef enum {
|
|||
|
||||
CUSTOM_ERR_ASSERT = 6500,
|
||||
CUSTOM_ERR_ASSERT_VOID = 6501,
|
||||
CUSTOM_ERR_6502 = 6502,
|
||||
ERROR_FL_STACK_OVERFLOW = 6502,
|
||||
CUSTOM_ERR_FSIO_POOL = 6503,
|
||||
CUSTOM_FLSTACK = 6504,
|
||||
CUSTOM_ERR_6505 = 6505,
|
||||
ERROR_ANGLE_RANGE = 6505,
|
||||
CUSTOM_EGO_TYPE = 6506,
|
||||
CUSTOM_LIST_LOOP = 6507,
|
||||
CUSTOM_ERR_LOCK_ISSUE = 6508,
|
||||
|
@ -1869,9 +1869,9 @@ typedef enum {
|
|||
CUSTOM_ERR_TRG_ANGLE_ORDER = 6510,
|
||||
CUSTOM_ERR_STATE_NULL = 6511,
|
||||
CUSTOM_ERR_SAME_ANGLE = 6512,
|
||||
CUSTOM_ERR_6513 = 6513,
|
||||
CUSTOM_ERR_6514 = 6514,
|
||||
CUSTOM_ERR_6515 = 6515,
|
||||
ERROR_TRIGGER_DRAMA = 6513,
|
||||
CUSTOM_MAP_ANGLE_PARAM = 6514,
|
||||
CUSTOM_ERR_DISPLAY_MODE = 6515,
|
||||
CUSTOM_ERR_6516 = 6516,
|
||||
CUSTOM_ERR_ADC_USED = 6517,
|
||||
CUSTOM_ERR_ADC_DEPTH_SLOW = 6518,
|
||||
|
@ -1886,12 +1886,12 @@ typedef enum {
|
|||
CUSTOM_ERR_NULL_TIMER_CALLBACK = 6527,
|
||||
CUSTOM_ERR_SCHEDULING_ERROR = 6528,
|
||||
CUSTOM_ERR_LOGGING_NOT_READY = 6529,
|
||||
CUSTOM_ERR_6530 = 6530,
|
||||
CUSTOM_ERR_6531 = 6531,
|
||||
ERROR_NAN_FIND_INDEX = 6530,
|
||||
ERROR_NULL_BUFFER = 6531,
|
||||
CUSTOM_ERR_BUFF_INIT_ERROR = 6532,
|
||||
CUSTOM_ERR_6533 = 6533,
|
||||
CUSTOM_ERR_6534 = 6534,
|
||||
CUSTOM_ERR_6535 = 6535,
|
||||
CUSTOM_ERR_INTERPOLATE_PARAM = 6533,
|
||||
ERROR_LOGGING_SIZE_CALC = 6534,
|
||||
CUSTOM_ERR_ADC_CHANNEL = 6535,
|
||||
CUSTOM_ERR_6536 = 6536,
|
||||
CUSTOM_ERR_6537 = 6537,
|
||||
CUSTOM_ERR_6538 = 6538,
|
||||
|
|
|
@ -59,7 +59,7 @@ bool FLStack<T, MAXSIZE>::remove(T value) {
|
|||
template<typename T, int MAXSIZE>
|
||||
void FLStack<T, MAXSIZE>::push(T value) {
|
||||
if (currentSize >= MAXSIZE) {
|
||||
firmwareError(CUSTOM_ERR_6502, "FLstack overflow");
|
||||
firmwareError(ERROR_FL_STACK_OVERFLOW, "FLstack overflow");
|
||||
return;
|
||||
//warning()
|
||||
}
|
||||
|
|
|
@ -162,7 +162,7 @@ int findIndex2(const float array[], unsigned size, float value) {
|
|||
*/
|
||||
int findIndexMsg(const char *msg, const float array[], int size, float value) {
|
||||
if (cisnan(value)) {
|
||||
firmwareError(CUSTOM_ERR_6530, "NaN in findIndex%s", msg);
|
||||
firmwareError(ERROR_NAN_FIND_INDEX, "NaN in findIndex%s", msg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -212,7 +212,7 @@ int findIndex(const float array[], int size, float value) {
|
|||
*/
|
||||
float interpolate2d(const char *msg, float value, float bin[], float values[], int size) {
|
||||
if (isnan(value)) {
|
||||
firmwareError(CUSTOM_ERR_6533, "NaN in interpolate2d %s", msg);
|
||||
firmwareError(CUSTOM_OBD_55, "NaN in interpolate2d %s", msg);
|
||||
return NAN;
|
||||
}
|
||||
int index = findIndexMsg("value", bin, size, value);
|
||||
|
|
|
@ -195,7 +195,7 @@ static void mapAveragingCallback(trigger_event_e ckpEventType,
|
|||
|
||||
angle_t samplingDuration = ENGINE(engineState.mapAveragingDuration);
|
||||
if (samplingDuration <= 0) {
|
||||
firmwareError(CUSTOM_ERR_6514, "map sampling angle should be positive");
|
||||
warning(CUSTOM_MAP_ANGLE_PARAM, "map sampling angle should be positive");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ void setAlgorithm(engine_load_mode_e algo DECLARE_ENGINE_PARAMETER_SUFFIX);
|
|||
|
||||
|
||||
#if EFI_ENABLE_ASSERTS
|
||||
#define assertAngleRange(angle, msg) if(angle > 10000000 || angle < -10000000) { firmwareError(CUSTOM_ERR_6505, "angle range %s %f", msg, angle);angle = 0;}
|
||||
#define assertAngleRange(angle, msg) if(angle > 10000000 || angle < -10000000) { firmwareError(ERROR_ANGLE_RANGE, "angle range %s %f", msg, angle);angle = 0;}
|
||||
#else
|
||||
#define assertAngleRange(angle, msg) {}
|
||||
#endif
|
||||
|
|
|
@ -409,7 +409,7 @@ void TriggerShape::addEvent2(angle_t angle, trigger_wheel_e const waveIndex, tri
|
|||
isFrontEvent[index] = TV_RISE == stateParam;
|
||||
|
||||
if (index != size) {
|
||||
firmwareError(CUSTOM_ERR_6513, "are we ever here?");
|
||||
firmwareError(ERROR_TRIGGER_DRAMA, "are we ever here?");
|
||||
}
|
||||
|
||||
// int index = size;
|
||||
|
|
|
@ -450,7 +450,8 @@ int getAdcChannelPin(adc_channel_e hwChannel) {
|
|||
case ADC_CHANNEL_IN15:
|
||||
return 5;
|
||||
default:
|
||||
firmwareError(CUSTOM_ERR_6535, "Unknown hw channel %d", hwChannel);
|
||||
// todo: better error handling, that's input parameter validation
|
||||
firmwareError(CUSTOM_ERR_ADC_CHANNEL, "Unknown hw channel %d", hwChannel);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ void lcd_HD44780_init(Logging *sharedLogger) {
|
|||
addConsoleAction("lcdinfo", lcdInfo);
|
||||
|
||||
if (engineConfiguration->displayMode > DM_HD44780_OVER_PCF8574) {
|
||||
warning(CUSTOM_ERR_6515, "Unexpected displayMode %d", engineConfiguration->displayMode);
|
||||
warning(CUSTOM_ERR_DISPLAY_MODE, "Unexpected displayMode %d", engineConfiguration->displayMode);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -241,7 +241,7 @@ void appendMsgPostfix(Logging *logging) {
|
|||
void resetLogging(Logging *logging) {
|
||||
char *buffer = logging->buffer;
|
||||
if (buffer == NULL) {
|
||||
firmwareError(CUSTOM_ERR_6531, "Null buffer: %s", logging->name);
|
||||
firmwareError(ERROR_NULL_BUFFER, "Null buffer: %s", logging->name);
|
||||
return;
|
||||
}
|
||||
logging->linePointer = buffer;
|
||||
|
|
|
@ -83,7 +83,7 @@ int histogramGetIndex(int64_t value) {
|
|||
*/
|
||||
void initHistogram(histogram_s *h, const char *name) {
|
||||
if (efiStrlen(name) > sizeof(h->name) - 1) {
|
||||
firmwareError(CUSTOM_ERR_6533, "Histogram name [%s] too long", name);
|
||||
firmwareError(ERROR_HISTO_NAME, "Histogram name [%s] too long", name);
|
||||
}
|
||||
strcpy(h->name, name);
|
||||
h->total_value = 0;
|
||||
|
|
|
@ -96,7 +96,7 @@ char * swapOutputBuffers(int *actualOutputBufferSize) {
|
|||
if (*actualOutputBufferSize != expectedOutputSize) {
|
||||
int sizeToShow = minI(10, *actualOutputBufferSize);
|
||||
int offsetToShow = *actualOutputBufferSize - sizeToShow;
|
||||
firmwareError(CUSTOM_ERR_6534, "lsize mismatch %d/%d [%s]", *actualOutputBufferSize, expectedOutputSize,
|
||||
firmwareError(ERROR_LOGGING_SIZE_CALC, "lsize mismatch %d/%d [%s]", *actualOutputBufferSize, expectedOutputSize,
|
||||
&outputBuffer[offsetToShow]);
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue