paparazzi/paparazzi — pull request #115 by flixr (2012-01-10 10:10:58+00:00)
Title: new sys_time

Integration of new system timing functions from Antoine.

This adds the possibility to register new timers with
```uint8_t sys_time_register_timer(uint32_t duration, sys_time_cb cb);```
If a callback function is given, it will be directly called out of the sys_tick_irq_handler. If the callback function is NULL, the function ```bool_t sys_time_check_and_ack_timer( uint8_t id )``` can be used to check if the timer has elapsed.
This also means that there is no ```sys_time_periodic()``` anymore, instead a timer is registered with the periodic frequency for that.

These "soft" timers are checked with every SysTick (every time the sys_time ISR gets called). This uses the SysTick feature of the stm32 and just calls the isr on a match of timer0 on the lpc21.

The sys tick frequency has to be set to at least the periodic frequency, and best be a multiple of it.
Define ```SYS_TIME_RESOLUTION``` to set the timer resolution (1/periodic_freq obviously) in seconds.
It currently defaults to 1/1024 and to 1/PERIODIC_FREQUENCY for fixedwing firmware.