auto-sync
This commit is contained in:
parent
68a85acba0
commit
b799b4800f
|
@ -163,6 +163,7 @@ int getTimeNowSeconds(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void onEvenyGeneralMilliseconds(void *arg) {
|
static void onEvenyGeneralMilliseconds(void *arg) {
|
||||||
|
(void)arg;
|
||||||
/**
|
/**
|
||||||
* We need to push current value into the 64 bit counter often enough so that we do not miss an overflow
|
* We need to push current value into the 64 bit counter often enough so that we do not miss an overflow
|
||||||
*/
|
*/
|
||||||
|
@ -191,6 +192,7 @@ static void initPeriodicEvents(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fuelPumpOff(void *arg) {
|
static void fuelPumpOff(void *arg) {
|
||||||
|
(void)arg;
|
||||||
if (getOutputPinValue(FUEL_PUMP_RELAY))
|
if (getOutputPinValue(FUEL_PUMP_RELAY))
|
||||||
scheduleMsg(&logger, "fuelPump OFF at %s%d", hwPortname(boardConfiguration->fuelPumpPin));
|
scheduleMsg(&logger, "fuelPump OFF at %s%d", hwPortname(boardConfiguration->fuelPumpPin));
|
||||||
turnOutputPinOff(FUEL_PUMP_RELAY);
|
turnOutputPinOff(FUEL_PUMP_RELAY);
|
||||||
|
|
|
@ -80,6 +80,7 @@ static void setIdleValvePwm(int value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static msg_t ivThread(int param) {
|
static msg_t ivThread(int param) {
|
||||||
|
(void)param;
|
||||||
chRegSetThreadName("IdleValve");
|
chRegSetThreadName("IdleValve");
|
||||||
|
|
||||||
int currentIdleValve = -1;
|
int currentIdleValve = -1;
|
||||||
|
|
|
@ -28,6 +28,7 @@ static Executor instance;
|
||||||
extern schfunc_t globalTimerCallback;
|
extern schfunc_t globalTimerCallback;
|
||||||
|
|
||||||
static void executorCallback(void *arg) {
|
static void executorCallback(void *arg) {
|
||||||
|
(void)arg;
|
||||||
instance.onTimerCallback();
|
instance.onTimerCallback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -152,6 +152,7 @@ static void onTdcCallback(void) {
|
||||||
* This trigger callback schedules the actual physical TDC callback in relation to trigger synchronization point.
|
* This trigger callback schedules the actual physical TDC callback in relation to trigger synchronization point.
|
||||||
*/
|
*/
|
||||||
static void tdcMarkCallback(trigger_event_e ckpSignalType, uint32_t index0, void *arg) {
|
static void tdcMarkCallback(trigger_event_e ckpSignalType, uint32_t index0, void *arg) {
|
||||||
|
(void)ckpSignalType;
|
||||||
bool isTriggerSynchronizationPoint = index0 == 0;
|
bool isTriggerSynchronizationPoint = index0 == 0;
|
||||||
if (isTriggerSynchronizationPoint) {
|
if (isTriggerSynchronizationPoint) {
|
||||||
int revIndex2 = getRevolutionCounter() % 2;
|
int revIndex2 = getRevolutionCounter() % 2;
|
||||||
|
|
|
@ -222,6 +222,7 @@ float getTriggerDutyCycle(int index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void initTriggerCentral(Engine *engine) {
|
void initTriggerCentral(Engine *engine) {
|
||||||
|
// todo: use 'engine' parameter and eliminate 'extern'
|
||||||
strcpy((char*) shaft_signal_msg_index, "_");
|
strcpy((char*) shaft_signal_msg_index, "_");
|
||||||
|
|
||||||
#if EFI_WAVE_CHART
|
#if EFI_WAVE_CHART
|
||||||
|
|
|
@ -45,7 +45,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Total time result for previous trigger cycle
|
* Total time result for previous trigger cycle
|
||||||
*/
|
*/
|
||||||
int prevTotalTime[PWM_PHASE_MAX_WAVE_PER_PWM];
|
uint32_t prevTotalTime[PWM_PHASE_MAX_WAVE_PER_PWM];
|
||||||
int expectedTotalTime[PWM_PHASE_MAX_WAVE_PER_PWM];
|
int expectedTotalTime[PWM_PHASE_MAX_WAVE_PER_PWM];
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -53,15 +53,15 @@ private:
|
||||||
/**
|
/**
|
||||||
* index within trigger revolution, from 0 to trigger event count
|
* index within trigger revolution, from 0 to trigger event count
|
||||||
*/
|
*/
|
||||||
int current_index;
|
uint32_t current_index;
|
||||||
/**
|
/**
|
||||||
* Number of actual events within current trigger cycle
|
* Number of actual events within current trigger cycle
|
||||||
* see trigger_shape_s
|
* see trigger_shape_s
|
||||||
*/
|
*/
|
||||||
int eventCount[PWM_PHASE_MAX_WAVE_PER_PWM];
|
uint32_t eventCount[PWM_PHASE_MAX_WAVE_PER_PWM];
|
||||||
uint64_t timeOfPreviousEvent[PWM_PHASE_MAX_WAVE_PER_PWM];
|
uint64_t timeOfPreviousEvent[PWM_PHASE_MAX_WAVE_PER_PWM];
|
||||||
uint64_t totalEventCountBase;
|
uint64_t totalEventCountBase;
|
||||||
int totalRevolutionCounter;
|
uint32_t totalRevolutionCounter;
|
||||||
bool isFirstEvent;
|
bool isFirstEvent;
|
||||||
uint64_t prevCycleDuration;
|
uint64_t prevCycleDuration;
|
||||||
uint64_t startOfCycle;
|
uint64_t startOfCycle;
|
||||||
|
|
|
@ -78,6 +78,7 @@ void setDefaultPinState(io_pin_e pin, pin_output_mode_e *outputMode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void comBlinkingThread(void *arg) {
|
static void comBlinkingThread(void *arg) {
|
||||||
|
(void)arg;
|
||||||
chRegSetThreadName("communication blinking");
|
chRegSetThreadName("communication blinking");
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
int delay;
|
int delay;
|
||||||
|
@ -105,6 +106,7 @@ static void comBlinkingThread(void *arg) {
|
||||||
int isTriggerDecoderError(void);
|
int isTriggerDecoderError(void);
|
||||||
|
|
||||||
static void errBlinkingThread(void *arg) {
|
static void errBlinkingThread(void *arg) {
|
||||||
|
(void)arg;
|
||||||
chRegSetThreadName("err blinking");
|
chRegSetThreadName("err blinking");
|
||||||
#if EFI_ENGINE_CONTROL
|
#if EFI_ENGINE_CONTROL
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
|
|
|
@ -52,6 +52,7 @@ void setHardwareUsTimer(int32_t timeUs) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void callback(GPTDriver *gptp) {
|
static void callback(GPTDriver *gptp) {
|
||||||
|
(void)gptp;
|
||||||
timerCallbackCounter++;
|
timerCallbackCounter++;
|
||||||
if (globalTimerCallback == NULL) {
|
if (globalTimerCallback == NULL) {
|
||||||
firmwareError("NULL globalTimerCallback");
|
firmwareError("NULL globalTimerCallback");
|
||||||
|
@ -78,6 +79,7 @@ static const char * msg;
|
||||||
static char buff[32];
|
static char buff[32];
|
||||||
|
|
||||||
static msg_t mwThread(int param) {
|
static msg_t mwThread(int param) {
|
||||||
|
(void)param;
|
||||||
chRegSetThreadName("timer watchdog");
|
chRegSetThreadName("timer watchdog");
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
|
|
Loading…
Reference in New Issue