error codes

This commit is contained in:
rusefi 2018-09-10 22:10:55 -04:00
parent 7b37195d64
commit 9b1af6ad6d
12 changed files with 30 additions and 30 deletions

View File

@ -1303,7 +1303,7 @@ void validateConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
void applyNonPersistentConfiguration(Logging * logger DECLARE_ENGINE_PARAMETER_SUFFIX) {
#if EFI_PROD_CODE || defined(__DOXYGEN__)
efiAssertVoid(CUSTOM_ERR_6620, getRemainingStack(chThdGetSelfX()) > 256, "apply c");
efiAssertVoid(CUSTOM_APPLY_STACK, getRemainingStack(chThdGetSelfX()) > 256, "apply c");
scheduleMsg(logger, "applyNonPersistentConfiguration()");
#endif

View File

@ -1956,23 +1956,23 @@ typedef enum {
CUSTOM_ERR_6591 = 6591,
CUSTOM_ERR_6592 = 6592,
CUSTOM_ERR_6593 = 6593,
CUSTOM_ERR_6594 = 6594,
CUSTOM_SHAPE_LEN_ZERO = 6594,
CUSTOM_ERR_6595 = 6595,
CUSTOM_ERR_6596 = 6596,
CUSTOM_ERR_6597 = 6597,
CUSTOM_OMODE_UNDEF = 6597,
CUSTOM_ERR_6598 = 6598,
CUSTOM_ERR_6599 = 6599,
CUSTOM_ERR_6600 = 6600,
CUSTOM_ERR_6601 = 6601,
CUSTOM_ERR_6602 = 6602,
CUSTOM_ENGINE_REF = 6600,
CUSTOM_CONSOLE_TOO_MANY = 6601,
CUSTOM_APPEND_NULL = 6602,
CUSTOM_ERR_6603 = 6603,
CUSTOM_ERR_6604 = 6604,
CUSTOM_ERR_6605 = 6605,
CUSTOM_ERR_6606 = 6606,
CUSTOM_ERR_6607 = 6607,
CUSTOM_ERR_6608 = 6608,
CUSTOM_ERR_6609 = 6609,
CUSTOM_APPEND_STACK = 6607,
CUSTOM_RM_STACK_1 = 6608,
CUSTOM_RM_STACK = 6609,
CUSTOM_ERR_6610 = 6610,
CUSTOM_ERR_6611 = 6611,
@ -1985,7 +1985,7 @@ typedef enum {
CUSTOM_ERR_6618 = 6618,
CUSTOM_ERR_6619 = 6619,
CUSTOM_ERR_6620 = 6620,
CUSTOM_APPLY_STACK = 6620,
CUSTOM_ERR_6621 = 6621,
CUSTOM_ERR_6622 = 6622,
CUSTOM_ERR_6623 = 6623,
@ -1996,14 +1996,14 @@ typedef enum {
CUSTOM_ERR_6628 = 6628,
CUSTOM_ERR_6629 = 6629,
CUSTOM_ERR_6630 = 6630,
CUSTOM_IGN_MATH_STATE = 6630,
CUSTOM_ERR_6631 = 6631,
CUSTOM_ERR_6632 = 6632,
CUSTOM_ERR_6633 = 6633,
CUSTOM_ANGLE_NAN = 6633,
CUSTOM_ERR_6634 = 6634,
CUSTOM_ERR_6635 = 6635,
CUSTOM_ERR_6636 = 6636,
CUSTOM_ERR_6637 = 6637,
CUSTOM_CONF_NULL = 6637,
CUSTOM_ERR_6638 = 6638,
CUSTOM_ERR_6639 = 6639,
@ -2011,7 +2011,7 @@ typedef enum {
CUSTOM_ERR_6641 = 6641,
CUSTOM_ERR_6642 = 6642,
CUSTOM_ERR_6643 = 6643,
CUSTOM_ERR_6644 = 6644,
CUSTOM_IDLE_WAVE_CNT = 6644,
CUSTOM_ERR_6645 = 6645,
CUSTOM_ERR_6646 = 6646,
CUSTOM_ERR_6647 = 6647,
@ -2054,7 +2054,7 @@ typedef enum {
CUSTOM_ERR_6680 = 6680,
CUSTOM_ERR_6681 = 6681,
CUSTOM_ERR_6682 = 6682,
CUSTOM_ERR_6683 = 6683,
CUSTOM_SAME_TWICE = 6683,
CUSTOM_ERR_6684 = 6684,
CUSTOM_ERR_6685 = 6685,
CUSTOM_ERR_6686 = 6686,

View File

@ -128,7 +128,7 @@ void setAltPFactor(float p) {
static void applyAlternatorPinState(PwmConfig *state, int stateIndex) {
efiAssertVoid(CUSTOM_ERR_6643, stateIndex < PWM_PHASE_MAX_COUNT, "invalid stateIndex");
efiAssertVoid(CUSTOM_ERR_6644, state->multiWave.waveCount == 1, "invalid idle waveCount");
efiAssertVoid(CUSTOM_IDLE_WAVE_CNT, state->multiWave.waveCount == 1, "invalid idle waveCount");
OutputPin *output = state->outputPins[0];
int value = state->multiWave.waves[0].pinStates[stateIndex];
/**

View File

@ -217,7 +217,7 @@ int findIndexMsg(const char *msg, const float array[], int size, float value) {
if (middle != 0 && array[middle - 1] > array[middle]) {
#if EFI_UNIT_TEST || defined(__DOXYGEN__)
firmwareError(CUSTOM_ERR_6147, "%s: out of order %.2f %.2f", msg, array[middle - 1], array[middle]);
firmwareError(CUSTOM_ERR_6610, "%s: out of order %.2f %.2f", msg, array[middle - 1], array[middle]);
#else
warning(CUSTOM_ERR_OUT_OF_ORDER, "%s: out of order %.2f %.2f", msg, array[middle - 1], array[middle]);

View File

@ -16,7 +16,7 @@
void setAlgorithm(engine_load_mode_e algo DECLARE_ENGINE_PARAMETER_SUFFIX);
#define assertEngineReference() efiAssertVoid(CUSTOM_ERR_6600, engine != NULL, "engine is NULL")
#define assertEngineReference() efiAssertVoid(CUSTOM_ENGINE_REF, engine != NULL, "engine is NULL")
#if EFI_ENABLE_ASSERTS

View File

@ -500,7 +500,7 @@ void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t trgEventIndex D
}
}
efiAssertVoid(CUSTOM_ERR_6630, !CONFIG(useOnlyRisingEdgeForTrigger) || CONFIG(ignMathCalculateAtIndex) % 2 == 0, "invalid ignMathCalculateAtIndex");
efiAssertVoid(CUSTOM_IGN_MATH_STATE, !CONFIG(useOnlyRisingEdgeForTrigger) || CONFIG(ignMathCalculateAtIndex) % 2 == 0, "invalid ignMathCalculateAtIndex");
if (trgEventIndex == CONFIG(ignMathCalculateAtIndex)) {
if (CONFIG(externalKnockSenseAdc) != EFI_ADC_NONE) {

View File

@ -378,7 +378,7 @@ void initRpmCalculator(Logging *sharedLogger, Engine *engine) {
*/
void scheduleByAngle(int rpm, scheduling_s *timer, angle_t angle,
schfunc_t callback, void *param, RpmCalculator *calc) {
efiAssertVoid(CUSTOM_ERR_6633, !cisnan(angle), "NaN angle?");
efiAssertVoid(CUSTOM_ANGLE_NAN, !cisnan(angle), "NaN angle?");
efiAssertVoid(CUSTOM_ERR_6634, isValidRpm(rpm), "RPM check expected");
float delayUs = calc->oneDegreeUs * angle;
efiAssertVoid(CUSTOM_ERR_6635, !cisnan(delayUs), "NaN delay?");

View File

@ -315,7 +315,7 @@ bool TriggerCentral::noiseFilter(efitick_t nowNt, trigger_event_e signal DECLARE
}
void TriggerCentral::handleShaftSignal(trigger_event_e signal DECLARE_ENGINE_PARAMETER_SUFFIX) {
efiAssertVoid(CUSTOM_ERR_6637, engine!=NULL, "configuration");
efiAssertVoid(CUSTOM_CONF_NULL, engine!=NULL, "configuration");
if (triggerShape.shapeDefinitionError) {
// trigger is broken, we cannot do anything here

View File

@ -56,7 +56,7 @@ void TriggerShape::calculateTriggerSynchPoint(TriggerState *state DECLARE_ENGINE
int length = getLength();
engine->engineCycleEventCount = length;
efiAssertVoid(CUSTOM_ERR_6594, length > 0, "shapeLength=0");
efiAssertVoid(CUSTOM_SHAPE_LEN_ZERO, length > 0, "shapeLength=0");
if (length >= PWM_PHASE_MAX_COUNT) {
warning(CUSTOM_ERR_TRIGGER_SHAPE_TOO_LONG, "Count above %d", length);
shapeDefinitionError = true;
@ -322,7 +322,7 @@ extern bool printTriggerDebug;
#endif
void TriggerShape::addEvent2(angle_t angle, trigger_wheel_e const waveIndex, trigger_value_e const stateParam DECLARE_ENGINE_PARAMETER_SUFFIX) {
efiAssertVoid(CUSTOM_ERR_6597, operationMode != OM_NONE, "operationMode not set");
efiAssertVoid(CUSTOM_OMODE_UNDEF, operationMode != OM_NONE, "operationMode not set");
efiAssertVoid(CUSTOM_ERR_6598, waveIndex!= T_SECONDARY || needSecondTriggerInput, "secondary needed or not?");

View File

@ -162,7 +162,7 @@ static void scheduleReboot(void) {
}
void runRusEfi(void) {
efiAssertVoid(CUSTOM_ERR_6608, getRemainingStack(chThdGetSelfX()) > 512, "init s");
efiAssertVoid(CUSTOM_RM_STACK_1, getRemainingStack(chThdGetSelfX()) > 512, "init s");
assertEngineReference();
initIntermediateLoggingBuffer();
initErrorHandling();
@ -234,7 +234,7 @@ void runRusEfi(void) {
* control is around main_trigger_callback
*/
while (true) {
efiAssertVoid(CUSTOM_ERR_6609, getRemainingStack(chThdGetSelfX()) > 128, "stack#1");
efiAssertVoid(CUSTOM_RM_STACK, getRemainingStack(chThdGetSelfX()) > 128, "stack#1");
#if (EFI_CLI_SUPPORT && !EFI_UART_ECHO_TEST_MODE) || defined(__DOXYGEN__)
// sensor state + all pending messages for our own dev console

View File

@ -53,11 +53,11 @@ static void doAddAction(const char *token, action_type_e type, Void callback, vo
}
for (int i = 0; i < consoleActionCount; i++) {
if (strcmp(token, consoleActions[i].token) == 0 /* zero result means strings are equal */) {
firmwareError(CUSTOM_ERR_6147, "Same action twice [%s]", token);
firmwareError(CUSTOM_SAME_TWICE, "Same action twice [%s]", token);
}
}
efiAssertVoid(CUSTOM_ERR_6601, consoleActionCount < CONSOLE_MAX_ACTIONS, "Too many console actions");
efiAssertVoid(CUSTOM_CONSOLE_TOO_MANY, consoleActionCount < CONSOLE_MAX_ACTIONS, "Too many console actions");
TokenCallback *current = &consoleActions[consoleActionCount++];
current->token = token;
current->parameterType = type;

View File

@ -65,7 +65,7 @@ static ALWAYS_INLINE bool validateBuffer(Logging *logging, const char *text, uin
}
void Logging::append(const char *text) {
efiAssertVoid(CUSTOM_ERR_6602, text != NULL, "append NULL");
efiAssertVoid(CUSTOM_APPEND_NULL, text != NULL, "append NULL");
uint32_t extraLen = efiStrlen(text);
bool isCapacityProblem = validateBuffer(this, text, extraLen);
if (isCapacityProblem) {
@ -121,7 +121,7 @@ void Logging::vappendPrintf(const char *fmt, va_list arg) {
// todo: replace with logging->appendPrintf
void appendPrintf(Logging *logging, const char *fmt, ...) {
efiAssertVoid(CUSTOM_ERR_6607, getRemainingStack(chThdGetSelfX()) > 128, "lowstck#4");
efiAssertVoid(CUSTOM_APPEND_STACK, getRemainingStack(chThdGetSelfX()) > 128, "lowstck#4");
va_list ap;
va_start(ap, fmt);
logging->vappendPrintf(fmt, ap);
@ -129,7 +129,7 @@ void appendPrintf(Logging *logging, const char *fmt, ...) {
}
void Logging::appendPrintf(const char *fmt, ...) {
efiAssertVoid(CUSTOM_ERR_6607, getRemainingStack(chThdGetSelfX()) > 128, "lowstck#4");
efiAssertVoid(CUSTOM_APPEND_STACK, getRemainingStack(chThdGetSelfX()) > 128, "lowstck#4");
va_list ap;
va_start(ap, fmt);
vappendPrintf(fmt, ap);