So damned world of TinyOS!
How many snares!
You can say it loud!!
On these days we are experimenting troubles, since we need to make the TMote communicate with the NXT brick. The thing probably doesn’t seem so bad… after all we’ve got both a working Rs485 driver on the NxOS, and a consolidated operating system like TinyOS on the other side that provides us a USART device driver! But the world isn’t so plain as it seems…
The TinyOS system provides an awesome Doxygen/Javadoc-like reference. For the TelosB platform we already have hardware libraries available, including the Msp430 Usart ones.
Ok, on a first impression the documentation seems just a little hermetic… Never mind that: reading TEPs makes it clear enough. Infact after a good RTFM session the documentation seemed much more clear: it was clear that something was wrong with it.
After hours wasted trying to figure it out properly, we finally decided to ask for help on the TinyOs mailing list! Thanks to a guy named Razvan who showed us a simple solution, we discovered that the documentation is not just hermetic, but actually incomplete!
Take Msp430* elements, for instance… among others the documentation provides the following modules and configurations:
- Msp430Uart1C
- Msp430Uart1P
- Msp430UartP
- Msp430Usart0C
- Msp430Usart1C
Looking at this list is clear that the consistency isn’t considered a moral virtue. Actually I still don’t understand why there are two ways of referring to the same kind of peripheral… However the really bad thing is that actually there are other hidden elements, not appointed in the reference! Let’s talk about the Msp430Uart0C, for instance.
Ambiguity is bad. But I really didn’t expect that someone could use it for enlarge the namespace… Despite I’m quite appalled, tomorrow we probably will face this ugly thing with less effort.
Filed under: Organization