Make terminal commands executable from within firmware.

Signed-off-by: Michal Demin <michaldemin@gmail.com>
This commit is contained in:
Michal Demin
2017-06-15 22:10:34 +02:00
parent 6016bb7944
commit 372fe67da4
2 changed files with 13 additions and 0 deletions
@@ -389,6 +389,18 @@ static CommandStatusIdType CallCommandFunc(
return Status;
}
void CommandExecute(const char* command)
{
uint8_t i;
for (i = 0; i < ARRAY_COUNT(CommandTable); i++) {
if (strcmp_P(command, CommandTable[i].Command) == 0) {
CallCommandFunc(&CommandTable[i], CHAR_EXEC_MODE, NULL);
break;
}
}
}
static void DecodeCommand(void)
{
uint8_t i;
@@ -15,6 +15,7 @@ void CommandLineInit(void);
bool CommandLineProcessByte(uint8_t Byte);
void CommandLineTick(void);
void CommandExecute(const char* command);
void CommandLineAppendData(void const * const Buffer, uint16_t Bytes);
/* Functions for timeout commands */