same action twice
This commit is contained in:
parent
9debb06b1f
commit
8fd3d1a318
|
@ -1290,6 +1290,10 @@ static void setValue(const char *paramStr, const char *valueStr) {
|
|||
}
|
||||
|
||||
void initSettings(void) {
|
||||
#if EFI_SIMULATOR
|
||||
printf("initSettings\n");
|
||||
#endif
|
||||
|
||||
// todo: start saving values into flash right away?
|
||||
|
||||
addConsoleActionP("showconfig", (VoidPtr) doPrintConfiguration, &engine);
|
||||
|
@ -1308,7 +1312,6 @@ void initSettings(void) {
|
|||
addConsoleActionF("set_whole_ign_corr_map", setWholeIgnitionIatCorr);
|
||||
addConsoleActionSSS("set_fuel_map", setFuelMap);
|
||||
|
||||
addConsoleActionF("set_whole_timing_map", setWholeTimingMap);
|
||||
addConsoleActionSSS("set_timing_map", setTimingMap);
|
||||
|
||||
addConsoleAction("stopengine", (Void) stopEngine);
|
||||
|
|
|
@ -275,5 +275,5 @@ int getRusEfiVersion(void) {
|
|||
if (initBootloader() != 0)
|
||||
return 123;
|
||||
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
|
||||
return 20180129;
|
||||
return 20180130;
|
||||
}
|
||||
|
|
|
@ -45,14 +45,20 @@ void resetConsoleActions(void) {
|
|||
}
|
||||
|
||||
static void doAddAction(const char *token, action_type_e type, Void callback, void *param) {
|
||||
efiAssertVoid(consoleActionCount < CONSOLE_MAX_ACTIONS, "Too many console actions");
|
||||
TokenCallback *current = &consoleActions[consoleActionCount++];
|
||||
for (uint32_t i = 0; i< efiStrlen(token);i++) {
|
||||
for (uint32_t i = 0; i < efiStrlen(token);i++) {
|
||||
char ch = token[i];
|
||||
if (ch != mytolower(ch)) {
|
||||
firmwareError(CUSTOM_ERR_COMMAND_LOWER_CASE_EXPECTED, "lowerCase expected [%s]", token);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < consoleActionCount; i++) {
|
||||
if (strcmp(token, consoleActions[i].token) == 0 /* zero result means strings are equal */) {
|
||||
firmwareError(CUSTOM_ERR_6147, "Same action twice [%s]", token);
|
||||
}
|
||||
}
|
||||
|
||||
efiAssertVoid(consoleActionCount < CONSOLE_MAX_ACTIONS, "Too many console actions");
|
||||
TokenCallback *current = &consoleActions[consoleActionCount++];
|
||||
current->token = token;
|
||||
current->parameterType = type;
|
||||
current->callback = callback;
|
||||
|
|
Loading…
Reference in New Issue