void main() { byte value,cmd; EEPROM_ADDRESS address; init_ext_eeprom(); do { do { printf("\r\nRead or Write: "); cmd=getc(); cmd=toupper(cmd); putc(cmd); } while ( (cmd!='R') && (cmd!='W') ); printf("\n\rLocation: "); address = gethex(); if(cmd=='R') printf("\r\nValue: %X\r\n",READ_EXT_EEPROM( address ) ); if(cmd=='W') { printf("\r\nNew value: "); value = gethex(); printf("\n\r"); WRITE_EXT_EEPROM( address, value ); } } while (TRUE); }
main() { byte value,cmd; EEPROM_ADDRESS address; init_ext_eeprom(); do { do { printf("\r\nRead or Write: "); cmd=getc(); cmd=toupper(cmd); putc(cmd); } while ( (cmd!='R') && (cmd!='W') ); printf("\n\rLocation: "); #if sizeof(EEPROM_ADDRESS)==1 address = gethex(); #else #if EEPROM_SIZE>0xfff address = gethex(); #else address = gethex1(); #endif address = (address<<8)+gethex(); #endif if(cmd=='R') printf("\r\nValue: %X\r\n",READ_EXT_EEPROM( address ) ); if(cmd=='W') { printf("\r\nNew value: "); value = gethex(); printf("\n\r"); WRITE_EXT_EEPROM( address, value ); } } while (TRUE); }