auto-sync
This commit is contained in:
parent
1793284cf1
commit
740a7f0616
|
@ -116,7 +116,7 @@ static const char* boolean2string(int value) {
|
||||||
return value ? "YES" : "NO";
|
return value ? "YES" : "NO";
|
||||||
}
|
}
|
||||||
|
|
||||||
void printSensors(void) {
|
void printSensors(Engine *engine) {
|
||||||
#if EFI_FILE_LOGGING
|
#if EFI_FILE_LOGGING
|
||||||
resetLogging(&fileLogger);
|
resetLogging(&fileLogger);
|
||||||
#endif /* EFI_FILE_LOGGING */
|
#endif /* EFI_FILE_LOGGING */
|
||||||
|
@ -126,7 +126,7 @@ void printSensors(void) {
|
||||||
float sec = ((float) nowMs) / 1000;
|
float sec = ((float) nowMs) / 1000;
|
||||||
reportSensorF("time", sec, 3);
|
reportSensorF("time", sec, 3);
|
||||||
|
|
||||||
reportSensorI("rpm", getRpm());
|
reportSensorI("rpm", getRpmE(engine));
|
||||||
reportSensorF("maf", getMaf(), 2);
|
reportSensorF("maf", getMaf(), 2);
|
||||||
|
|
||||||
if (engineConfiguration->hasMapSensor) {
|
if (engineConfiguration->hasMapSensor) {
|
||||||
|
@ -158,24 +158,24 @@ void printSensors(void) {
|
||||||
#endif /* EFI_FILE_LOGGING */
|
#endif /* EFI_FILE_LOGGING */
|
||||||
}
|
}
|
||||||
|
|
||||||
void printState(int currentCkpEventCounter) {
|
void printState(Engine *engine, int currentCkpEventCounter) {
|
||||||
#if EFI_SHAFT_POSITION_INPUT
|
#if EFI_SHAFT_POSITION_INPUT
|
||||||
printSensors();
|
printSensors(engine);
|
||||||
|
|
||||||
int rpm = getRpm();
|
int rpm = getRpmE(engine);
|
||||||
debugInt(&logger, "ckp_c", currentCkpEventCounter);
|
debugInt(&logger, "ckp_c", currentCkpEventCounter);
|
||||||
|
|
||||||
// debugInt(&logger, "idl", getIdleSwitch());
|
// debugInt(&logger, "idl", getIdleSwitch());
|
||||||
|
|
||||||
// debugFloat(&logger, "table_spark", getAdvance(rpm, getMaf()), 2);
|
// debugFloat(&logger, "table_spark", getAdvance(rpm, getMaf()), 2);
|
||||||
|
|
||||||
float engineLoad = getEngineLoad();
|
float engineLoad = getEngineLoadT(engine);
|
||||||
float baseFuel = getBaseFuel(&engine, rpm);
|
float baseFuel = getBaseFuel(engine, rpm);
|
||||||
debugFloat(&logger, "fuel_base", baseFuel, 2);
|
debugFloat(&logger, "fuel_base", baseFuel, 2);
|
||||||
// debugFloat(&logger, "fuel_iat", getIatCorrection(getIntakeAirTemperature()), 2);
|
// debugFloat(&logger, "fuel_iat", getIatCorrection(getIntakeAirTemperature()), 2);
|
||||||
// debugFloat(&logger, "fuel_clt", getCltCorrection(getCoolantTemperature()), 2);
|
// debugFloat(&logger, "fuel_clt", getCltCorrection(getCoolantTemperature()), 2);
|
||||||
debugFloat(&logger, "fuel_lag", getInjectorLag(engineConfiguration, getVBatt()), 2);
|
debugFloat(&logger, "fuel_lag", getInjectorLag(engineConfiguration, getVBatt()), 2);
|
||||||
debugFloat(&logger, "fuel", getRunningFuel(baseFuel, &engine, rpm), 2);
|
debugFloat(&logger, "fuel", getRunningFuel(baseFuel, engine, rpm), 2);
|
||||||
|
|
||||||
debugFloat(&logger, "timing", getAdvance(rpm, engineLoad), 2);
|
debugFloat(&logger, "timing", getAdvance(rpm, engineLoad), 2);
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ extern char errorMessageBuffer[200];
|
||||||
/**
|
/**
|
||||||
* @brief Sends all pending data to dev console
|
* @brief Sends all pending data to dev console
|
||||||
*/
|
*/
|
||||||
void updateDevConsoleState(void) {
|
void updateDevConsoleState(Engine *engine) {
|
||||||
if (!isConsoleReady()) {
|
if (!isConsoleReady()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -288,7 +288,7 @@ void updateDevConsoleState(void) {
|
||||||
|
|
||||||
prevCkpEventCounter = currentCkpEventCounter;
|
prevCkpEventCounter = currentCkpEventCounter;
|
||||||
|
|
||||||
printState(currentCkpEventCounter);
|
printState(engine, currentCkpEventCounter);
|
||||||
|
|
||||||
#if EFI_WAVE_ANALYZER
|
#if EFI_WAVE_ANALYZER
|
||||||
printWave(&logger);
|
printWave(&logger);
|
||||||
|
|
|
@ -8,17 +8,21 @@
|
||||||
#ifndef CONSOLE_LOOP_H_
|
#ifndef CONSOLE_LOOP_H_
|
||||||
#define CONSOLE_LOOP_H_
|
#define CONSOLE_LOOP_H_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#include "engine.h"
|
||||||
|
void updateDevConsoleState(Engine *engine);
|
||||||
|
void printSensors(Engine *engine);
|
||||||
|
void printState(Engine *engine, int currentCkpEventCounter);
|
||||||
|
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
void printState(int currentCkpEventCounter);
|
|
||||||
|
|
||||||
void initStatusLoop(void);
|
void initStatusLoop(void);
|
||||||
void updateDevConsoleState(void);
|
|
||||||
bool getFullLog(void);
|
bool getFullLog(void);
|
||||||
void printSensors(void);
|
|
||||||
void setFullLog(int value);
|
void setFullLog(int value);
|
||||||
void startStatusThreads(void);
|
void startStatusThreads(void);
|
||||||
void sayOsHello(void);
|
void sayOsHello(void);
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "logic_expression.h"
|
#include "logic_expression.h"
|
||||||
|
|
||||||
|
// todo: the delay should probably be configurable?
|
||||||
#define FUEL_PUMP_LOGIC "time_since_boot 4 < rpm 0 > OR"
|
#define FUEL_PUMP_LOGIC "time_since_boot 4 < rpm 0 > OR"
|
||||||
|
|
||||||
float getLEValue(Engine *engine, le_action_e action);
|
float getLEValue(Engine *engine, le_action_e action);
|
||||||
|
|
|
@ -61,8 +61,6 @@ LEElementPool lePool;
|
||||||
LEElement * fuelPumpLogic;
|
LEElement * fuelPumpLogic;
|
||||||
LEElement * radiatorFanLogic;
|
LEElement * radiatorFanLogic;
|
||||||
|
|
||||||
extern board_configuration_s *boardConfiguration;
|
|
||||||
|
|
||||||
persistent_config_container_s persistentState CCM_OPTIONAL
|
persistent_config_container_s persistentState CCM_OPTIONAL
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -77,11 +75,8 @@ 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
|
||||||
*/
|
*/
|
||||||
// todo: this should probably be configurable?
|
|
||||||
#define FUEL_PUMP_DELAY (4 * CH_FREQUENCY)
|
|
||||||
|
|
||||||
static VirtualTimer everyMsTimer;
|
static VirtualTimer everyMsTimer;
|
||||||
//static VirtualTimer fuelPumpTimer;
|
|
||||||
|
|
||||||
static Logging logger;
|
static Logging logger;
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ void runRusEfi(void) {
|
||||||
|
|
||||||
#if EFI_CLI_SUPPORT && !EFI_UART_ECHO_TEST_MODE
|
#if EFI_CLI_SUPPORT && !EFI_UART_ECHO_TEST_MODE
|
||||||
// sensor state + all pending messages for our own dev console
|
// sensor state + all pending messages for our own dev console
|
||||||
updateDevConsoleState();
|
updateDevConsoleState(&engine);
|
||||||
#endif /* EFI_CLI_SUPPORT */
|
#endif /* EFI_CLI_SUPPORT */
|
||||||
|
|
||||||
chThdSleepMilliseconds(boardConfiguration->consoleLoopPeriod);
|
chThdSleepMilliseconds(boardConfiguration->consoleLoopPeriod);
|
||||||
|
|
Loading…
Reference in New Issue