Flame Runtime

About

Having been frustrated with many of the inefficiencies of the Arduino core libraries, we have built an alternate set with performance and size in mind. Alastair has given a talk at the Canberra Linux User Group about this library - the slides can be viewed on SlideShare.

Much of the efficiency gains comes from addressing some of the key design deficiencies of the Arduino runtime - we do not store pin/port information in tables in flash, needlessly preallocate objects nor dictate that excessively large buffers must be used. Instead, control of these are handed over to the developer at compile time.

We recommend using cppcheck and the CPPCeclipse Eclipse Plugin for further bug checking in your code.

Design Philosophies

  • Design for the architecture
  • Favour efficiency over simplicity
  • Hide complexity using macros
  • Provide a rich API that exposes all likely usages that are expected
  • Fix all warnings!
  • Use appropriate datatypes, and use strict typing where possible to minimise the wrong variable being passed
  • Favour C++ references over pointers to reduce bad usage which can lead to crashes
  • Leverage inheritance to make generic routines available for all objects that need it
  • Expensive operations should be asynchronous where possible, so they run in the background while your code does other things
  • Enable an event driven approach
  • BSD licensed to encourage commercial use (there is a separate GPL project for ports of GPL software to Flame, such as V-USB)
     

Getting Started

We recommend developing your Flame projects in Eclipse. For instructions on how to do so, please see our tutorial.

We also have another tutorial showing how to build Flame using make from the command line.

Bootloader

If an Arduino-style bootloader is required, we recommend Optiboot, which clocks at only a quarter the size of the Arduino bootloader (0.5kb vs 2kb), and a programming baud rate of 115,200bps.

If USB is more your thing, you may want to consider USBaspLoader, which clocks in at 2kb (the same size as the Arduino bootloader), and pretends to be a USBasp programmer. This uses software USB (based on the V-USB library), removing the need for a USB->serial chip, and allows you to flash your chip over USB using AVRdude.

Download

You can grab the libraries from our GIT repository at git.infernoembedded.com:

git clone git://git.infernoembedded.com/flame.git

or

git clone http://git.infernoembedded.com/flame.git

To update later...

git pull

You can also grab a tarball from the releases at the bottom of the page.

Licensing

This software is licensed under the BSD license. This means you can do what you like with it, including distributing it with your own software licensed under different terms. The only restriction is that you attribute us for our work, and reproduce our copyright:

Copyright (c) 2014, Inferno Embedded
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
 * Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.
 * Neither the name of New Millennium Networking, Inferno Embedded nor the
   names of its contributors may be used to endorse or promote products
   derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL MAKE, HACK, VOID BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Whats Implemented

  • Digital I/O
  • Timers
  • Serial (both busy-waiting and asynchronous)
  • External Interrupts
  • PinChange Interrupts
  • Servo control
  • Analogue to digital
  • Hardware PWM
  • Gamma correction - calculate on the fly, or lookup tables (recommended)
  • Fast synchronous serial shifter
  • Software H Bridge for driving naked transistors (with PWM support)
  • Realtime Clock & event triggering
  • Debouncing (detect button presses, as well as held buttons)
  • Software PWM Matrix (for passive LED matrices)
  • HT1632 based LED matrix displays such as the Sure Electronics DE-DP105 (search for 0832 led matrix on Ebay)
  • HD44780 & compatible LCD character displays
  • Software controlled voltage regulator
  • EEPROM
  • Power Saving (via AVR LibC)
  • PID algorithm
  • Voltage Regulator (buck/boost controller)
  • USB Keyboard emulation (via V-USB)

Todo

  • Optimise servo library
  • Input Capture for timers
  • SPI
  • Full functionality of the Arduino runtime

Contributing

Send patches, bugs or suggestions to our bug tracker.

Join the Flame Support & Development mailing list.

Downloads