auto-sync

This commit is contained in:
rusEfi 2014-10-13 11:03:10 -05:00
parent 1793284cf1
commit 740a7f0616
5 changed files with 20 additions and 20 deletions

View File

@ -116,7 +116,7 @@ static const char* boolean2string(int value) {
return value ? "YES" : "NO";
}
void printSensors(void) {
void printSensors(Engine *engine) {
#if EFI_FILE_LOGGING
resetLogging(&fileLogger);
#endif /* EFI_FILE_LOGGING */
@ -126,7 +126,7 @@ void printSensors(void) {
float sec = ((float) nowMs) / 1000;
reportSensorF("time", sec, 3);
reportSensorI("rpm", getRpm());
reportSensorI("rpm", getRpmE(engine));
reportSensorF("maf", getMaf(), 2);
if (engineConfiguration->hasMapSensor) {
@ -158,24 +158,24 @@ void printSensors(void) {
#endif /* EFI_FILE_LOGGING */
}
void printState(int currentCkpEventCounter) {
void printState(Engine *engine, int currentCkpEventCounter) {
#if EFI_SHAFT_POSITION_INPUT
printSensors();
printSensors(engine);
int rpm = getRpm();
int rpm = getRpmE(engine);
debugInt(&logger, "ckp_c", currentCkpEventCounter);
// debugInt(&logger, "idl", getIdleSwitch());
// debugFloat(&logger, "table_spark", getAdvance(rpm, getMaf()), 2);
float engineLoad = getEngineLoad();
float baseFuel = getBaseFuel(&engine, rpm);
float engineLoad = getEngineLoadT(engine);
float baseFuel = getBaseFuel(engine, rpm);
debugFloat(&logger, "fuel_base", baseFuel, 2);
// debugFloat(&logger, "fuel_iat", getIatCorrection(getIntakeAirTemperature()), 2);
// debugFloat(&logger, "fuel_clt", getCltCorrection(getCoolantTemperature()), 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);
@ -250,7 +250,7 @@ extern char errorMessageBuffer[200];
/**
* @brief Sends all pending data to dev console
*/
void updateDevConsoleState(void) {
void updateDevConsoleState(Engine *engine) {
if (!isConsoleReady()) {
return;
}
@ -288,7 +288,7 @@ void updateDevConsoleState(void) {
prevCkpEventCounter = currentCkpEventCounter;
printState(currentCkpEventCounter);
printState(engine, currentCkpEventCounter);
#if EFI_WAVE_ANALYZER
printWave(&logger);

View File

@ -8,17 +8,21 @@
#ifndef 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
extern "C"
{
#endif /* __cplusplus */
void printState(int currentCkpEventCounter);
void initStatusLoop(void);
void updateDevConsoleState(void);
bool getFullLog(void);
void printSensors(void);
void setFullLog(int value);
void startStatusThreads(void);
void sayOsHello(void);

View File

@ -11,6 +11,7 @@
#include "engine.h"
#include "logic_expression.h"
// todo: the delay should probably be configurable?
#define FUEL_PUMP_LOGIC "time_since_boot 4 < rpm 0 > OR"
float getLEValue(Engine *engine, le_action_e action);

View File

@ -61,8 +61,6 @@ LEElementPool lePool;
LEElement * fuelPumpLogic;
LEElement * radiatorFanLogic;
extern board_configuration_s *boardConfiguration;
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
*/
// todo: this should probably be configurable?
#define FUEL_PUMP_DELAY (4 * CH_FREQUENCY)
static VirtualTimer everyMsTimer;
//static VirtualTimer fuelPumpTimer;
static Logging logger;

View File

@ -187,7 +187,7 @@ void runRusEfi(void) {
#if EFI_CLI_SUPPORT && !EFI_UART_ECHO_TEST_MODE
// sensor state + all pending messages for our own dev console
updateDevConsoleState();
updateDevConsoleState(&engine);
#endif /* EFI_CLI_SUPPORT */
chThdSleepMilliseconds(boardConfiguration->consoleLoopPeriod);