auto-sync

This commit is contained in:
rusEfi 2015-02-27 20:04:25 -06:00
parent cf287775d4
commit 0a90863bde
5 changed files with 10 additions and 8 deletions

View File

@ -201,9 +201,9 @@ void printSensors(Logging *log, bool fileFormat) {
void writeLogLine(void) {
#if EFI_FILE_LOGGING || defined(__DOXYGEN__)
if (!main_loop_started)
return;
#if EFI_FILE_LOGGING || defined(__DOXYGEN__)
resetLogging(&fileLogger);
printSensors(&fileLogger, true);

View File

@ -17,6 +17,7 @@
template<int RPM_BIN_SIZE, int LOAD_BIN_SIZE>
class Map3D {
public:
Map3D();
void init(float table[RPM_BIN_SIZE][LOAD_BIN_SIZE], float loadBins[LOAD_BIN_SIZE], float rpmBins[RPM_BIN_SIZE]);
float getValue(float x, float rpm);
void setAll(float value);
@ -81,6 +82,12 @@ float Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE>::getValue(float x, float rpm) {
return interpolate3d(x, loadBins, LOAD_BIN_SIZE, rpm, rpmBins, RPM_BIN_SIZE, pointers);
}
template<int RPM_BIN_SIZE, int LOAD_BIN_SIZE>
Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE>::Map3D() {
initialized = 0;
memset(&pointers, 0, sizeof(pointers));
}
template<int RPM_BIN_SIZE, int LOAD_BIN_SIZE>
void Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE>::setAll(float value) {
efiAssertVoid(initialized == MAGIC_TRUE_VALUE, "map not initialized");

View File

@ -66,7 +66,7 @@ extern bool hasFirmwareErrorFlag;
persistent_config_container_s persistentState CCM_OPTIONAL;
persistent_config_s *config;
persistent_config_s *config = &persistentState.persistentConfiguration;
/**
* todo: it really looks like these fields should become 'static', i.e. private

View File

@ -107,6 +107,7 @@ void setDetaultVETable(engine_configuration_s *engineConfiguration) {
}
void initSpeedDensity(persistent_config_s *config) {
efiAssertVoid(config!=NULL, "config is NULL");
engine_configuration_s *e = &config->engineConfiguration;
veMap.init(e->veTable, e->veLoadBins, e->veRpmBins);
ve2Map.init(e->ve2Table, e->ve2LoadBins, e->ve2RpmBins);

View File

@ -29,11 +29,6 @@
#include "trigger_emulator.h"
#include "engine_controller.h"
// todo: reuse the instance from engine_controller?
//static Engine _engine;
//Engine *engine = &_engine;
EXTERN_ENGINE;
extern engine_configuration2_s * engineConfiguration2;
@ -79,7 +74,6 @@ void rusEfiFunctionalTest(void) {
initStatusLoop(engine);
initDataStructures(PASS_ENGINE_PARAMETER_F);
engine->engineConfiguration = engineConfiguration;
engine->engineConfiguration2 = engineConfiguration2;
// todo: reduce code duplication with initEngineContoller