68 #define EEPROM_ADDR 0x40
71 #define BUFFER_SIZE 0x40
100 str[4 + stSize] =
'\0';
103 DEBUGSTR(
"Stored string found in EEEPROM\r\n");
109 DEBUGSTR(
"No string stored in the EEPROM\r\n");
120 DEBUGSTR(
"\r\nEnter a string to write into EEPROM\r\n");
121 DEBUGSTR(
"Up to 32 bytes in length, press ESC to accept\r\n");
129 #if defined(DEBUG_ENABLE)
131 while ((index < 32) && (byte !=
ESC_CHAR)) {
133 strOut[0] = str[4 + index] = (uint8_t) byte;
146 strncpy((
char *) &str[4],
"12345678", 8);
150 str[3] = (uint8_t) index;
165 EEPROM_READ_COMMAND_T rCommand;
166 EEPROM_READ_OUTPUT_T rOutput;
167 EEPROM_WRITE_COMMAND_T wCommand;
168 EEPROM_WRITE_OUTPUT_T wOutput;
171 uint8_t *ptr = (uint8_t *)
buffer;
172 volatile int loop = 1;
177 rCommand.cmd = FLASH_EEPROM_READ;
194 wCommand.cmd = FLASH_EEPROM_WRITE;
197 wCommand.byteNum = (4 + stSize);
201 DEBUGSTR(
"EEPROM write passed\r\n");
202 DEBUGSTR(
"Reading back string...\r\n");
215 DEBUGSTR(
"EEPROM write failed\r\n");