fix start of cc2420: avoid infintie wait for stable oscillator interrupt #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: