auto-sync
This commit is contained in:
parent
7143d315c1
commit
92c7a19ab4
|
@ -19,7 +19,6 @@
|
|||
#include "pwm_generator_logic.h"
|
||||
#include "efilib2.h"
|
||||
#include "settings.h"
|
||||
#include "auto_generated_enums.h"
|
||||
|
||||
#include "rpm_calculator.h"
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include "trigger_nissan.h"
|
||||
#include "trigger_toyota.h"
|
||||
#include "trigger_rover.h"
|
||||
#include "auto_generated_enums.h"
|
||||
#include "trigger_structure.h"
|
||||
#include "efiGpio.h"
|
||||
#include "engine.h"
|
||||
|
|
|
@ -61,7 +61,10 @@ void TriggerStimulatorHelper::assertSyncPositionAndSetDutyCycle(uint32_t index,
|
|||
for (uint32_t i = startIndex; i <= index + 2 * shape->getSize(); i++) {
|
||||
nextStep(state, shape, i, triggerConfig PASS_ENGINE_PARAMETER);
|
||||
}
|
||||
efiAssertVoid(state->getTotalRevolutionCounter() == 3, "sync failed, wrong gap parameters?");
|
||||
if (state->getTotalRevolutionCounter() != 3) {
|
||||
firmwareError("sync failed/wrong gap parameters trigger=%s", getTrigger_type_e(engineConfiguration->trigger.type));
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < PWM_PHASE_MAX_WAVE_PER_PWM; i++) {
|
||||
shape->dutyCycle[i] = 1.0 * state->expectedTotalTime[i] / SIMULATION_CYCLE_PERIOD;
|
||||
|
|
|
@ -29,8 +29,8 @@ typedef unsigned int time_t;
|
|||
#include "rusefi_enums.h"
|
||||
#if EFI_PROD_CODE
|
||||
#include "io_pins.h"
|
||||
#include "auto_generated_enums.h"
|
||||
#endif
|
||||
#include "auto_generated_enums.h"
|
||||
#include "obd_error_codes.h"
|
||||
#include "error_handling.h"
|
||||
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
static ICUDriver *primaryCrankDriver;
|
||||
|
||||
extern bool hasFirmwareErrorFlag;
|
||||
|
||||
EXTERN_ENGINE
|
||||
;
|
||||
static Logging *logger;
|
||||
|
@ -32,6 +34,8 @@ static Logging *logger;
|
|||
static void shaft_icu_width_callback(ICUDriver *icup) {
|
||||
// todo: support for 3rd trigger input channel
|
||||
// todo: start using real event time from HW event, not just software timer?
|
||||
if (hasFirmwareErrorFlag)
|
||||
return;
|
||||
int isPrimary = icup == primaryCrankDriver;
|
||||
if (!isPrimary && !engine->triggerShape.needSecondTriggerInput) {
|
||||
return;
|
||||
|
@ -44,6 +48,8 @@ static void shaft_icu_width_callback(ICUDriver *icup) {
|
|||
}
|
||||
|
||||
static void shaft_icu_period_callback(ICUDriver *icup) {
|
||||
if (hasFirmwareErrorFlag)
|
||||
return;
|
||||
int isPrimary = icup == primaryCrankDriver;
|
||||
if (!isPrimary && !engine->triggerShape.needSecondTriggerInput) {
|
||||
return;
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <stdbool.h>
|
||||
|
||||
#include "efitime.h"
|
||||
#include "auto_generated_enums.h"
|
||||
|
||||
#define US_TO_NT_MULTIPLIER 100
|
||||
|
||||
|
|
Loading…
Reference in New Issue