auto-sync

This commit is contained in:
rusEfi 2014-09-24 14:03:03 -05:00
parent b799b4800f
commit 520a4fccee
13 changed files with 18 additions and 2 deletions

View File

@ -400,6 +400,7 @@ extern TunerStudioOutputChannels tsOutputChannels;
#endif /* EFI_TUNER_STUDIO */ #endif /* EFI_TUNER_STUDIO */
static void tsStatusThread(void *arg) { static void tsStatusThread(void *arg) {
(void)arg;
chRegSetThreadName("tuner s"); chRegSetThreadName("tuner s");
while (true) { while (true) {
#if EFI_TUNER_STUDIO #if EFI_TUNER_STUDIO

View File

@ -81,6 +81,7 @@ float getFuelMs(int rpm, Engine *engine) {
} }
} }
// todo: start using 'engine' parameter and not 'extern'
float getRunningFuel(float baseFuel, Engine *engine, int rpm) { float getRunningFuel(float baseFuel, Engine *engine, int rpm) {
float iatCorrection = getIatCorrection(getIntakeAirTemperature()); float iatCorrection = getIatCorrection(getIntakeAirTemperature());
float cltCorrection = getCltCorrection(getCoolantTemperature()); float cltCorrection = getCltCorrection(getCoolantTemperature());

View File

@ -199,6 +199,7 @@ static void fuelPumpOff(void *arg) {
} }
static void fuelPumpOn(trigger_event_e signal, uint32_t index, void *arg) { static void fuelPumpOn(trigger_event_e signal, uint32_t index, void *arg) {
(void)arg;
if (index != 0) if (index != 0)
return; // let's not abuse the timer - one time per revolution would be enough return; // let's not abuse the timer - one time per revolution would be enough
// todo: the check about GPIO_NONE should be somewhere else! // todo: the check about GPIO_NONE should be somewhere else!

View File

@ -155,6 +155,7 @@ static void sparkbench(const char * onTimeStr, const char *offTimeStr, const cha
static THD_WORKING_AREA(benchThreadStack, UTILITY_THREAD_STACK_SIZE); static THD_WORKING_AREA(benchThreadStack, UTILITY_THREAD_STACK_SIZE);
static msg_t benchThread(int param) { static msg_t benchThread(int param) {
(void)param;
chRegSetThreadName("BenchThread"); chRegSetThreadName("BenchThread");
while (TRUE) { while (TRUE) {

View File

@ -71,7 +71,8 @@ extern engine_configuration_s *engineConfiguration;
static scheduling_s startTimer[2]; static scheduling_s startTimer[2];
static scheduling_s endTimer[2]; static scheduling_s endTimer[2];
static void startAveraging(void*arg) { static void startAveraging(void *arg) {
(void) arg;
bool wasLocked = lockAnyContext(); bool wasLocked = lockAnyContext();
; ;
// with locking we would have a consistent state // with locking we would have a consistent state
@ -111,6 +112,7 @@ void mapAveragingCallback(adcsample_t value) {
} }
static void endAveraging(void *arg) { static void endAveraging(void *arg) {
(void) arg;
bool wasLocked = lockAnyContext(); bool wasLocked = lockAnyContext();
// with locking we would have a consistent state // with locking we would have a consistent state
v_averagedMapValue = v_mapAccumulator / mapMeasurementsCounter; v_averagedMapValue = v_mapAccumulator / mapMeasurementsCounter;

View File

@ -231,6 +231,7 @@ extern Engine engine;
* Both injection and ignition are controlled from this method. * Both injection and ignition are controlled from this method.
*/ */
void onTriggerEvent(trigger_event_e ckpSignalType, uint32_t eventIndex, MainTriggerCallback *mainTriggerCallback) { void onTriggerEvent(trigger_event_e ckpSignalType, uint32_t eventIndex, MainTriggerCallback *mainTriggerCallback) {
(void)ckpSignalType;
efiAssertVoid(eventIndex < 2 * mainTriggerCallback->engineConfiguration2->triggerShape.shaftPositionEventCount, efiAssertVoid(eventIndex < 2 * mainTriggerCallback->engineConfiguration2->triggerShape.shaftPositionEventCount,
"event index"); "event index");
efiAssertVoid(getRemainingStack(chThdSelf()) > 16, "stack#3"); efiAssertVoid(getRemainingStack(chThdSelf()) > 16, "stack#3");

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. * 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)arg;
(void)ckpSignalType; (void)ckpSignalType;
bool isTriggerSynchronizationPoint = index0 == 0; bool isTriggerSynchronizationPoint = index0 == 0;
if (isTriggerSynchronizationPoint) { if (isTriggerSynchronizationPoint) {

View File

@ -80,6 +80,7 @@ static trigger_value_e eventType[6] = { TV_LOW, TV_HIGH, TV_LOW, TV_HIGH, TV_LOW
*/ */
void TriggerState::decodeTriggerEvent(trigger_shape_s const*triggerShape, trigger_config_s const*triggerConfig, void TriggerState::decodeTriggerEvent(trigger_shape_s const*triggerShape, trigger_config_s const*triggerConfig,
trigger_event_e const signal, uint64_t nowUs) { trigger_event_e const signal, uint64_t nowUs) {
(void)triggerConfig; // we might want this for logging?
efiAssertVoid(signal <= SHAFT_3RD_UP, "unexpected signal"); efiAssertVoid(signal <= SHAFT_3RD_UP, "unexpected signal");
trigger_wheel_e triggerWheel = eventIndex[signal]; trigger_wheel_e triggerWheel = eventIndex[signal];

View File

@ -44,7 +44,7 @@ public:
/** /**
* This is used for signal validation * This is used for signal validation
*/ */
int expectedEventCount[PWM_PHASE_MAX_WAVE_PER_PWM]; uint32_t expectedEventCount[PWM_PHASE_MAX_WAVE_PER_PWM];
void addEvent(float angle, trigger_wheel_e const waveIndex, trigger_value_e const state); void addEvent(float angle, trigger_wheel_e const waveIndex, trigger_value_e const state);
void reset(operation_mode_e operationMode); void reset(operation_mode_e operationMode);

View File

@ -58,6 +58,7 @@ void emulate(void) {
static int flag = FALSE; static int flag = FALSE;
static msg_t eeThread(void *arg) { static msg_t eeThread(void *arg) {
(void)arg;
chRegSetThreadName("Engine"); chRegSetThreadName("Engine");
while (TRUE) { while (TRUE) {

View File

@ -138,6 +138,8 @@ static void initWave(const char *name, int index) {
#endif #endif
static void waTriggerEventListener(trigger_event_e ckpSignalType, uint32_t index, void *arg) { static void waTriggerEventListener(trigger_event_e ckpSignalType, uint32_t index, void *arg) {
(void)ckpSignalType;
(void)arg;
if (index != 0) { if (index != 0) {
return; return;
} }
@ -151,6 +153,7 @@ static THD_WORKING_AREA(waThreadStack, UTILITY_THREAD_STACK_SIZE);
//static Logging logger; //static Logging logger;
static msg_t waThread(void *arg) { static msg_t waThread(void *arg) {
(void)arg;
chRegSetThreadName("Wave Analyzer"); chRegSetThreadName("Wave Analyzer");
#if EFI_WAVE_CHART #if EFI_WAVE_CHART
while (TRUE) { while (TRUE) {

View File

@ -106,6 +106,7 @@ static brain_pin_e BLINK_PINS[] = { GPIOE_8, // HIGH DRIVER 1
static THD_WORKING_AREA(btThreadStack, UTILITY_THREAD_STACK_SIZE); static THD_WORKING_AREA(btThreadStack, UTILITY_THREAD_STACK_SIZE);
static msg_t ivThread(int param) { static msg_t ivThread(int param) {
(void)param;
chRegSetThreadName("board test blinking"); chRegSetThreadName("board test blinking");
int value = 0; int value = 0;

View File

@ -26,12 +26,14 @@ static void date_help(void) {
#endif /* EFI_RTC */ #endif /* EFI_RTC */
void date_set_tm(struct tm *timp) { void date_set_tm(struct tm *timp) {
(void)timp;
#if EFI_RTC #if EFI_RTC
rtcSetTimeTm(&RTCD1, timp); rtcSetTimeTm(&RTCD1, timp);
#endif /* EFI_RTC */ #endif /* EFI_RTC */
} }
void date_get_tm(struct tm *timp) { void date_get_tm(struct tm *timp) {
(void)timp;
#if EFI_RTC #if EFI_RTC
rtcGetTimeTm(&RTCD1, timp); rtcGetTimeTm(&RTCD1, timp);
#endif /* EFI_RTC */ #endif /* EFI_RTC */