Clean up setting channel and CCA-threshold for CC2420 based motes.

The CCA-threshold now defaults to -46 which give better simulation
results and typically also better experimental results.
This adjustment is also needed due to commit 0a13f99 in mspsim. As
promised in https://github.com/mspsim/mspsim/pull/18 it broke the
regression tests.
This commit is contained in:
Moritz 'Morty' Strübe 2013-11-07 15:17:38 +01:00
parent c89e827d6c
commit c67c048cac
9 changed files with 69 additions and 43 deletions

View file

@ -60,6 +60,15 @@
#define CC2420_CONF_CHECKSUM 0
#endif /* CC2420_CONF_CHECKSUM */
#ifndef CC2420_CONF_CHANNEL
#define CC2420_CONF_CHANNEL 26
#endif /* CC2420_CONF_CHANNEL */
#ifndef CC2420_CONF_CCA_THRESH
#define CC2420_CONF_CCA_THRESH -45
#endif /* CC2420_CONF_CCA_THRESH */
#ifndef CC2420_CONF_AUTOACK
#define CC2420_CONF_AUTOACK 0
#endif /* CC2420_CONF_AUTOACK */
@ -331,7 +340,8 @@ cc2420_init(void)
setreg(CC2420_SECCTRL0, reg);
cc2420_set_pan_addr(0xffff, 0x0000, NULL);
cc2420_set_channel(26);
cc2420_set_channel(CC2420_CONF_CHANNEL);
cc2420_set_cca_threshold(CC2420_CONF_CCA_THRESH);
flushrx();