mirror of https://github.com/rusefi/rusefi-1.git
bugfix: set_toothed_wheel command
This commit is contained in:
parent
4ffa5f6803
commit
227528c8fe
|
@ -518,7 +518,14 @@ static void setTriggerType(int value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setToothedWheel(int total, int skipped DECLARE_ENGINE_PARAMETER_S) {
|
static void setToothedWheel(int total, int skipped DECLARE_ENGINE_PARAMETER_S) {
|
||||||
|
if (total < 1 || skipped >= total) {
|
||||||
|
scheduleMsg(&logger, "invalid parameters %d %d", total, skipped);
|
||||||
|
return;
|
||||||
|
}
|
||||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
|
||||||
|
engineConfiguration->trigger.customTotalToothCount = total;
|
||||||
|
engineConfiguration->trigger.customSkippedToothCount = skipped;
|
||||||
|
|
||||||
scheduleMsg(&logger, "toothed: total=%d/skipped=%d", total, skipped);
|
scheduleMsg(&logger, "toothed: total=%d/skipped=%d", total, skipped);
|
||||||
setToothedWheelConfiguration(&engine->triggerShape, total, skipped, engineConfiguration->operationMode);
|
setToothedWheelConfiguration(&engine->triggerShape, total, skipped, engineConfiguration->operationMode);
|
||||||
// initializeTriggerShape(&logger, engineConfiguration, engineConfiguration2);
|
// initializeTriggerShape(&logger, engineConfiguration, engineConfiguration2);
|
||||||
|
|
|
@ -30,7 +30,10 @@ void addSkippedToothTriggerEvents(trigger_wheel_e wheel, TriggerShape *s, int to
|
||||||
|
|
||||||
void initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount, int skippedCount,
|
void initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount, int skippedCount,
|
||||||
operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_S) {
|
operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_S) {
|
||||||
efiAssertVoid(totalTeethCount > 0, "totalTeethCount is zero");
|
if (totalTeethCount <= 0) {
|
||||||
|
firmwareError(CUSTOM_ERR_6143, "totalTeethCount is zero or less: %d", totalTeethCount);
|
||||||
|
return;
|
||||||
|
}
|
||||||
efiAssertVoid(s != NULL, "TriggerShape is NULL");
|
efiAssertVoid(s != NULL, "TriggerShape is NULL");
|
||||||
s->initialize(operationMode, false);
|
s->initialize(operationMode, false);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue