Dec 312013
 

https://github.com/RickKimball/msp430_code/tree/master/fabooh

public / msp430_code

readme.md

FABOOH – \ˈfab-ü\

Fabooh is an optimized C++ template based peripheral framework for the msp430 microcontroller. It creates very small and efficient code while still providing a flexible framework similar to what you might expect to find with something like the Arduino API. It makes liberal use of inline msp430-gcc assembler code to produce optimized code that is sometimes smaller than generic ‘C’ code.

Example

A typical blink program looks something like this:

#include <fabooh.h>
#include <main.h>

inline void setup() {
  RED_LED::pinMode(OUTPUT);
  GREEN_LED::pinMode(OUTPUT);
  PUSH2::pinMode(INPUT_PULLUP);

  GREEN_LED::low();
  RED_LED::high();
}

void loop() {
  // block loop if user holds down the button
  if ( !PUSH2::read() ) {
    do {
      delay_msecs(10); // debounce switch
    } while(!PUSH2::read());
  }

  delay_msecs(100);
  RED_LED::toggle();
  GREEN_LED::toggle();
}

This results in very efficient code that uses only 120 bytes of flash, and no DATA or BSS space.

 Posted by at 8:04 am

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)