lwframework is a code framework which is designed to allow for a more event-driven approach than simple frameworks like Energia allow. It requires more familiarity with the hardware, but gives more power in the end (hopefully).
The classic example is this: learning how to blink 1 LED in an Energia/Arduino sketch is easy, right? Now blink 2. At different rates. Uh oh - that simple approach now becomes much harder.
The 'typical' solution to this problem ( http://www.gammon.com.au/blink ) is to loop constantly, and keep checking if it's time to blink each LED individually. Obviously this doesn't scale - you start requiring more and more and more of the processing power just to keep checking.
A full-blown RTOS approach (like http://www.contiki-os.org ) would use protothreads, and a timer. But those have quite a bit of overhead - you gain a ton for that, obviously, but can't we get a similar approach with less effort?
I've been having some trouble writing up an introduction to lwframework because it constantly seems like everything's interconnected. Plus I feel like I have to justify its existence: "why use callbacks for everything?" "why not just create new Energia stuff" etc. etc.
So I just started putting up something on the GitHub wiki to explain how it works. Hopefully I'll be adding an example directory soon to show how to do certain things. I'm trying to avoid any direct comparisons to other projects, because that requires quite a bit of work to do it fairly. But that'll come, obviously.
has the 'blink an LED' project. Hopefully some of lwframework's benefits become obvious already here - blinking multiple LEDs, at different, or even varying, rates becomes trivial, and the system stays asleep the majority of the time anyway.
Ever actually disassemble Energia/Arduino code and look at why you need to run the microcontroller so fast to do things? Or look at the resource usage of an RTOS like Contiki?
I did. Not for fun, obviously - in both cases I tried to use Energia or Contiki in a project I was working on, which has quite a lot going on with it. And neither of them worked. Granted, I was doing something fairly silly in that project - a high baud rate soft UART - but I did get it working.
Then I came across Alex Mykyta's MSP430 code library here:
which I thought was pretty nice. It gives you events, timers... the basics of an RTOS. But when I tried to use it, it did a few things which were deal-breakers for me: it disabled interrupts a ton, and required a lot of time inside an ISR to do things. Adding an event to an event queue takes a huge amount of time.
That made me think: what do you need events for, and what's the simplest way to do them?
And that made me think hey, I can redo a ton of this stuff in C++, using CRTP classes, and rapidly build up a framework of Useful Microcontroller Stuff very fast. With no overhead! Lots of the benefits of C++, no performance drawbacks. (Debugging it currently sucks, but that's TI's fault).