auto-sync

This commit is contained in:
rusEfi 2014-09-11 08:02:51 -05:00
parent 69d6fe324b
commit 9cd4327788
7 changed files with 45 additions and 10 deletions

View File

@ -18,8 +18,7 @@
/**
* please be aware that current "stable" version of TunerStudio does not
* support 'float' (F32) type. You would need a beta version to handle floats
* please be aware that 'float' (F32) type requires TunerStudio version 2.6 and later
*/
typedef struct {
// primary instrument cluster gauges

View File

@ -591,6 +591,32 @@ static void setSpiMode(int index, bool mode) {
scheduleMsg(&logger, "spi %d mode: %s", index, boolToString(mode));
}
static void enableOrDisable(const char *param, bool isEnabled) {
if (strEqualCaseInsensitive(param, "fastadc")) {
boardConfiguration->isFastAdcEnabled = isEnabled;
} else if (strEqualCaseInsensitive(param, "injection")) {
engineConfiguration->isInjectionEnabled = isEnabled;
} else if (strEqualCaseInsensitive(param, "ignition")) {
engineConfiguration->isIgnitionEnabled = isEnabled;
} else if (strEqualCaseInsensitive(param, "self_stimulation")) {
engineConfiguration->directSelfStimulation = isEnabled;
} else if (strEqualCaseInsensitive(param, "engine_control")) {
boardConfiguration->isEngineControlEnabled = isEnabled;
} else {
scheduleMsg(&logger, "unexpected [%s]", param);
return; // well, MISRA would not like this 'return' here :(
}
scheduleMsg(&logger, "[%s] %s", param, isEnabled ? "enabled" : "disabled");
}
static void enable(const char *param) {
enableOrDisable(param, true);
}
static void disable(const char *param) {
enableOrDisable(param, false);
}
static void enableSpi(int index) {
setSpiMode(index, true);
}
@ -704,6 +730,9 @@ void initSettings(void) {
addConsoleActionI("enable_spi", enableSpi);
addConsoleActionI("disable_spi", disableSpi);
addConsoleActionS("enable", enable);
addConsoleActionS("disable", disable);
addConsoleActionII("set_toothed_wheel", setToothedWheel);
addConsoleActionI("set_trigger_type", setTriggerType);

View File

@ -120,7 +120,8 @@ static void createLogFile(void) {
unlockSpi();
}
static void ff_cmd_dir(char *path) {
static void ff_cmd_dir(const char *pathx) {
char *path = (char *)pathx; // todo: fix this hack!
DIR dir;
FILINFO fno;
char *fn;
@ -168,7 +169,7 @@ static int errorReported = FALSE; // this is used to report the error only once
/**
* @brief Appends specified line to the current log file
*/
void appendToLog(char *line) {
void appendToLog(const char *line) {
UINT bytesWrited;
if (!fs_ready) {

View File

@ -17,7 +17,7 @@ extern "C"
void initMmcCard(void);
bool isSdCardAlive(void);
void appendToLog(char *line);
void appendToLog(const char *line);
#ifdef __cplusplus
}

View File

@ -235,5 +235,5 @@ void firmwareError(const char *fmt, ...) {
}
int getRusEfiVersion(void) {
return 20140910;
return 20140911;
}

View File

@ -279,7 +279,12 @@ int tokenLength(const char *msgp) {
return result;
}
int strEqual(const char *str1, const char *str2) {
bool strEqualCaseInsensitive(const char *str1, const char *str2) {
// todo: actual implementation!
return strEqual(str1, str2);
}
bool strEqual(const char *str1, const char *str2) {
// todo: there must be a standard function?!
int len1 = strlen(str1);
int len2 = strlen(str2);
@ -289,7 +294,7 @@ int strEqual(const char *str1, const char *str2) {
for (int i = 0; i < len1; i++)
if (str1[i] != str2[i])
return false;
return TRUE;
return true;
}
void initConsoleLogic() {

View File

@ -43,13 +43,14 @@ typedef void (*VoidInt)(int);
typedef void (*VoidFloat)(float);
typedef void (*VoidFloatFloat)(float, float);
typedef void (*VoidIntInt)(int, int);
typedef void (*VoidCharPtr)(char *);
typedef void (*VoidCharPtr)(const char *);
typedef void (*VoidCharPtrCharPtr)(const char *, const char *);
typedef void (*VoidCharPtrCharPtrCharPtr)(const char *, const char *, const char *);
typedef void (*VoidCharPtrCharPtrCharPtrCharPtrCharPtr)(const char *, const char *, const char *, const char *, const char *);
char *validateSecureLine(char *line);
int strEqual(const char *str1, const char *str2);
bool strEqualCaseInsensitive(const char *str1, const char *str2);
bool strEqual(const char *str1, const char *str2);
void resetConsoleActions(void);
void helpCommand(void);
void initConsoleLogic(void);