1. here is pice of code, x incremnts. this is way how to call by referernece
This is fine
2. Second, how does i is treated here. Do i passes address now to eeAddress.
Like eeAddress has address of i. And try to change value of eeAddress like let have i =0 *eeAddress is value at address 0 of MCU
This is fine
Rich (BB code):
main()
{
int x;
inc(&x);
}
inc(int * y)
{
(*y)++;
}
Like eeAddress has address of i. And try to change value of eeAddress like let have i =0 *eeAddress is value at address 0 of MCU
Rich (BB code):
i=0;
writeEEPROM( (uint8_t*) i, (uint8_t*) &hold, 4 );
void writeEEPROM( uint8_t* eeAddress, uint8_t* buffAddress, uint32_t byteCount )
{
unsigned int command[5], result[4];
command[0] = 61;
command[1] = (uint32_t) eeAddress;
command[2] = (uint32_t) buffAddress;
command[3] = byteCount;
command[4] = SystemCoreClock/1000;
/* Invoke IAP call...*/
iap_entry(command, result);
if (0 != result[0])
{
//Trap error
while(1);
}
return;
}