From 213a1430894a1561f903c82420f01c3e61ffdcfb Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Sat, 17 Apr 2021 17:43:14 +0200 Subject: [PATCH] Remove test commands --- firmware/src/commands.c | 61 ----------------------------------------- firmware/src/commands.h | 4 --- firmware/src/eeprom.h | 4 --- 3 files changed, 69 deletions(-) diff --git a/firmware/src/commands.c b/firmware/src/commands.c index d549f65..ed8620a 100644 --- a/firmware/src/commands.c +++ b/firmware/src/commands.c @@ -37,14 +37,6 @@ void executeCommand(CommandLine cmdLine) { // ERASE command: Takes a hex address range as argument and writes 0x00 bytes to the specified range. commandErase(cmdLine.arg); } - else if (strcmp(cmdLine.command, "TESTREAD") == 0) { - // TESTREAD command: for testing purposes, reads a few bytes and returns them in a human readable format. - commandTestRead(); - } - else if (strcmp(cmdLine.command, "TESTWRITE") == 0) { - // TESTWRITE command: for testing purposes, writes a few bytes - commandTestWrite(cmdLine.arg); - } else { // unknown command: return error message uartPutLine("ERROR invalid command"); @@ -80,11 +72,6 @@ void commandHelp() { 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"); } @@ -233,51 +220,3 @@ void commandErase(char* arg) { uartPutLine(" bytes"); } } - -// TESTREAD command: for testing purposes, reads a few bytes and returns them in a human readable format. -void commandTestRead() { - eepromSetReadMode(); - - for (uint8_t i = 0x00; i < 0x20; i++) { - uartPutString("TESTREAD 0x"); - uartPutHexByte(i); - uartPutString(": "); - - uint8_t byte = eepromReadByte(i); - - if (byte >= 32 && byte <= 126) { - uartPutChar(byte); - } else { - uartPutChar('?'); - } - - uartPutString(" (0x"); - uartPutHexByte(byte); - uartPutLine(")"); - } -} - -// TESTWRITE command: for testing purposes, writes a few bytes -void commandTestWrite(char* arg) { - char str[] = "Ohai world"; - address_t addr = 0x00; - - char* writeStr = str; - if (arg != NULL) { - writeStr = arg; - } - - eepromSetWriteMode(); - - // write input line instead of static string - for (char* p = writeStr; *p != '\0'; p++) { - eepromWriteByte(addr, *p); - //_delay_ms(100); - addr++; - } - - // TODO necessary? - _delay_ms(100); - - uartPutLine("TESTWRITE success"); -} diff --git a/firmware/src/commands.h b/firmware/src/commands.h index f31a471..1dd4ecf 100644 --- a/firmware/src/commands.h +++ b/firmware/src/commands.h @@ -12,8 +12,4 @@ void commandRead(char* arg); void commandWrite(char* arg); void commandErase(); -// TODO commands only for testing -void commandTestRead(); -void commandTestWrite(char* arg); - #endif /* COMMANDS_H_ */ diff --git a/firmware/src/eeprom.h b/firmware/src/eeprom.h index a8a1d51..84d9a42 100644 --- a/firmware/src/eeprom.h +++ b/firmware/src/eeprom.h @@ -5,10 +5,6 @@ #include "common.h" #include -// Define address length -// TODO 15 or 16? -#define ADDRESS_LENGTH 15 - // Macros for IO pins #define EEP_ADDR_LOW_PORT PORTC #define EEP_ADDR_LOW_DDR DDRC