Replace uartPrintf() with uartPutInteger() and ...HexByte() because WTF everything is broken
This commit is contained in:
parent
201b1db6a6
commit
07e5b74e83
3 changed files with 28 additions and 17 deletions
|
|
@ -21,7 +21,7 @@ void executeCommand(CommandLine cmdLine) {
|
|||
}
|
||||
else if (strcmp(cmdLine.command, "HELP") == 0) {
|
||||
// HELP command: Print a list of supported commands.
|
||||
commandHelp(cmdLine.arg);
|
||||
commandHelp();
|
||||
}
|
||||
else if (strcmp(cmdLine.command, "READ") == 0) {
|
||||
// READ command: Takes a hex address range (or single address) as argument,
|
||||
|
|
@ -123,10 +123,13 @@ void commandRead(char* arg) {
|
|||
}
|
||||
} else {
|
||||
// Fancy ASCII output
|
||||
uartPrintf("<%d>", buffer.bytes);
|
||||
uartPutChar('<');
|
||||
uartPutInteger(buffer.bytes);
|
||||
uartPutChar('>');
|
||||
|
||||
for (int i = 0; i < buffer.bytes; i++) {
|
||||
uartPrintf(" %02X", buffer.data[i]);
|
||||
uartPutChar(' ');
|
||||
uartPutHexByte(buffer.data[i]);
|
||||
}
|
||||
uartPutLine(NULL);
|
||||
}
|
||||
|
|
@ -163,8 +166,10 @@ void commandErase() {
|
|||
void commandTestRead() {
|
||||
eepromSetReadMode();
|
||||
|
||||
for (int i = 0x00; i < 0x20; i++) {
|
||||
uartPrintf("TESTREAD 0x%02X: ", i);
|
||||
for (uint8_t i = 0x00; i < 0x20; i++) {
|
||||
uartPutString("TESTREAD 0x");
|
||||
uartPutHexByte(i);
|
||||
uartPutString(": ");
|
||||
|
||||
uint8_t byte = eepromReadByte(i);
|
||||
|
||||
|
|
@ -174,7 +179,9 @@ void commandTestRead() {
|
|||
uartPutChar('?');
|
||||
}
|
||||
|
||||
uartPrintf(" (0x%02X)\n");
|
||||
uartPutString(" (0x");
|
||||
uartPutHexByte(byte);
|
||||
uartPutLine(")");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue