cc2538 platforms: initialize linkaddr in phase 2 but set RF params only in phase 3
This commit is contained in:
parent
c687b615ee
commit
bc741c00cc
@ -103,9 +103,6 @@ set_rf_params(void)
|
|||||||
short_addr = ext_addr[7];
|
short_addr = ext_addr[7];
|
||||||
short_addr |= ext_addr[6] << 8;
|
short_addr |= ext_addr[6] << 8;
|
||||||
|
|
||||||
/* Populate linkaddr_node_addr. Maintain endianness */
|
|
||||||
memcpy(&linkaddr_node_addr, &ext_addr[8 - LINKADDR_SIZE], LINKADDR_SIZE);
|
|
||||||
|
|
||||||
NETSTACK_RADIO.set_value(RADIO_PARAM_PAN_ID, IEEE802154_PANID);
|
NETSTACK_RADIO.set_value(RADIO_PARAM_PAN_ID, IEEE802154_PANID);
|
||||||
NETSTACK_RADIO.set_value(RADIO_PARAM_16BIT_ADDR, short_addr);
|
NETSTACK_RADIO.set_value(RADIO_PARAM_16BIT_ADDR, short_addr);
|
||||||
NETSTACK_RADIO.set_value(RADIO_PARAM_CHANNEL, CC2538_RF_CHANNEL);
|
NETSTACK_RADIO.set_value(RADIO_PARAM_CHANNEL, CC2538_RF_CHANNEL);
|
||||||
@ -159,7 +156,8 @@ platform_init_stage_two()
|
|||||||
crypto_disable();
|
crypto_disable();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
set_rf_params();
|
/* Populate linkaddr_node_addr */
|
||||||
|
ieee_addr_cpy_to(linkaddr_node_addr.u8, LINKADDR_SIZE);
|
||||||
|
|
||||||
INTERRUPTS_ENABLE();
|
INTERRUPTS_ENABLE();
|
||||||
|
|
||||||
@ -171,6 +169,8 @@ platform_init_stage_three()
|
|||||||
{
|
{
|
||||||
LOG_INFO("%s\n", BOARD_STRING);
|
LOG_INFO("%s\n", BOARD_STRING);
|
||||||
|
|
||||||
|
set_rf_params();
|
||||||
|
|
||||||
soc_print_info();
|
soc_print_info();
|
||||||
|
|
||||||
adc_init();
|
adc_init();
|
||||||
|
@ -111,9 +111,6 @@ set_rf_params(void)
|
|||||||
short_addr = ext_addr[7];
|
short_addr = ext_addr[7];
|
||||||
short_addr |= ext_addr[6] << 8;
|
short_addr |= ext_addr[6] << 8;
|
||||||
|
|
||||||
/* Populate linkaddr_node_addr. Maintain endianness */
|
|
||||||
memcpy(&linkaddr_node_addr, &ext_addr[8 - LINKADDR_SIZE], LINKADDR_SIZE);
|
|
||||||
|
|
||||||
NETSTACK_RADIO.set_value(RADIO_PARAM_PAN_ID, IEEE802154_PANID);
|
NETSTACK_RADIO.set_value(RADIO_PARAM_PAN_ID, IEEE802154_PANID);
|
||||||
NETSTACK_RADIO.set_value(RADIO_PARAM_16BIT_ADDR, short_addr);
|
NETSTACK_RADIO.set_value(RADIO_PARAM_16BIT_ADDR, short_addr);
|
||||||
NETSTACK_RADIO.set_value(RADIO_PARAM_CHANNEL, CC2538_RF_CHANNEL);
|
NETSTACK_RADIO.set_value(RADIO_PARAM_CHANNEL, CC2538_RF_CHANNEL);
|
||||||
@ -157,7 +154,8 @@ platform_init_stage_two()
|
|||||||
crypto_disable();
|
crypto_disable();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
set_rf_params();
|
/* Populate linkaddr_node_addr */
|
||||||
|
ieee_addr_cpy_to(linkaddr_node_addr.u8, LINKADDR_SIZE);
|
||||||
|
|
||||||
INTERRUPTS_ENABLE();
|
INTERRUPTS_ENABLE();
|
||||||
|
|
||||||
@ -169,6 +167,8 @@ platform_init_stage_three()
|
|||||||
{
|
{
|
||||||
LOG_INFO("%s\n", BOARD_STRING);
|
LOG_INFO("%s\n", BOARD_STRING);
|
||||||
|
|
||||||
|
set_rf_params();
|
||||||
|
|
||||||
board_init();
|
board_init();
|
||||||
|
|
||||||
soc_print_info();
|
soc_print_info();
|
||||||
|
@ -166,9 +166,6 @@ set_rf_params(void)
|
|||||||
short_addr = ext_addr[7];
|
short_addr = ext_addr[7];
|
||||||
short_addr |= ext_addr[6] << 8;
|
short_addr |= ext_addr[6] << 8;
|
||||||
|
|
||||||
/* Populate linkaddr_node_addr. Maintain endianness */
|
|
||||||
memcpy(&linkaddr_node_addr, &ext_addr[8 - LINKADDR_SIZE], LINKADDR_SIZE);
|
|
||||||
|
|
||||||
NETSTACK_RADIO.set_value(RADIO_PARAM_PAN_ID, IEEE802154_PANID);
|
NETSTACK_RADIO.set_value(RADIO_PARAM_PAN_ID, IEEE802154_PANID);
|
||||||
NETSTACK_RADIO.set_value(RADIO_PARAM_16BIT_ADDR, short_addr);
|
NETSTACK_RADIO.set_value(RADIO_PARAM_16BIT_ADDR, short_addr);
|
||||||
NETSTACK_RADIO.set_value(RADIO_PARAM_CHANNEL, CC2538_RF_CHANNEL);
|
NETSTACK_RADIO.set_value(RADIO_PARAM_CHANNEL, CC2538_RF_CHANNEL);
|
||||||
@ -220,7 +217,8 @@ platform_init_stage_two()
|
|||||||
crypto_disable();
|
crypto_disable();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
set_rf_params();
|
/* Populate linkaddr_node_addr */
|
||||||
|
ieee_addr_cpy_to(linkaddr_node_addr.u8, LINKADDR_SIZE);
|
||||||
|
|
||||||
INTERRUPTS_ENABLE();
|
INTERRUPTS_ENABLE();
|
||||||
|
|
||||||
@ -232,6 +230,8 @@ platform_init_stage_three()
|
|||||||
{
|
{
|
||||||
LOG_INFO("%s\n", BOARD_STRING);
|
LOG_INFO("%s\n", BOARD_STRING);
|
||||||
|
|
||||||
|
set_rf_params();
|
||||||
|
|
||||||
board_init();
|
board_init();
|
||||||
|
|
||||||
rtc_init();
|
rtc_init();
|
||||||
|
Loading…
Reference in New Issue
Block a user