Function Pointer
Rich (BB code):
#define IAP_LOCATION 0x1FFF1FF1
typedef void (*IAP) ( unsigned int command[],
unsigned int result[] );
static const IAP iap_entry = (IAP) IAP_LOCATION;
void writeEEPROM( uint16_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] = 375;
/* Invoke IAP call...*/
iap_entry(command, result);
if (0 != result[0])
{
//Trap error
while(1);
}
return;
}