auto-sync
This commit is contained in:
parent
8a83839ca9
commit
065c8529c1
|
@ -288,7 +288,7 @@ void Engine::watchdog() {
|
|||
return;
|
||||
if (!isSpinning) {
|
||||
if (!isRunningBenchTest() && stopPins()) {
|
||||
firmwareError(CUSTOM_ERR_6103, "Some pins were turned off by 2nd pass watchdog");
|
||||
firmwareError(CUSTOM_ERR_2ND_WATCHDOG, "Some pins were turned off by 2nd pass watchdog");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -990,7 +990,7 @@ void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_EN
|
|||
applyNonPersistentConfiguration(logger PASS_ENGINE_PARAMETER);
|
||||
// todo: eliminate triggerShape.operationMode?
|
||||
if (engineConfiguration->operationMode != engine->triggerShape.getOperationMode())
|
||||
firmwareError(CUSTOM_ERR_6100, "operationMode/trigger mismatch");
|
||||
firmwareError(CUSTOM_ERR_OP_MODE, "operationMode/trigger mismatch");
|
||||
|
||||
#if EFI_TUNER_STUDIO
|
||||
syncTunerStudioCopy();
|
||||
|
@ -1015,11 +1015,7 @@ void applyNonPersistentConfiguration(Logging * logger DECLARE_ENGINE_PARAMETER_S
|
|||
engine->triggerShape.initializeTriggerShape(logger PASS_ENGINE_PARAMETER);
|
||||
#endif
|
||||
if (engine->triggerShape.getSize() == 0) {
|
||||
firmwareError(CUSTOM_ERR_6101, "triggerShape size is zero");
|
||||
return;
|
||||
}
|
||||
if (engine->triggerShape.getSize() == 0) {
|
||||
firmwareError(CUSTOM_ERR_6102, "shaftPositionEventCount is zero");
|
||||
firmwareError(CUSTOM_ERR_TRIGGER_ZERO, "triggerShape size is zero");
|
||||
return;
|
||||
}
|
||||
engine->engineCycleEventCount = engine->triggerShape.getLength();
|
||||
|
|
|
@ -105,7 +105,7 @@ int getNumberOfInjections(injection_mode_e mode DECLARE_ENGINE_PARAMETER_S) {
|
|||
case IM_BATCH:
|
||||
return 2;
|
||||
default:
|
||||
firmwareError(CUSTOM_ERR_6104, "Unexpected getFuelMultiplier %d", mode);
|
||||
firmwareError(CUSTOM_ERR_INVALID_INJECTION_MODE, "Unexpected injection_mode_e %d", mode);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1691,7 +1691,7 @@ typedef enum {
|
|||
CUSTOM_OBD_22 = 6022,
|
||||
CUSTOM_OBD_23 = 6023,
|
||||
CUSTOM_OBD_24 = 6024,
|
||||
CUSTOM_OBD_25 = 6025,
|
||||
CUSTOM_OBD_MAP_VALUE = 6025,
|
||||
CUSTOM_OBD_26 = 6026,
|
||||
CUSTOM_OBD_27 = 6027,
|
||||
CUSTOM_OBD_28 = 6028,
|
||||
|
@ -1774,29 +1774,29 @@ typedef enum {
|
|||
CUSTOM_DWELL = 6098,
|
||||
CUSTOM_TS_OVERFLOW = 6099,
|
||||
|
||||
CUSTOM_ERR_6100 = 6100,
|
||||
CUSTOM_ERR_6101 = 6101,
|
||||
CUSTOM_ERR_OP_MODE = 6100,
|
||||
CUSTOM_ERR_TRIGGER_ZERO = 6101,
|
||||
CUSTOM_ERR_6102 = 6102,
|
||||
CUSTOM_ERR_6103 = 6103,
|
||||
CUSTOM_ERR_6104 = 6104,
|
||||
CUSTOM_ERR_6105 = 6105,
|
||||
CUSTOM_ERR_6106 = 6106,
|
||||
CUSTOM_ERR_2ND_WATCHDOG = 6103,
|
||||
CUSTOM_ERR_INVALID_INJECTION_MODE = 6104,
|
||||
CUSTOM_ERR_WAVE_1 = 6105,
|
||||
CUSTOM_ERR_WAVE_2 = 6106,
|
||||
CUSTOM_ERR_6107 = 6107,
|
||||
CUSTOM_ERR_6108 = 6108,
|
||||
CUSTOM_ERR_6109 = 6109,
|
||||
|
||||
CUSTOM_ERR_6110 = 6110,
|
||||
CUSTOM_ERR_INTERPOLATE = 6110,
|
||||
CUSTOM_ERR_6111 = 6111,
|
||||
CUSTOM_ERR_6112 = 6112,
|
||||
CUSTOM_ERR_6113 = 6113,
|
||||
CUSTOM_ERR_6114 = 6114,
|
||||
CUSTOM_ERR_6115 = 6115,
|
||||
CUSTOM_ERR_6116 = 6116,
|
||||
CUSTOM_ERR_6117 = 6117,
|
||||
CUSTOM_ERR_6118 = 6118,
|
||||
CUSTOM_ERR_6119 = 6119,
|
||||
CUSTOM_ERR_MAP_TYPE = 6112,
|
||||
CUSTOM_ERR_THERM = 6113,
|
||||
CUSTOM_ERR_LOG_ERROR = 6114,
|
||||
CUSTOM_ERR_LOOPED_QUEUE = 6115,
|
||||
CUSTOM_ERR_PWM_1 = 6116,
|
||||
CUSTOM_ERR_PWM_2 = 6117,
|
||||
CUSTOM_ERR_DWELL_DURATION = 6118,
|
||||
CUSTOM_ERR_NO_SHAPE = 6119,
|
||||
|
||||
CUSTOM_ERR_6120 = 6120,
|
||||
CUSTOM_ERR_TRIGGER_SYNC = 6120,
|
||||
CUSTOM_ERR_6121 = 6121,
|
||||
CUSTOM_ERR_6122 = 6122,
|
||||
CUSTOM_ERR_6123 = 6123,
|
||||
|
@ -1807,12 +1807,12 @@ typedef enum {
|
|||
CUSTOM_ERR_6128 = 6128,
|
||||
CUSTOM_ERR_6129 = 6129,
|
||||
|
||||
CUSTOM_ERR_6130 = 6130,
|
||||
CUSTOM_ERR_6131 = 6131,
|
||||
CUSTOM_ERR_6132 = 6132,
|
||||
CUSTOM_ERR_6133 = 6133,
|
||||
CUSTOM_ERR_6134 = 6134,
|
||||
CUSTOM_ERR_6135 = 6135,
|
||||
CUSTOM_ERR_INVALID_PIN = 6130,
|
||||
CUSTOM_ERR_PIN_REPO = 6131,
|
||||
CUSTOM_ERR_UNKNOWN_PORT = 6132,
|
||||
CUSTOM_ERR_PIN_ALREADY_USED_1 = 6133,
|
||||
CUSTOM_ERR_PIN_ALREADY_USED_2 = 6134,
|
||||
CUSTOM_ERR_ICU_STATE = 6135,
|
||||
CUSTOM_ERR_6136 = 6136,
|
||||
CUSTOM_ERR_6137 = 6137,
|
||||
CUSTOM_ERR_6138 = 6138,
|
||||
|
|
|
@ -51,12 +51,12 @@ float multi_wave_s::getSwitchTime(int index) const {
|
|||
|
||||
void checkSwitchTimes2(int size, float *switchTimes) {
|
||||
if (switchTimes[size - 1] != 1) {
|
||||
firmwareError(CUSTOM_ERR_6105, "last switch time has to be 1 not %f", switchTimes[size - 1]);
|
||||
firmwareError(CUSTOM_ERR_WAVE_1, "last switch time has to be 1 not %f", switchTimes[size - 1]);
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < size - 1; i++) {
|
||||
if (switchTimes[i] >= switchTimes[i + 1]) {
|
||||
firmwareError(CUSTOM_ERR_6106, "invalid switchTimes @%d: %f/%f", i, switchTimes[i], switchTimes[i + 1]);
|
||||
firmwareError(CUSTOM_ERR_WAVE_2, "invalid switchTimes @%d: %f/%f", i, switchTimes[i], switchTimes[i + 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ FastInterpolation::FastInterpolation(float x1, float y1, float x2, float y2) {
|
|||
|
||||
void FastInterpolation::init(float x1, float y1, float x2, float y2) {
|
||||
if (x1 == x2) {
|
||||
firmwareError(CUSTOM_ERR_6110, "init: Same x1 and x2 in interpolate: %f/%f", x1, x2);
|
||||
firmwareError(CUSTOM_ERR_INTERPOLATE, "init: Same x1 and x2 in interpolate: %f/%f", x1, x2);
|
||||
return;
|
||||
}
|
||||
a = INTERPOLATION_A(x1, y1, x2, y2);
|
||||
|
|
|
@ -88,7 +88,7 @@ float decodePressure(float voltage, air_pressure_sensor_config_s * mapConfig DEC
|
|||
case MT_MPX4100:
|
||||
return mpx4100.getValue(voltage);
|
||||
default:
|
||||
firmwareError(CUSTOM_ERR_6111, "Unknown MAP type: %d", mapConfig->type);
|
||||
firmwareError(CUSTOM_ERR_MAP_TYPE, "Unknown MAP type: %d", mapConfig->type);
|
||||
return NAN;
|
||||
}
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ float decodePressure(float voltage, air_pressure_sensor_config_s * mapConfig DEC
|
|||
*/
|
||||
float validateMap(float mapKPa DECLARE_ENGINE_PARAMETER_S) {
|
||||
if (cisnan(mapKPa) || mapKPa < CONFIG(mapErrorDetectionTooLow) || mapKPa > CONFIG(mapErrorDetectionTooHigh)) {
|
||||
warning(CUSTOM_OBD_25, "unexpected MAP value: %f", mapKPa);
|
||||
warning(CUSTOM_OBD_MAP_VALUE, "unexpected MAP value: %f", mapKPa);
|
||||
return 0;
|
||||
}
|
||||
return mapKPa;
|
||||
|
@ -159,7 +159,7 @@ static FastInterpolation *getDecoder(air_pressure_sensor_type_e type) {
|
|||
case MT_GM_3_BAR:
|
||||
return &gm3bar;
|
||||
default:
|
||||
firmwareError(CUSTOM_ERR_6112, "Unknown MAP type: %d", type);
|
||||
firmwareError(CUSTOM_ERR_MAP_TYPE, "Unknown MAP type: %d", type);
|
||||
return &customMap;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ float getResistance(ThermistorConf *config) {
|
|||
|
||||
float getTemperatureC(ThermistorConf *config, ThermistorMath *tm) {
|
||||
if (!initialized) {
|
||||
firmwareError(CUSTOM_ERR_6113, "thermstr not initialized");
|
||||
firmwareError(CUSTOM_ERR_THERM, "thermstr not initialized");
|
||||
return NAN;
|
||||
}
|
||||
float resistance = getResistance(config);
|
||||
|
@ -137,7 +137,7 @@ static void prepareThermistorCurve(thermistor_conf_s *tc, thermistor_curve_s * c
|
|||
|
||||
float L1 = logf(tc->resistance_1);
|
||||
if (L1 == tc->resistance_1) {
|
||||
firmwareError(CUSTOM_ERR_6114, "log is broken?");
|
||||
firmwareError(CUSTOM_ERR_LOG_ERROR, "log is broken?");
|
||||
}
|
||||
float L2 = logf(tc->resistance_2);
|
||||
float L3 = logf(tc->resistance_3);
|
||||
|
|
|
@ -26,7 +26,7 @@ bool assertNotInList(T *head, T*element) {
|
|||
LL_FOREACH(head, current)
|
||||
{
|
||||
if (++counter > QUEUE_LENGTH_LIMIT) {
|
||||
firmwareError(CUSTOM_ERR_6115, "Looped queue?");
|
||||
firmwareError(CUSTOM_ERR_LOOPED_QUEUE, "Looped queue?");
|
||||
return false;
|
||||
}
|
||||
if (current == element) {
|
||||
|
|
|
@ -182,11 +182,11 @@ void PwmConfig::weComplexInit(const char *msg, int phaseCount, float *switchTime
|
|||
|
||||
efiAssertVoid(periodNt != 0, "period is not initialized");
|
||||
if (phaseCount == 0) {
|
||||
firmwareError(CUSTOM_ERR_6116, "signal length cannot be zero");
|
||||
firmwareError(CUSTOM_ERR_PWM_1, "signal length cannot be zero");
|
||||
return;
|
||||
}
|
||||
if (phaseCount > PWM_PHASE_MAX_COUNT) {
|
||||
firmwareError(CUSTOM_ERR_6117, "too many phases in PWM");
|
||||
firmwareError(CUSTOM_ERR_PWM_2, "too many phases in PWM");
|
||||
return;
|
||||
}
|
||||
efiAssertVoid(waveCount > 0, "waveCount should be positive");
|
||||
|
|
|
@ -440,7 +440,7 @@ static ALWAYS_INLINE void ignitionMathCalc(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
|||
float dwellMs = ENGINE(engineState.sparkDwell);
|
||||
|
||||
if (cisnan(dwellMs) || dwellMs < 0) {
|
||||
firmwareError(CUSTOM_ERR_6118, "invalid dwell: %f at %d", dwellMs, rpm);
|
||||
firmwareError(CUSTOM_ERR_DWELL_DURATION, "invalid dwell: %f at %d", dwellMs, rpm);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -599,7 +599,7 @@ void TriggerShape::initializeTriggerShape(Logging *logger DECLARE_ENGINE_PARAMET
|
|||
break;
|
||||
|
||||
default:
|
||||
firmwareError(CUSTOM_ERR_6119, "initializeTriggerShape() not implemented: %d", triggerConfig->type);
|
||||
firmwareError(CUSTOM_ERR_NO_SHAPE, "initializeTriggerShape() not implemented: %d", triggerConfig->type);
|
||||
return;
|
||||
}
|
||||
wave.checkSwitchTimes(getSize());
|
||||
|
|
|
@ -79,6 +79,6 @@ uint32_t TriggerStimulatorHelper::doFindTrigger(TriggerShape * shape,
|
|||
if (state->shaft_is_synchronized)
|
||||
return i;
|
||||
}
|
||||
firmwareError(CUSTOM_ERR_6120, "findTriggerZeroEventIndex() failed");
|
||||
firmwareError(CUSTOM_ERR_TRIGGER_SYNC, "findTriggerZeroEventIndex() failed");
|
||||
return EFI_ERROR_CODE;
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ ioportid_t getHwPort(brain_pin_e brainPin) {
|
|||
if (brainPin == GPIO_UNASSIGNED)
|
||||
return GPIO_NULL;
|
||||
if (brainPin > GPIO_UNASSIGNED || brainPin < 0) {
|
||||
firmwareError(CUSTOM_ERR_6130, "Invalid brain_pin_e: %d", brainPin);
|
||||
firmwareError(CUSTOM_ERR_INVALID_PIN, "Invalid brain_pin_e: %d", brainPin);
|
||||
return GPIO_NULL;
|
||||
}
|
||||
return PORTS[brainPin / PORT_SIZE];
|
||||
|
@ -74,7 +74,7 @@ ioportmask_t getHwPin(brain_pin_e brainPin) {
|
|||
if (brainPin == GPIO_UNASSIGNED)
|
||||
return EFI_ERROR_CODE;
|
||||
if (brainPin > GPIO_UNASSIGNED || brainPin < 0) {
|
||||
firmwareError(CUSTOM_ERR_6131, "Invalid brain_pin_e: %d", brainPin);
|
||||
firmwareError(CUSTOM_ERR_INVALID_PIN, "Invalid brain_pin_e: %d", brainPin);
|
||||
return EFI_ERROR_CODE;
|
||||
}
|
||||
return brainPin % PORT_SIZE;
|
||||
|
|
|
@ -80,7 +80,7 @@ static int getPortIndex(ioportid_t port) {
|
|||
if (port == GPIOH)
|
||||
return 6;
|
||||
#endif /* defined(STM32F4XX) */
|
||||
firmwareError(CUSTOM_ERR_6132, "unknown port");
|
||||
firmwareError(CUSTOM_ERR_UNKNOWN_PORT, "unknown port");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,7 @@ const char * getPinFunction(brain_input_pin_e brainPin) {
|
|||
*/
|
||||
void mySetPadMode(const char *msg, ioportid_t port, ioportmask_t pin, iomode_t mode) {
|
||||
if (!initialized) {
|
||||
firmwareError(CUSTOM_ERR_6132, "repository not initialized");
|
||||
firmwareError(CUSTOM_ERR_PIN_REPO, "repository not initialized");
|
||||
return;
|
||||
}
|
||||
if (port == GPIO_NULL)
|
||||
|
@ -216,7 +216,7 @@ void mySetPadMode(const char *msg, ioportid_t port, ioportmask_t pin, iomode_t m
|
|||
* connected, so the warning is never displayed on the console and that's quite a problem!
|
||||
*/
|
||||
// warning(OBD_PCM_Processor_Fault, "%s%d req by %s used by %s", portname(port), pin, msg, PIN_USED[index]);
|
||||
firmwareError(CUSTOM_ERR_6133, "%s%d req by %s used by %s", portname(port), pin, msg, PIN_USED[index]);
|
||||
firmwareError(CUSTOM_ERR_PIN_ALREADY_USED_1, "%s%d req by %s used by %s", portname(port), pin, msg, PIN_USED[index]);
|
||||
return;
|
||||
}
|
||||
markUsed(index, msg);
|
||||
|
@ -250,7 +250,7 @@ void registedFundamentralIoPin(char *msg, ioportid_t port, ioportmask_t pin, iom
|
|||
if (PIN_USED[index] != NULL) {
|
||||
print("!!!!!!!!!!!!! Already used [%s] %d\r\n", msg, pin);
|
||||
print("!!!!!!!!!!!!! Already used by [%s]\r\n", PIN_USED[index]);
|
||||
firmwareError(CUSTOM_ERR_6134, "pin already used");
|
||||
firmwareError(CUSTOM_ERR_PIN_ALREADY_USED_2, "pin already used");
|
||||
return;
|
||||
}
|
||||
markUsed(index, msg);
|
||||
|
|
|
@ -114,7 +114,7 @@ static ICUDriver *turnOnTriggerInputPin(brain_pin_e hwPin, ICUConfig *icucfg) {
|
|||
icuEnable(driver);
|
||||
} else {
|
||||
// we would be here for example if same pin is used for multiple input capture purposes
|
||||
firmwareError(CUSTOM_ERR_6135, "ICU unexpected state [%s]", hwPortname(hwPin));
|
||||
firmwareError(CUSTOM_ERR_ICU_STATE, "ICU unexpected state [%s]", hwPortname(hwPin));
|
||||
}
|
||||
}
|
||||
return driver;
|
||||
|
|
Loading…
Reference in New Issue