auto-sync

This commit is contained in:
rusEfi 2014-09-24 13:04:07 -05:00
parent 68a85acba0
commit b799b4800f
8 changed files with 14 additions and 4 deletions

View File

@ -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);

View File

@ -80,6 +80,7 @@ static void setIdleValvePwm(int value) {
}
static msg_t ivThread(int param) {
(void)param;
chRegSetThreadName("IdleValve");
int currentIdleValve = -1;

View File

@ -28,6 +28,7 @@ static Executor instance;
extern schfunc_t globalTimerCallback;
static void executorCallback(void *arg) {
(void)arg;
instance.onTimerCallback();
}

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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) {

View File

@ -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) {