Hi all,
I'm using SimpliciTI 1.10 (AP_as_data_hub example based) in which I use the following code to read the pre programmed IEEE address and use it as the device's network adress:
__near_func void MnGetIEEEAddress(unsigned char *a)
{
unsigned char bank; // Code is copied from TI example
bank = MEMCTR;
// switch to bank 3
MEMCTR |= 0x30;
a[0] = *(unsigned char __code *)(IEEE_ADDRESS_ARRAY + 0);
a[1] = *(unsigned char __code *)(IEEE_ADDRESS_ARRAY + 1);
a[2] = *(unsigned char __code *)(IEEE_ADDRESS_ARRAY + 2);
a[3] = *(unsigned char __code *)(IEEE_ADDRESS_ARRAY + 3);
a[4] = *(unsigned char __code *)(IEEE_ADDRESS_ARRAY + 4);
a[5] = *(unsigned char __code *)(IEEE_ADDRESS_ARRAY + 5);
a[6] = *(unsigned char __code *)(IEEE_ADDRESS_ARRAY + 6);
a[7] = *(unsigned char __code *)(IEEE_ADDRESS_ARRAY + 7);
// restore old bank settings
MEMCTR = bank;
}
void MnSetAddress (void)
{
addr_t adrAddress;
uint8_t aIeee[8];
uint8_t i=0;
MnGetIEEEAddress(aIeee);
for (i=0; i<NET_ADDR_SIZE; i++)
{
adrAddress.addr[i] = aIeee[i];
}
SMPL_Ioctl(IOCTL_OBJ_ADDR, IOCTL_ACT_SET, &adrAddress);
}
This worked fine in SimpliciTI 1.06 but in 1.10 these functions work fine but the SMPL_Init() function returns SMPL_NO_CHANNEL when I use these functions to set the address. If I comment out the call to MnSetAddress in my main() procedure everything works fine...
Can anyone tell me what it is I'm doing wrong?
Ad