tinyos/tinyos-release — pull request #4 by dmolteni (2014-09-24 13:07:19+00:00)
Title: fix start of cc2420: avoid infintie wait for stable oscillator interrupt

Hi,
testing an app on a custom platform I found the node stop to send radio message: the problem was the InterrupCCA in CC2420ControlP is never fired like the logical level from radio remains low. This hang the code in an infinite wait of CC2420 oscillator is stable. Also hang the SPI bus so also external memory is not usable.

I don't know why on telosb/tmote platform is not consider CC2420 oscillator can not stabilize, but I think this changes can useful also on that pltaform to handle it.

I add a timeout for the interrupt, using double time reported on CC2420 datasheet. When timeout expire it checks, using a NOP, the status byte to see if oscillator is stable or not: in case it isn't set status on S_VREG_STARTED and signal it fails.

I also handle error condition in default LPL component:
+ in DefaultLpl componet: resignal the error case on sendDone event to signal the message is not sent
+ in PowerCycle component: post task to retry to turn on the radio