TucsonDon
Member
C:
#define Timer0 0x100
#define Timer1 0x108
#define Timer2 0x110
#define Timer3 0x118
#define Timer4 0x120
#define Timer5 0x128
#define Timer6 0x130
#define Timer7 0x138
uint16_t TmrAdd[][1] =
{
Timer0,
Timer1,
Timer2,
Timer3,
Timer4,
Timer5,
Timer6,
Timer7
};
static uint8_t TmrCount(void)
{
uint8_t TCount = 0;
uint8_t Tmr = 0;
do
{
uint16_t bAdd = TmrAdd[TCount];
Tmr = DATAEE_ReadByte(bAdd);
if (Tmr != NoData) //NoData = 0xFF
{
TCount++;
}
}while (Tmr != NoData || TCount > 8);
return TCount;
}
I am using this code to access EEPROM, using a 2D array for the EEPROM address.
C:
uint16_t bAdd = TmrAdd[TCount];
when I run the code and the above line bAdd ends up with the address of the array element and not the contents of the element.
How do I correct this?