auto-sync
This commit is contained in:
parent
68a85acba0
commit
b799b4800f
|
@ -163,6 +163,7 @@ int getTimeNowSeconds(void) {
|
|||
}
|
||||
|
||||
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
|
||||
*/
|
||||
|
@ -191,6 +192,7 @@ static void initPeriodicEvents(void) {
|
|||
}
|
||||
|
||||
static void fuelPumpOff(void *arg) {
|
||||
(void)arg;
|
||||
if (getOutputPinValue(FUEL_PUMP_RELAY))
|
||||
scheduleMsg(&logger, "fuelPump OFF at %s%d", hwPortname(boardConfiguration->fuelPumpPin));
|
||||
turnOutputPinOff(FUEL_PUMP_RELAY);
|
||||
|
|
|
@ -80,6 +80,7 @@ static void setIdleValvePwm(int value) {
|
|||
}
|
||||
|
||||
static msg_t ivThread(int param) {
|
||||
(void)param;
|
||||
chRegSetThreadName("IdleValve");
|
||||
|
||||
int currentIdleValve = -1;
|
||||
|
|
|
@ -28,6 +28,7 @@ static Executor instance;
|
|||
extern schfunc_t globalTimerCallback;
|
||||
|
||||
static void executorCallback(void *arg) {
|
||||
(void)arg;
|
||||
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.
|
||||
*/
|
||||
static void tdcMarkCallback(trigger_event_e ckpSignalType, uint32_t index0, void *arg) {
|
||||
(void)ckpSignalType;
|
||||
bool isTriggerSynchronizationPoint = index0 == 0;
|
||||
if (isTriggerSynchronizationPoint) {
|
||||
int revIndex2 = getRevolutionCounter() % 2;
|
||||
|
|
|
@ -222,6 +222,7 @@ float getTriggerDutyCycle(int index) {
|
|||
}
|
||||
|
||||
void initTriggerCentral(Engine *engine) {
|
||||
// todo: use 'engine' parameter and eliminate 'extern'
|
||||
strcpy((char*) shaft_signal_msg_index, "_");
|
||||
|
||||
#if EFI_WAVE_CHART
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
/**
|
||||
* 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];
|
||||
|
||||
private:
|
||||
|
@ -53,15 +53,15 @@ private:
|
|||
/**
|
||||
* 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
|
||||
* 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 totalEventCountBase;
|
||||
int totalRevolutionCounter;
|
||||
uint32_t totalRevolutionCounter;
|
||||
bool isFirstEvent;
|
||||
uint64_t prevCycleDuration;
|
||||
uint64_t startOfCycle;
|
||||
|
|
|
@ -78,6 +78,7 @@ void setDefaultPinState(io_pin_e pin, pin_output_mode_e *outputMode) {
|
|||
}
|
||||
|
||||
static void comBlinkingThread(void *arg) {
|
||||
(void)arg;
|
||||
chRegSetThreadName("communication blinking");
|
||||
while (TRUE) {
|
||||
int delay;
|
||||
|
@ -105,6 +106,7 @@ static void comBlinkingThread(void *arg) {
|
|||
int isTriggerDecoderError(void);
|
||||
|
||||
static void errBlinkingThread(void *arg) {
|
||||
(void)arg;
|
||||
chRegSetThreadName("err blinking");
|
||||
#if EFI_ENGINE_CONTROL
|
||||
while (TRUE) {
|
||||
|
|
|
@ -52,6 +52,7 @@ void setHardwareUsTimer(int32_t timeUs) {
|
|||
}
|
||||
|
||||
static void callback(GPTDriver *gptp) {
|
||||
(void)gptp;
|
||||
timerCallbackCounter++;
|
||||
if (globalTimerCallback == NULL) {
|
||||
firmwareError("NULL globalTimerCallback");
|
||||
|
@ -78,6 +79,7 @@ static const char * msg;
|
|||
static char buff[32];
|
||||
|
||||
static msg_t mwThread(int param) {
|
||||
(void)param;
|
||||
chRegSetThreadName("timer watchdog");
|
||||
|
||||
while (TRUE) {
|
||||
|
|
Loading…
Reference in New Issue