softer error handling
This commit is contained in:
parent
f381b1d86b
commit
414f45ede2
|
@ -1872,7 +1872,7 @@ typedef enum {
|
|||
ERROR_TRIGGER_DRAMA = 6513,
|
||||
CUSTOM_MAP_ANGLE_PARAM = 6514,
|
||||
CUSTOM_ERR_DISPLAY_MODE = 6515,
|
||||
CUSTOM_ERR_6516 = 6516,
|
||||
CUSTOM_ERR_ADC_UNKNOWN_CHANNEL = 6516,
|
||||
CUSTOM_ERR_ADC_USED = 6517,
|
||||
CUSTOM_ERR_ADC_DEPTH_SLOW = 6518,
|
||||
CUSTOM_ERR_ADC_DEPTH_FAST = 6519,
|
||||
|
@ -1892,12 +1892,12 @@ typedef enum {
|
|||
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,
|
||||
CUSTOM_ERR_ANGLE = 6536,
|
||||
CUSTOM_ERR_LOGGING_NULL = 6537,
|
||||
CUSTOM_ERR_PARSING_ERROR = 6538,
|
||||
CUSTOM_ERR_INJECTOR_LAG = 6539,
|
||||
|
||||
CUSTOM_ERR_6540 = 6540,
|
||||
CUSTOM_ERR_AXIS_ORDER = 6540,
|
||||
CUSTOM_ERR_6541 = 6541,
|
||||
CUSTOM_ERR_6542 = 6542,
|
||||
CUSTOM_ERR_6543 = 6543,
|
||||
|
|
|
@ -427,7 +427,7 @@ LEElement *LEElementPool::parseExpression(const char * line) {
|
|||
/**
|
||||
* Cannot recognize token
|
||||
*/
|
||||
warning(CUSTOM_ERR_6536, "unrecognized [%s]", parsingBuffer);
|
||||
warning(CUSTOM_ERR_PARSING_ERROR, "unrecognized [%s]", parsingBuffer);
|
||||
return NULL;
|
||||
}
|
||||
n->init(action);
|
||||
|
|
|
@ -173,7 +173,7 @@ int findIndex2(const float array[], unsigned size, float value) {
|
|||
void ensureArrayIsAscending(const char *msg, const float array[], int size) {
|
||||
for (int i = 0; i < size - 1; i ++) {
|
||||
if (array[i] >= array[i+ 1]) {
|
||||
firmwareError(CUSTOM_ERR_6538, "invalid axis %s at %f", msg, array[i]);
|
||||
firmwareError(CUSTOM_ERR_AXIS_ORDER, "invalid axis %s at %f", msg, array[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ void setFlatInjectorLag(float value DECLARE_ENGINE_PARAMETER_SUFFIX);
|
|||
#define fixAngle(angle, msg) \
|
||||
{ \
|
||||
if (cisnan(angle)) { \
|
||||
firmwareError(CUSTOM_ERR_6516, "angle NaN %s", msg); \
|
||||
firmwareError(CUSTOM_ERR_ANGLE, "angle NaN %s", msg); \
|
||||
angle = 0; \
|
||||
} \
|
||||
assertAngleRange(angle, msg); \
|
||||
|
|
|
@ -317,7 +317,7 @@ brain_pin_e getAdcChannelBrainPin(const char *msg, adc_channel_e hwChannel) {
|
|||
case ADC_CHANNEL_IN15:
|
||||
return GPIOC_5;
|
||||
default:
|
||||
firmwareError(CUSTOM_ERR_6516, "Unknown hw channel %d [%s]", hwChannel, msg);
|
||||
firmwareError(CUSTOM_ERR_ADC_UNKNOWN_CHANNEL, "Unknown hw channel %d [%s]", hwChannel, msg);
|
||||
return GPIO_INVALID;
|
||||
}
|
||||
}
|
||||
|
@ -398,7 +398,7 @@ ioportid_t getAdcChannelPort(const char *msg, adc_channel_e hwChannel) {
|
|||
case ADC_CHANNEL_IN15:
|
||||
return GPIOC;
|
||||
default:
|
||||
firmwareError(CUSTOM_ERR_6516, "Unknown hw channel %d [%s]", hwChannel, msg);
|
||||
firmwareError(CUSTOM_ERR_ADC_UNKNOWN_CHANNEL, "Unknown hw channel %d [%s]", hwChannel, msg);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -255,7 +255,10 @@ void printMsg(Logging *logger, const char *fmt, ...) {
|
|||
* in order to reduce memory usage
|
||||
*/
|
||||
void scheduleMsg(Logging *logging, const char *fmt, ...) {
|
||||
efiAssertVoid(logging != NULL, "logging NULL");
|
||||
if (logging == NULL) {
|
||||
warning(CUSTOM_ERR_LOGGING_NULL, "logging NULL");
|
||||
return;
|
||||
}
|
||||
int wasLocked = lockAnyContext();
|
||||
resetLogging(logging); // todo: is 'reset' really needed here?
|
||||
appendMsgPrefix(logging);
|
||||
|
|
Loading…
Reference in New Issue