auto-sync
This commit is contained in:
parent
eade0c0367
commit
13e255cb50
|
@ -27,7 +27,9 @@
|
||||||
|
|
||||||
EXTERN_ENGINE;
|
EXTERN_ENGINE;
|
||||||
|
|
||||||
|
#if !EFI_UNIT_TEST || defined(__DOXYGEN__)
|
||||||
extern TunerStudioOutputChannels tsOutputChannels;
|
extern TunerStudioOutputChannels tsOutputChannels;
|
||||||
|
#endif
|
||||||
|
|
||||||
static ign_Map3D_t advanceMap("advance");
|
static ign_Map3D_t advanceMap("advance");
|
||||||
static ign_Map3D_t iatAdvanceCorrectionMap("iat corr");
|
static ign_Map3D_t iatAdvanceCorrectionMap("iat corr");
|
||||||
|
@ -83,8 +85,10 @@ static angle_t getRunningAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAME
|
||||||
iatCorrection = iatAdvanceCorrectionMap.getValue((float) rpm, engine->engineState.iat);
|
iatCorrection = iatAdvanceCorrectionMap.getValue((float) rpm, engine->engineState.iat);
|
||||||
}
|
}
|
||||||
if (engineConfiguration->debugMode == DBG_TIMING) {
|
if (engineConfiguration->debugMode == DBG_TIMING) {
|
||||||
|
#if !EFI_UNIT_TEST || defined(__DOXYGEN__)
|
||||||
tsOutputChannels.debugFloatField1 = iatCorrection;
|
tsOutputChannels.debugFloatField1 = iatCorrection;
|
||||||
tsOutputChannels.debugFloatField2 = engine->engineState.cltTimingCorrection;
|
tsOutputChannels.debugFloatField2 = engine->engineState.cltTimingCorrection;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
float result = advanceMap.getValue((float) rpm, engineLoad)
|
float result = advanceMap.getValue((float) rpm, engineLoad)
|
||||||
|
|
|
@ -55,10 +55,10 @@ static LEElementPool evalPool(evalPoolElements, LE_EVAL_POOL_SIZE);
|
||||||
#define SYS_ELEMENT_POOL_SIZE 128
|
#define SYS_ELEMENT_POOL_SIZE 128
|
||||||
#define UD_ELEMENT_POOL_SIZE 128
|
#define UD_ELEMENT_POOL_SIZE 128
|
||||||
|
|
||||||
static LEElement sysElements[SYS_ELEMENT_POOL_SIZE];
|
static LEElement sysElements[SYS_ELEMENT_POOL_SIZE] CCM_OPTIONAL;
|
||||||
LEElementPool sysPool(sysElements, SYS_ELEMENT_POOL_SIZE);
|
LEElementPool sysPool(sysElements, SYS_ELEMENT_POOL_SIZE);
|
||||||
|
|
||||||
static LEElement userElements[UD_ELEMENT_POOL_SIZE];
|
static LEElement userElements[UD_ELEMENT_POOL_SIZE] CCM_OPTIONAL;
|
||||||
LEElementPool userPool(userElements, UD_ELEMENT_POOL_SIZE);
|
LEElementPool userPool(userElements, UD_ELEMENT_POOL_SIZE);
|
||||||
static LEElement * fsioLogics[LE_COMMAND_COUNT] CCM_OPTIONAL;
|
static LEElement * fsioLogics[LE_COMMAND_COUNT] CCM_OPTIONAL;
|
||||||
|
|
||||||
|
|
|
@ -30,14 +30,15 @@ public:
|
||||||
void unregister();
|
void unregister();
|
||||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||||
ioportid_t port;
|
ioportid_t port;
|
||||||
int pin;
|
uint8_t pin;
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
|
int8_t currentLogicValue;
|
||||||
|
// 4 byte pointer is a bit of a memory waste here
|
||||||
pin_output_mode_e *modePtr;
|
pin_output_mode_e *modePtr;
|
||||||
/**
|
/**
|
||||||
* we track current pin status so that we do not touch the actual hardware if we want to write new pin bit
|
* we track current pin status so that we do not touch the actual hardware if we want to write new pin bit
|
||||||
* which is same as current pin value. This maybe helps in case of status leds, but maybe it's a total over-engineering
|
* which is same as current pin value. This maybe helps in case of status leds, but maybe it's a total over-engineering
|
||||||
*/
|
*/
|
||||||
int currentLogicValue;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class NamedOutputPin : public OutputPin {
|
class NamedOutputPin : public OutputPin {
|
||||||
|
@ -48,6 +49,7 @@ public:
|
||||||
* @return true if pin was stopped
|
* @return true if pin was stopped
|
||||||
*/
|
*/
|
||||||
bool stop();
|
bool stop();
|
||||||
|
// todo: char pointer is a bit of a memory waste here, we can reduce RAM usage by software-based getName() method
|
||||||
const char *name;
|
const char *name;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -56,9 +58,10 @@ public:
|
||||||
InjectorOutputPin();
|
InjectorOutputPin();
|
||||||
void reset();
|
void reset();
|
||||||
efitimeus_t overlappingScheduleOffTime;
|
efitimeus_t overlappingScheduleOffTime;
|
||||||
int injectorIndex;
|
// todo: implement this via address manipulation to reduce memory usage
|
||||||
|
int8_t injectorIndex;
|
||||||
bool cancelNextTurningInjectorOff;
|
bool cancelNextTurningInjectorOff;
|
||||||
int overlappingCounter;
|
int8_t overlappingCounter;
|
||||||
};
|
};
|
||||||
|
|
||||||
class IgnitionOutputPin : public NamedOutputPin {
|
class IgnitionOutputPin : public NamedOutputPin {
|
||||||
|
|
|
@ -408,12 +408,14 @@ static ALWAYS_INLINE void handleFuel(const bool limitedFuel, uint32_t trgEventIn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static histogram_s mainLoopHisto;
|
#if EFI_HISTOGRAMS || defined(__DOXYGEN__)
|
||||||
|
static histogram_s mainLoopHistogram;
|
||||||
|
#endif /* EFI_HISTOGRAMS */
|
||||||
|
|
||||||
void showMainHistogram(void) {
|
void showMainHistogram(void) {
|
||||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
#if EFI_HISTOGRAMS || defined(__DOXYGEN__)
|
||||||
printHistogram(logger, &mainLoopHisto);
|
printHistogram(logger, &mainLoopHistogram);
|
||||||
#endif
|
#endif /* EFI_HISTOGRAMS */
|
||||||
}
|
}
|
||||||
|
|
||||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||||
|
@ -512,10 +514,10 @@ void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t trgEventIndex D
|
||||||
* For spark we schedule both start of coil charge and actual spark based on trigger angle
|
* For spark we schedule both start of coil charge and actual spark based on trigger angle
|
||||||
*/
|
*/
|
||||||
handleSpark(limitedSpark, trgEventIndex, rpm PASS_ENGINE_PARAMETER);
|
handleSpark(limitedSpark, trgEventIndex, rpm PASS_ENGINE_PARAMETER);
|
||||||
#if (EFI_HISTOGRAMS && EFI_PROD_CODE) || defined(__DOXYGEN__)
|
#if EFI_HISTOGRAMS || defined(__DOXYGEN__)
|
||||||
int diff = hal_lld_get_counter_value() - beforeCallback;
|
int diff = hal_lld_get_counter_value() - beforeCallback;
|
||||||
if (diff > 0)
|
if (diff > 0)
|
||||||
hsAdd(&mainLoopHisto, diff);
|
hsAdd(&mainLoopHistogram, diff);
|
||||||
#endif /* EFI_HISTOGRAMS */
|
#endif /* EFI_HISTOGRAMS */
|
||||||
|
|
||||||
if (trgEventIndex == 0) {
|
if (trgEventIndex == 0) {
|
||||||
|
@ -559,7 +561,7 @@ void initMainEventListener(Logging *sharedLogger, Engine *engine) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if EFI_HISTOGRAMS || defined(__DOXYGEN__)
|
#if EFI_HISTOGRAMS || defined(__DOXYGEN__)
|
||||||
initHistogram(&mainLoopHisto, "main callback");
|
initHistogram(&mainLoopHistogram, "main callback");
|
||||||
#endif /* EFI_HISTOGRAMS */
|
#endif /* EFI_HISTOGRAMS */
|
||||||
|
|
||||||
addTriggerEventListener(mainTriggerCallback, "main loop", engine);
|
addTriggerEventListener(mainTriggerCallback, "main loop", engine);
|
||||||
|
|
|
@ -36,7 +36,9 @@ WaveChart waveChart;
|
||||||
|
|
||||||
EXTERN_ENGINE;
|
EXTERN_ENGINE;
|
||||||
|
|
||||||
static histogram_s triggerCallback;
|
#if EFI_HISTOGRAMS || defined(__DOXYGEN__)
|
||||||
|
static histogram_s triggerCallbackHistogram;
|
||||||
|
#endif /* EFI_HISTOGRAMS */
|
||||||
|
|
||||||
static Logging *logger;
|
static Logging *logger;
|
||||||
|
|
||||||
|
@ -286,19 +288,19 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal DECLARE_ENGINE_PAR
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#if EFI_HISTOGRAMS && EFI_PROD_CODE
|
#if EFI_HISTOGRAMS || defined(__DOXYGEN__)
|
||||||
int afterCallback = hal_lld_get_counter_value();
|
int afterCallback = hal_lld_get_counter_value();
|
||||||
int diff = afterCallback - beforeCallback;
|
int diff = afterCallback - beforeCallback;
|
||||||
// this counter is only 32 bits so it overflows every minute, let's ignore the value in case of the overflow for simplicity
|
// this counter is only 32 bits so it overflows every minute, let's ignore the value in case of the overflow for simplicity
|
||||||
if (diff > 0) {
|
if (diff > 0) {
|
||||||
hsAdd(&triggerCallback, diff);
|
hsAdd(&triggerCallbackHistogram, diff);
|
||||||
}
|
}
|
||||||
#endif /* EFI_HISTOGRAMS */
|
#endif /* EFI_HISTOGRAMS */
|
||||||
}
|
}
|
||||||
|
|
||||||
void printAllCallbacksHistogram(void) {
|
void printAllCallbacksHistogram(void) {
|
||||||
#if EFI_PROD_CODE
|
#if EFI_HISTOGRAMS || defined(__DOXYGEN__)
|
||||||
printHistogram(logger, &triggerCallback);
|
printHistogram(logger, &triggerCallbackHistogram);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,7 +503,7 @@ float getTriggerDutyCycle(int index) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void resetRunningTriggerCounters() {
|
static void resetRunningTriggerCounters() {
|
||||||
#if !EFI_UNIT_TEST
|
#if !EFI_UNIT_TEST || defined(__DOXYGEN__)
|
||||||
engine->triggerCentral.resetCounters();
|
engine->triggerCentral.resetCounters();
|
||||||
triggerInfo();
|
triggerInfo();
|
||||||
#endif
|
#endif
|
||||||
|
@ -511,18 +513,18 @@ void initTriggerCentral(Logging *sharedLogger, Engine *engine) {
|
||||||
logger = sharedLogger;
|
logger = sharedLogger;
|
||||||
strcpy((char*) shaft_signal_msg_index, "x_");
|
strcpy((char*) shaft_signal_msg_index, "x_");
|
||||||
|
|
||||||
#if EFI_ENGINE_SNIFFER
|
#if EFI_ENGINE_SNIFFER || defined(__DOXYGEN__)
|
||||||
initWaveChart(&waveChart);
|
initWaveChart(&waveChart);
|
||||||
#endif /* EFI_ENGINE_SNIFFER */
|
#endif /* EFI_ENGINE_SNIFFER */
|
||||||
|
|
||||||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
#if EFI_PROD_CODE || EFI_SIMULATOR || defined(__DOXYGEN__)
|
||||||
addConsoleAction("triggerinfo", triggerInfo);
|
addConsoleAction("triggerinfo", triggerInfo);
|
||||||
addConsoleAction("trigger_shape_info", triggerShapeInfo);
|
addConsoleAction("trigger_shape_info", triggerShapeInfo);
|
||||||
addConsoleAction("reset_trigger", resetRunningTriggerCounters);
|
addConsoleAction("reset_trigger", resetRunningTriggerCounters);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if EFI_HISTOGRAMS
|
#if EFI_HISTOGRAMS || defined(__DOXYGEN__)
|
||||||
initHistogram(&triggerCallback, "all callbacks");
|
initHistogram(&triggerCallbackHistogram, "all callbacks");
|
||||||
#endif /* EFI_HISTOGRAMS */
|
#endif /* EFI_HISTOGRAMS */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,9 +84,9 @@ static single_wave_s waves[PWM_PHASE_MAX_WAVE_PER_PWM] = { single_wave_s(pinStat
|
||||||
single_wave_s(pinStates3) };
|
single_wave_s(pinStates3) };
|
||||||
static single_wave_s sr[PWM_PHASE_MAX_WAVE_PER_PWM] = { waves[0], waves[1], waves[2] };
|
static single_wave_s sr[PWM_PHASE_MAX_WAVE_PER_PWM] = { waves[0], waves[1], waves[2] };
|
||||||
|
|
||||||
static float swtchTms[PWM_PHASE_MAX_COUNT];
|
static float switchTimesBuffer[PWM_PHASE_MAX_COUNT];
|
||||||
|
|
||||||
PwmConfig triggerSignal(swtchTms, sr);
|
PwmConfig triggerSignal(switchTimesBuffer, sr);
|
||||||
|
|
||||||
#define DO_NOT_STOP 999999999
|
#define DO_NOT_STOP 999999999
|
||||||
|
|
||||||
|
|
|
@ -240,14 +240,14 @@ void chDbgStackOverflowPanic(Thread *otp) {
|
||||||
chDbgPanic3(panicMessage, __FILE__, __LINE__);
|
chDbgPanic3(panicMessage, __FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char UNUSED_RAM_SIZE[11100];
|
static char UNUSED_RAM_SIZE[25100];
|
||||||
|
|
||||||
static char UNUSED_CCM_SIZE[16500] CCM_OPTIONAL;
|
static char UNUSED_CCM_SIZE[9500] CCM_OPTIONAL;
|
||||||
|
|
||||||
int getRusEfiVersion(void) {
|
int getRusEfiVersion(void) {
|
||||||
if (UNUSED_RAM_SIZE[0] != 0)
|
if (UNUSED_RAM_SIZE[0] != 0)
|
||||||
return 123; // this is here to make the compiler happy about the unused array
|
return 123; // this is here to make the compiler happy about the unused array
|
||||||
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
||||||
return 3211; // this is here to make the compiler happy about the unused array
|
return 3211; // this is here to make the compiler happy about the unused array
|
||||||
return 20170102;
|
return 20170105;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
static Logging * logging;
|
static Logging * logging;
|
||||||
|
|
||||||
static int consoleActionCount = 0;
|
static int consoleActionCount = 0;
|
||||||
static TokenCallback consoleActions[CONSOLE_MAX_ACTIONS];
|
static TokenCallback consoleActions[CONSOLE_MAX_ACTIONS] CCM_OPTIONAL;
|
||||||
|
|
||||||
#define SECURE_LINE_PREFIX "sec!"
|
#define SECURE_LINE_PREFIX "sec!"
|
||||||
#define SECURE_LINE_PREFIX_LENGTH 4
|
#define SECURE_LINE_PREFIX_LENGTH 4
|
||||||
|
@ -152,7 +152,7 @@ static int getParameterCount(action_type_e parameterType) {
|
||||||
* @brief This function prints out a list of all available commands
|
* @brief This function prints out a list of all available commands
|
||||||
*/
|
*/
|
||||||
void helpCommand(void) {
|
void helpCommand(void) {
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||||
if (isBoardTestMode()) {
|
if (isBoardTestMode()) {
|
||||||
printBoardTestState();
|
printBoardTestState();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "histogram.h"
|
#include "histogram.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
#if EFI_HISTOGRAMS
|
#if EFI_HISTOGRAMS || EFI_UNIT_TEST
|
||||||
|
|
||||||
#define H_ACCURACY 0.05
|
#define H_ACCURACY 0.05
|
||||||
#define H_CONFIDENCE 0.8
|
#define H_CONFIDENCE 0.8
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
#define EFI_FSIO TRUE
|
#define EFI_FSIO TRUE
|
||||||
|
|
||||||
#define EFI_HISTOGRAMS TRUE
|
#define EFI_HISTOGRAMS FALSE
|
||||||
|
|
||||||
#define CONSOLE_MAX_ACTIONS 128
|
#define CONSOLE_MAX_ACTIONS 128
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
#define EFI_ANALOG_SENSORS TRUE
|
#define EFI_ANALOG_SENSORS TRUE
|
||||||
|
|
||||||
#define EFI_SENSOR_CHART TRUE
|
#define EFI_SENSOR_CHART TRUE
|
||||||
#define EFI_HISTOGRAMS TRUE
|
#define EFI_HISTOGRAMS FALSE
|
||||||
|
|
||||||
#define EFI_TUNER_STUDIO TRUE
|
#define EFI_TUNER_STUDIO TRUE
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue