auto-sync
This commit is contained in:
parent
7296929ca6
commit
23660e7456
|
@ -115,7 +115,7 @@
|
||||||
|
|
||||||
#define EFI_WAVE_CHART TRUE
|
#define EFI_WAVE_CHART TRUE
|
||||||
|
|
||||||
#define EFI_HISTOGRAMS TRUE
|
#define EFI_HISTOGRAMS FAPSE
|
||||||
#define EFI_ANALOG_CHART TRUE
|
#define EFI_ANALOG_CHART TRUE
|
||||||
|
|
||||||
#if defined __GNUC__
|
#if defined __GNUC__
|
||||||
|
|
|
@ -16,22 +16,10 @@
|
||||||
#include "event_registry.h"
|
#include "event_registry.h"
|
||||||
#include "trigger_structure.h"
|
#include "trigger_structure.h"
|
||||||
|
|
||||||
/**
|
class FuelSchedule {
|
||||||
* @brief Here we store information about which injector or spark should be fired when.
|
public:
|
||||||
*/
|
ActuatorEventList events;
|
||||||
typedef struct {
|
};
|
||||||
ActuatorEventList crankingInjectionEvents;
|
|
||||||
ActuatorEventList injectionEvents;
|
|
||||||
/**
|
|
||||||
* We are alternating two event lists in order to avoid a potential issue around revolution boundary
|
|
||||||
* when an event is scheduled within the next revolution.
|
|
||||||
*/
|
|
||||||
IgnitionEventList ignitionEvents[2];
|
|
||||||
} EventHandlerConfiguration;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* this part of the structure is separate just because so far
|
* this part of the structure is separate just because so far
|
||||||
|
@ -47,7 +35,14 @@ public:
|
||||||
|
|
||||||
trigger_shape_s triggerShape;
|
trigger_shape_s triggerShape;
|
||||||
|
|
||||||
EventHandlerConfiguration engineEventConfiguration;
|
FuelSchedule crankingInjectionEvents;
|
||||||
|
FuelSchedule injectionEvents;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We are alternating two event lists in order to avoid a potential issue around revolution boundary
|
||||||
|
* when an event is scheduled within the next revolution.
|
||||||
|
*/
|
||||||
|
IgnitionEventList ignitionEvents[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
void initializeIgnitionActions(float advance, float dwellAngle, engine_configuration_s *engineConfiguration,
|
void initializeIgnitionActions(float advance, float dwellAngle, engine_configuration_s *engineConfiguration,
|
||||||
|
@ -55,14 +50,10 @@ void initializeIgnitionActions(float advance, float dwellAngle, engine_configura
|
||||||
void addFuelEvents(engine_configuration_s const *e, engine_configuration2_s *engineConfiguration2,
|
void addFuelEvents(engine_configuration_s const *e, engine_configuration2_s *engineConfiguration2,
|
||||||
ActuatorEventList *list, injection_mode_e mode);
|
ActuatorEventList *list, injection_mode_e mode);
|
||||||
|
|
||||||
void registerActuatorEventExt(engine_configuration_s const *engineConfiguration, trigger_shape_s * s, ActuatorEvent *e,
|
|
||||||
OutputSignal *actuator, float angleOffset);
|
|
||||||
|
|
||||||
void setDefaultNonPersistentConfiguration(engine_configuration2_s *engineConfiguration2);
|
void setDefaultNonPersistentConfiguration(engine_configuration2_s *engineConfiguration2);
|
||||||
void printConfiguration(engine_configuration_s *engineConfiguration, engine_configuration2_s *engineConfiguration2);
|
void printConfiguration(engine_configuration_s *engineConfiguration, engine_configuration2_s *engineConfiguration2);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
void registerActuatorEventExt(engine_configuration_s const *engineConfiguration, trigger_shape_s * s, ActuatorEvent *e,
|
||||||
}
|
OutputSignal *actuator, float angleOffset);
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* EC2_H_ */
|
#endif /* EC2_H_ */
|
||||||
|
|
|
@ -579,7 +579,7 @@ void applyNonPersistentConfiguration(Logging * logger, Engine *engine) {
|
||||||
prepareOutputSignals(engine);
|
prepareOutputSignals(engine);
|
||||||
// todo: looks like this is here only for unit tests. todo: remove
|
// todo: looks like this is here only for unit tests. todo: remove
|
||||||
initializeIgnitionActions(0, 0, engineConfiguration, engineConfiguration2,
|
initializeIgnitionActions(0, 0, engineConfiguration, engineConfiguration2,
|
||||||
&engineConfiguration2->engineEventConfiguration.ignitionEvents[0]);
|
&engineConfiguration2->ignitionEvents[0]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
#define CHART_DELIMETER "!"
|
#define CHART_DELIMETER "!"
|
||||||
|
|
||||||
#if EFI_HISTOGRAMS
|
#if EFI_HISTOGRAMS || defined(__DOXYGEN__)
|
||||||
#include "rfiutil.h"
|
#include "rfiutil.h"
|
||||||
#include "histogram.h"
|
#include "histogram.h"
|
||||||
static histogram_s waveChartHisto;
|
static histogram_s waveChartHisto;
|
||||||
|
@ -208,7 +208,7 @@ void WaveChart::addWaveChartEvent3(const char *name, const char * msg, const cha
|
||||||
}
|
}
|
||||||
|
|
||||||
void showWaveChartHistogram(void) {
|
void showWaveChartHistogram(void) {
|
||||||
#if EFI_PROD_CODE
|
#if (EFI_HISTOGRAMS && EFI_PROD_CODE) || defined(__DOXYGEN__)
|
||||||
printHistogram(&logger, &waveChartHisto);
|
printHistogram(&logger, &waveChartHisto);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,9 @@ extern int main_loop_started;
|
||||||
const char *dbg_panic_file;
|
const char *dbg_panic_file;
|
||||||
int dbg_panic_line;
|
int dbg_panic_line;
|
||||||
|
|
||||||
|
static void turnAllPinsOff(void) {
|
||||||
|
}
|
||||||
|
|
||||||
void chDbgPanic3(const char *msg, const char * file, int line) {
|
void chDbgPanic3(const char *msg, const char * file, int line) {
|
||||||
if (hasFatalError())
|
if (hasFatalError())
|
||||||
return;
|
return;
|
||||||
|
@ -41,6 +44,8 @@ void chDbgPanic3(const char *msg, const char * file, int line) {
|
||||||
#if EFI_HD44780_LCD
|
#if EFI_HD44780_LCD
|
||||||
lcdShowFatalMessage((char *) msg);
|
lcdShowFatalMessage((char *) msg);
|
||||||
#endif /* EFI_HD44780_LCD */
|
#endif /* EFI_HD44780_LCD */
|
||||||
|
turnAllPinsOff();
|
||||||
|
|
||||||
if (!main_loop_started) {
|
if (!main_loop_started) {
|
||||||
print("fatal %s %s:%d\r\n", msg, file, line);
|
print("fatal %s %s:%d\r\n", msg, file, line);
|
||||||
chThdSleepSeconds(1);
|
chThdSleepSeconds(1);
|
||||||
|
|
|
@ -352,10 +352,9 @@ engine_configuration2_s *engineConfiguration2 = engine->engineConfiguration2;
|
||||||
engineConfiguration2->triggerShape.calculateTriggerSynchPoint(engineConfiguration, &engineConfiguration->triggerConfig);
|
engineConfiguration2->triggerShape.calculateTriggerSynchPoint(engineConfiguration, &engineConfiguration->triggerConfig);
|
||||||
|
|
||||||
injectonSignals.clear();
|
injectonSignals.clear();
|
||||||
EventHandlerConfiguration *config = &engineConfiguration2->engineEventConfiguration;
|
addFuelEvents(engineConfiguration, engineConfiguration2, &engineConfiguration2->crankingInjectionEvents.events,
|
||||||
addFuelEvents(engineConfiguration, engineConfiguration2, &config->crankingInjectionEvents,
|
|
||||||
engineConfiguration->crankingInjectionMode);
|
engineConfiguration->crankingInjectionMode);
|
||||||
addFuelEvents(engineConfiguration, engineConfiguration2, &config->injectionEvents,
|
addFuelEvents(engineConfiguration, engineConfiguration2, &engineConfiguration2->injectionEvents.events,
|
||||||
engineConfiguration->injectionMode);
|
engineConfiguration->injectionMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,8 +114,8 @@ static void handleFuel(Engine *engine, MainTriggerCallback *mainTriggerCallback,
|
||||||
*/
|
*/
|
||||||
ActuatorEventList *source =
|
ActuatorEventList *source =
|
||||||
isCrankingR(rpm) ?
|
isCrankingR(rpm) ?
|
||||||
&mainTriggerCallback->engineConfiguration2->engineEventConfiguration.crankingInjectionEvents :
|
&mainTriggerCallback->engineConfiguration2->crankingInjectionEvents.events :
|
||||||
&mainTriggerCallback->engineConfiguration2->engineEventConfiguration.injectionEvents;
|
&mainTriggerCallback->engineConfiguration2->injectionEvents.events;
|
||||||
|
|
||||||
for (int i = 0; i < source->size; i++) {
|
for (int i = 0; i < source->size; i++) {
|
||||||
ActuatorEvent *event = &source->events[i];
|
ActuatorEvent *event = &source->events[i];
|
||||||
|
@ -299,14 +299,14 @@ void onTriggerEvent(trigger_event_e ckpSignalType, uint32_t eventIndex, MainTrig
|
||||||
|
|
||||||
initializeIgnitionActions(advance, dwellAngle, mainTriggerCallback->engineConfiguration,
|
initializeIgnitionActions(advance, dwellAngle, mainTriggerCallback->engineConfiguration,
|
||||||
mainTriggerCallback->engineConfiguration2,
|
mainTriggerCallback->engineConfiguration2,
|
||||||
&mainTriggerCallback->engineConfiguration2->engineEventConfiguration.ignitionEvents[revolutionIndex]);
|
&mainTriggerCallback->engineConfiguration2->ignitionEvents[revolutionIndex]);
|
||||||
}
|
}
|
||||||
|
|
||||||
triggerEventsQueue.executeAll(getCrankEventCounter());
|
triggerEventsQueue.executeAll(getCrankEventCounter());
|
||||||
|
|
||||||
handleFuel(&engine, mainTriggerCallback, eventIndex, rpm);
|
handleFuel(&engine, mainTriggerCallback, eventIndex, rpm);
|
||||||
handleSpark(mainTriggerCallback, eventIndex, rpm,
|
handleSpark(mainTriggerCallback, eventIndex, rpm,
|
||||||
&mainTriggerCallback->engineConfiguration2->engineEventConfiguration.ignitionEvents[revolutionIndex]);
|
&mainTriggerCallback->engineConfiguration2->ignitionEvents[revolutionIndex]);
|
||||||
#if EFI_HISTOGRAMS && EFI_PROD_CODE
|
#if EFI_HISTOGRAMS && EFI_PROD_CODE
|
||||||
int diff = hal_lld_get_counter_value() - beforeCallback;
|
int diff = hal_lld_get_counter_value() - beforeCallback;
|
||||||
if (diff > 0)
|
if (diff > 0)
|
||||||
|
|
|
@ -249,5 +249,5 @@ void firmwareError(const char *fmt, ...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int getRusEfiVersion(void) {
|
int getRusEfiVersion(void) {
|
||||||
return 20141106;
|
return 20141107;
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,7 +138,7 @@ static void test1995FordInline6TriggerDecoder(void) {
|
||||||
assertTriggerPosition(&position, 6, 0);
|
assertTriggerPosition(&position, 6, 0);
|
||||||
|
|
||||||
|
|
||||||
IgnitionEventList *ecl = ð.ec2.engineEventConfiguration.ignitionEvents[0];
|
IgnitionEventList *ecl = ð.ec2.ignitionEvents[0];
|
||||||
assertEqualsM("ignition events size", 6, ecl->size);
|
assertEqualsM("ignition events size", 6, ecl->size);
|
||||||
assertEqualsM("event index", 0, ecl->events[0].dwellPosition.eventIndex);
|
assertEqualsM("event index", 0, ecl->events[0].dwellPosition.eventIndex);
|
||||||
assertEquals(0, ecl->events[0].dwellPosition.angleOffset);
|
assertEquals(0, ecl->events[0].dwellPosition.angleOffset);
|
||||||
|
|
Loading…
Reference in New Issue