auto-sync
This commit is contained in:
parent
abca76b54b
commit
630f04d06c
|
@ -78,7 +78,7 @@ board_configuration_s *boardConfiguration = &persistentState.persistentConfigura
|
||||||
* CH_FREQUENCY is the number of system ticks in a second
|
* CH_FREQUENCY is the number of system ticks in a second
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VirtualTimer everyMsTimer;
|
static VirtualTimer periodicTimer;
|
||||||
|
|
||||||
static LoggingWithStorage logger("Engine Controller");
|
static LoggingWithStorage logger("Engine Controller");
|
||||||
|
|
||||||
|
@ -200,18 +200,18 @@ static void cylinderCleanupControl(Engine *engine) {
|
||||||
|
|
||||||
static LocalVersionHolder versionForConfigurationListeners;
|
static LocalVersionHolder versionForConfigurationListeners;
|
||||||
|
|
||||||
static void onEvenyGeneralMilliseconds(Engine *engine);
|
static void periodicCallback(Engine *engine);
|
||||||
|
|
||||||
static void scheduleNextInvocation(void) {
|
static void scheduleNextInvocation(void) {
|
||||||
// schedule next invocation
|
// schedule next invocation
|
||||||
int period = boardConfiguration->generalPeriodicThreadPeriod;
|
int period = boardConfiguration->generalPeriodicThreadPeriod;
|
||||||
if (period == 0)
|
if (period == 0)
|
||||||
period = 50; // this might happen while resetting config
|
period = 50; // this might happen while resetting config
|
||||||
chVTSetAny(&everyMsTimer, period * TICKS_IN_MS, (vtfunc_t) &onEvenyGeneralMilliseconds, engine);
|
chVTSetAny(&periodicTimer, period * TICKS_IN_MS, (vtfunc_t) &periodicCallback, engine);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void onEvenyGeneralMilliseconds(Engine *engine) {
|
static void periodicCallback(Engine *engine) {
|
||||||
efiAssertVoid(getRemainingStack(chThdSelf()) > 64, "lowStckOnEv");
|
efiAssertVoid(getRemainingStack(chThdSelf()) > 64, "lowStckOnEv");
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
/**
|
/**
|
||||||
|
@ -392,6 +392,15 @@ static void resetAccel(void) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void initConfigActions(void) {
|
||||||
|
addConsoleActionSS("set_float", (VoidCharPtrCharPtr) setFloat);
|
||||||
|
addConsoleActionII("set_int", (VoidIntInt) setInt);
|
||||||
|
addConsoleActionII("set_short", (VoidIntInt) setShort);
|
||||||
|
addConsoleActionI("get_float", getFloat);
|
||||||
|
addConsoleActionI("get_int", getInt);
|
||||||
|
addConsoleActionI("get_short", getShort);
|
||||||
|
}
|
||||||
|
|
||||||
void initEngineContoller(Logging *sharedLogger, Engine *engine) {
|
void initEngineContoller(Logging *sharedLogger, Engine *engine) {
|
||||||
if (hasFirmwareError()) {
|
if (hasFirmwareError()) {
|
||||||
return;
|
return;
|
||||||
|
@ -408,6 +417,7 @@ void initEngineContoller(Logging *sharedLogger, Engine *engine) {
|
||||||
#endif /* EFI_ANALOG_CHART */
|
#endif /* EFI_ANALOG_CHART */
|
||||||
|
|
||||||
initAlgo(sharedLogger, engineConfiguration);
|
initAlgo(sharedLogger, engineConfiguration);
|
||||||
|
initConfigActions();
|
||||||
|
|
||||||
#if EFI_WAVE_ANALYZER || defined(__DOXYGEN__)
|
#if EFI_WAVE_ANALYZER || defined(__DOXYGEN__)
|
||||||
if (engineConfiguration->isWaveAnalyzerEnabled) {
|
if (engineConfiguration->isWaveAnalyzerEnabled) {
|
||||||
|
@ -483,12 +493,7 @@ void initEngineContoller(Logging *sharedLogger, Engine *engine) {
|
||||||
|
|
||||||
addConsoleAction("analoginfo", printAnalogInfo);
|
addConsoleAction("analoginfo", printAnalogInfo);
|
||||||
|
|
||||||
addConsoleActionSS("set_float", (VoidCharPtrCharPtr) setFloat);
|
initConfigActions();
|
||||||
addConsoleActionII("set_int", (VoidIntInt) setInt);
|
|
||||||
addConsoleActionII("set_short", (VoidIntInt) setShort);
|
|
||||||
addConsoleActionI("get_float", getFloat);
|
|
||||||
addConsoleActionI("get_int", getInt);
|
|
||||||
addConsoleActionI("get_short", getShort);
|
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
addConsoleAction("reset_accel", resetAccel);
|
addConsoleAction("reset_accel", resetAccel);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
|
|
||||||
char * getPinNameByAdcChannel(adc_channel_e hwChannel, char *buffer);
|
char * getPinNameByAdcChannel(adc_channel_e hwChannel, char *buffer);
|
||||||
|
void initConfigActions(void);
|
||||||
void initPeriodicEvents(Engine *engine);
|
void initPeriodicEvents(Engine *engine);
|
||||||
void initEngineContoller(Logging *sharedLogger, Engine *engine);
|
void initEngineContoller(Logging *sharedLogger, Engine *engine);
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,8 @@ void rusEfiFunctionalTest(void) {
|
||||||
initSensors(&sharedLogger PASS_ENGINE_PARAMETER);
|
initSensors(&sharedLogger PASS_ENGINE_PARAMETER);
|
||||||
|
|
||||||
initAlgo(&sharedLogger, engineConfiguration);
|
initAlgo(&sharedLogger, engineConfiguration);
|
||||||
|
initConfigActions();
|
||||||
|
|
||||||
initRpmCalculator(engine);
|
initRpmCalculator(engine);
|
||||||
|
|
||||||
#if EFI_ANALOG_CHART
|
#if EFI_ANALOG_CHART
|
||||||
|
|
Loading…
Reference in New Issue