2013-08-27 00:22:38 +02:00
|
|
|
# Firmware
|
|
|
|
|
|
|
|
## Flashing
|
|
|
|
|
|
|
|
## General
|
2012-08-06 12:43:35 +02:00
|
|
|
|
|
|
|
This firmware is to be flashed to the atmega88 of the pentabug.
|
|
|
|
The Makefile supports 2 different ways of flashing the firmware image:
|
|
|
|
|
2012-08-06 12:47:56 +02:00
|
|
|
### the serial bootloader way
|
2012-08-06 12:43:35 +02:00
|
|
|
|
|
|
|
With the
|
|
|
|
|
|
|
|
make serflash
|
|
|
|
|
2013-08-27 00:22:38 +02:00
|
|
|
target of the Makefile You can flash the microcontroler via the serial
|
|
|
|
bootloader that is part of the initial firmware.
|
2012-08-06 12:43:35 +02:00
|
|
|
|
2012-08-06 12:47:56 +02:00
|
|
|
### the isp way
|
2012-08-06 12:43:35 +02:00
|
|
|
|
|
|
|
With the
|
|
|
|
|
|
|
|
make flash
|
|
|
|
|
|
|
|
target of the Makefile you can flash the microcontroler via an isp programmer.
|
|
|
|
Adjust the avrdude settings to Your programmers needs beforehand.
|
|
|
|
|
2013-08-27 00:22:38 +02:00
|
|
|
## App API
|
|
|
|
|
|
|
|
The new firmware aims to be as simple as possible to the application developer.
|
|
|
|
The applications are defined by a function which is called repeatedly in an
|
|
|
|
Arduino like main loop. Most hardware components are (read: should be in the
|
|
|
|
near future) accessible through an easy API.
|
|
|
|
|
|
|
|
There can be multiple different applications in one firmware. The next
|
|
|
|
application can be started by pressing one of the two buttons for at least 2
|
|
|
|
seconds. The application has to be cooperative as other applications can only
|
|
|
|
be started if the `test_app_stop()` function is called in your application
|
|
|
|
regularly. You most propably won't have to worry about this as most functions
|
|
|
|
in the hardware abstraction layer are already doing this for you.
|
2012-08-06 12:43:35 +02:00
|
|
|
|
2013-08-27 00:45:05 +02:00
|
|
|
To write your own application simply create a .c file in the apps folder and
|
|
|
|
call the REGISTER() macro to define the entry point to your application.
|
|
|
|
|
|
|
|
## Bugs and TODOs
|
|
|
|
|
|
|
|
* add more functions to the hardware abstraction layer
|
2013-08-27 00:54:30 +02:00
|
|
|
* a mechanism to select which applications to include in the firmware
|
2013-08-27 00:45:05 +02:00
|
|
|
|