Implement HELP command
This commit is contained in:
parent
d29465b2dd
commit
2ca8941899
|
|
@ -23,6 +23,10 @@ void executeCommand(CommandLine cmdLine) {
|
||||||
// INIT command: Initializes connection.
|
// INIT command: Initializes connection.
|
||||||
commandInit(cmdLine.arg);
|
commandInit(cmdLine.arg);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(cmdLine.command, "HELP") == 0) {
|
||||||
|
// HELP command: Print a list of supported commands.
|
||||||
|
commandHelp(cmdLine.arg);
|
||||||
|
}
|
||||||
else if (strcmp(cmdLine.command, "READ") == 0) {
|
else if (strcmp(cmdLine.command, "READ") == 0) {
|
||||||
// READ command: Takes a hex address range (or single address) as argument,
|
// READ command: Takes a hex address range (or single address) as argument,
|
||||||
// reads data and returns it in hexadecimal ASCII format.
|
// reads data and returns it in hexadecimal ASCII format.
|
||||||
|
|
@ -68,6 +72,21 @@ void commandInit(char* arg) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void commandHelp() {
|
||||||
|
uartPutLine("HELP - Supported commands:");
|
||||||
|
uartPutLine("HELP - HELP");
|
||||||
|
uartPutLine("HELP - INIT [BINARY|ASCII]");
|
||||||
|
uartPutLine("HELP - READ 0000:0FFF");
|
||||||
|
uartPutLine("HELP - WRITE 0000");
|
||||||
|
uartPutLine("HELP - ERASE 0000:0FFF");
|
||||||
|
|
||||||
|
// TODO remove those
|
||||||
|
uartPutLine("HELP - TESTREAD (only for testing)");
|
||||||
|
uartPutLine("HELP - TESTWRITE (only for testing)");
|
||||||
|
|
||||||
|
uartPutLine("OK");
|
||||||
|
}
|
||||||
|
|
||||||
void commandRead(char* arg) {
|
void commandRead(char* arg) {
|
||||||
if (arg == NULL) {
|
if (arg == NULL) {
|
||||||
uartPutLine("ERR READ needs an address or address range");
|
uartPutLine("ERR READ needs an address or address range");
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ int main(void) {
|
||||||
_delay_ms(100);
|
_delay_ms(100);
|
||||||
|
|
||||||
// Write initial message via UART
|
// Write initial message via UART
|
||||||
uartPutLine("INFO -- EEPROM programmer by binaryDiv");
|
uartPutLine("INFO - EEPROM programmer by binaryDiv");
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
// Run main loop endlessly
|
// Run main loop endlessly
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue