auto-sync

This commit is contained in:
rusEfi 2016-04-15 23:01:40 -04:00
parent 3b4a1790e7
commit 8a9615b530
4 changed files with 12 additions and 7 deletions

View File

@ -70,6 +70,10 @@ template<int RPM_BIN_SIZE, int LOAD_BIN_SIZE>
void Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE>::init(float table[RPM_BIN_SIZE][LOAD_BIN_SIZE],
float loadBins[LOAD_BIN_SIZE],
float rpmBins[RPM_BIN_SIZE]) {
// this method cannot use logger because it's invoked before everything
// that's because this method needs to be invoked before initial configuration processing
// and initial configuration load is done prior to logging initialization
for (int k = 0; k < LOAD_BIN_SIZE; k++) {
pointers[k] = table[k];
}
@ -92,7 +96,7 @@ float Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE>::getValue(float xRpm, float y) {
template<int RPM_BIN_SIZE, int LOAD_BIN_SIZE>
Map3D<RPM_BIN_SIZE, LOAD_BIN_SIZE>::Map3D(const char *name) {
this->name = name;
initialized = 0;
initialized = false;
memset(&pointers, 0, sizeof(pointers));
loadBins = NULL;
rpmBins = NULL;

View File

@ -90,9 +90,6 @@ void writeToFlashNow(void) {
static bool isValidCrc(persistent_config_container_s *state) {
crc_t result = flashStateCrc(state);
int isValidCrc_b = result == state->value;
if (!isValidCrc_b) {
scheduleMsg(logger, "CRC got %d while %d expected", result, state->value);
}
return isValidCrc_b;
}

View File

@ -239,8 +239,6 @@ void initHardware(Logging *l) {
return;
}
initDataStructures(PASS_ENGINE_PARAMETER_F);
#if EFI_INTERNAL_FLASH
palSetPadMode(CONFIG_RESET_SWITCH_PORT, CONFIG_RESET_SWITCH_PIN, PAL_MODE_INPUT_PULLUP);

View File

@ -109,6 +109,7 @@
#include "status_loop.h"
#include "pin_repository.h"
#include "flash_main.h"
#include "algo.h"
#if EFI_HD44780_LCD
#include "lcd_HD44780.h"
@ -178,6 +179,11 @@ void runRusEfi(void) {
initTriggerDecoderLogger(&sharedLogger);
#endif
/**
* we need to initialize table objects before default configuration can set values
*/
initDataStructures(PASS_ENGINE_PARAMETER_F);
/**
* First thing is reading configuration from flash memory.
* In order to have complete flexibility configuration has to go before anything else.
@ -292,5 +298,5 @@ int getRusEfiVersion(void) {
return 123; // this is here to make the compiler happy about the unused array
if (UNUSED_CCM_SIZE[0] * 0 != 0)
return 3211; // this is here to make the compiler happy about the unused array
return 20160411;
return 20160415;
}