User manual

LPCXpresso Experiment Kit - User’s Guide
Page 114
Copyright 2013 © Embedded Artists AB
volatile uint32_t ms_ticks = 0;
/*****************************************************************************
** Function name: SysTick_Handler
**
** Descriptions: Interrupt handler. Updates the ms_ticks variable to hold
** the number of milliseconds since start. This will be
** reasonably accurate and is used by the Xbee driver to
** handle timeouts.
**
** parameters: None
** Returned value: The time in milliseconds
**
*****************************************************************************/
void SysTick_Handler(void) {
ms_ticks += 10;
}
/*****************************************************************************
** Function name: xbeeUp
**
** Descriptions: XBee node up/down callback.
**
** parameters: up will be 1 if the node is up, 0 if it is down
** Returned value: None
**
*****************************************************************************/
static void xbeeUp(uint8_t up)
{
printf("RF: Xbee Up (%d)\r\n", up);
devIsReady = up;
}
/*****************************************************************************
** Function name: xbeeNode
**
** Descriptions: XBee node discover callback. Will be called as a response
** to a Xbee node discovery request. All found nodes are
** reported back one-by-one through this callback.
**
** parameters: addrHi - upper 32 bits of the 64-bit node address,
** addrLo - lower 32 bits of the 64-bit node address,
** rssi - signal strength
** Returned value: None
**
*****************************************************************************/
static void xbeeNode(uint32_t addrHi, uint32_t addrLo, uint8_t rssi)
{
printf("RF: Node %x:%x rssi=%d\r\n", addrHi, addrLo, rssi);
}
/*****************************************************************************
** Function name: xbeeTxStatus
**
** Descriptions: Transmit status callback. Called as a result of a packet
** being sent from the Xbee node.
**
** parameters: frameId - ID of the frame that was sent,
** status - status of the transmit request
** Returned value: None
**
*****************************************************************************/
static void xbeeTxStatus(uint8_t frameId, xbeeTxStatus_t status)
{
if (status != XBEE_TX_STAT_OK) {
printf("RF: [%d] TX failed %d\r\n", frameId, status);
}
}
/*****************************************************************************