auto-sync

This commit is contained in:
rusEfi 2014-09-15 11:03:05 -05:00
parent 40a833e220
commit 5b8461eac8
3 changed files with 25 additions and 4 deletions

View File

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

View File

@ -90,6 +90,27 @@ void addConsoleActionFF(const char *token, VoidFloatFloat callback) {
doAddAction(token, FLOAT_FLOAT_PARAMETER, (Void) callback);
}
static int getParameterCount(action_type_e parameterType) {
switch (parameterType) {
case NO_PARAMETER:
return 0;
case ONE_PARAMETER:
case FLOAT_PARAMETER:
case STRING_PARAMETER:
return 1;
case FLOAT_FLOAT_PARAMETER:
case STRING2_PARAMETER:
case TWO_INTS_PARAMETER:
return 2;
case STRING3_PARAMETER:
return 3;
case STRING5_PARAMETER:
return 5;
default:
return -1;
}
}
/**
* @brief This function prints out a list of all available commands
*/
@ -105,7 +126,7 @@ void helpCommand(void) {
scheduleMsg(&logging, "%d actions available", consoleActionCount);
for (int i = 0; i < consoleActionCount; i++) {
TokenCallback *current = &consoleActions[i];
scheduleMsg(&logging, " %s: %d parameters", current->token, current->parameterType);
scheduleMsg(&logging, " %s: %d parameters", current->token, getParameterCount(current->parameterType));
}
#endif
}

View File

@ -26,11 +26,11 @@ typedef enum {
STRING5_PARAMETER,
TWO_INTS_PARAMETER,
FLOAT_FLOAT_PARAMETER
} ACTION_PARAMETER_TYPE;
} action_type_e;
typedef struct {
const char *token;
int parameterType;
action_type_e parameterType;
void (*callback)(void);
} TokenCallback;