Hi guys
In the following codes, it says:
Thanks guys!
PS: the following code is part of demo code from Microchip MAL library, I can link in the full code if required.
PS2: I am coming from AVR, but new in PIC
In the following codes, it says:
What exactly does it mean? According to my count,the size of __CONNECTION_ENTRY is 14 bytes, how is that dividable by 256?Due to the bank limitation in PIC18 MCU architecture, the size of
CONNECTION_ENTRY must be dividable by 256 in case the array is across
the bank.
Thanks guys!
PS: the following code is part of demo code from Microchip MAL library, I can link in the full code if required.
PS2: I am coming from AVR, but new in PIC
Code:
/***************************************************************************
* Peer Device Information in Connection Table
*
* This structure contains device information about the peer device
* of current node. It is the element structure for connection table.
* Due to the bank limitation in PIC18 MCU architecture, the size of
* CONNECTION_ENTRY must be dividable by 256 in case the array is across
* the bank. In this case, the user need to make sure that there is no
* problem
**************************************************************************/
typedef struct __CONNECTION_ENTRY
{
#if !defined(PROTOCOL_P2P)
API_UINT16_UNION PANID; //2 bytes
API_UINT16_UNION AltAddress; //2 bytes
#endif
uint8_t Address[MY_ADDRESS_LENGTH]; // 8 bytes
CONNECTION_STATUS status; //1 byte
#if ADDITIONAL_NODE_ID_SIZE > 0
uint8_t PeerInfo[ADDITIONAL_NODE_ID_SIZE]; // 1 byte
#endif
} CONNECTION_ENTRY;