Example #1
0
void comm_cc2520_init(void) {
	tx_slot_read = 0;
	tx_slot_write = 0;

	// rf
	halAssyInit();
	basicRfConfig.panId = CC2520_PAN_ID;
	basicRfConfig.channel = CC2520_RF_CHANNEL;
	basicRfConfig.ackRequest = FALSE;
	basicRfConfig.myAddr = CC2520_NODE_ADDRESS;
#ifdef SECURITY_CCM
	basicRfConfig.securityKey = rf_security_key;
#endif

	if(basicRfInit(&basicRfConfig) == FAILED) {
		for(;;) {}
	}

	basicRfReceiveOn();

	chThdCreateStatic(rx_thread_wa, sizeof(rx_thread_wa),
			NORMALPRIO, rx_thread, NULL);
	chThdCreateStatic(tx_thread_wa, sizeof(tx_thread_wa),
			NORMALPRIO, tx_thread, NULL);
}
//------------------------------------------------------------------------------
//  void halBoardInit(void)
//
//  DESCRIPTION:
//    Set up board. Initialize MCU, configure I/O pins and user interfaces
//------------------------------------------------------------------------------
void halBoardInit(void)
{
    halAssyInit();
    ENABLE_GLOBAL_INT();
}