Commit graph

3 commits

Author SHA1 Message Date
Ralf Schlatterbeck baaa2c5741 Factor/Fix generic resources
Now the old GENERIC_RESOURCE macros works again (but usage has changed).
Common resources (battery, leds, radio) are now in resources-common.
2015-01-21 15:41:21 +01:00
Ralf Schlatterbeck d5284eebe1 Factor resources, fix time
Now there is a generic resource that can generate and parse
application/json as well as text/plain. It can be re-used, only the
from_string and to_string routines have to be written and the resource
properly set up. A new resource format is specified, see
GENERIC_RESOURCE in, e.g., examples/osd/pwm-example. This is now used in
all my examples, namely pwm-example, arduino-sketch, wallclock-time.

There was an off by one error for the month in time formatting (in
gmtime and localtime). And the leap-year computation was broken. Both
fixed now, so we get a correct date. For localtime we are still 2 hours
off because daylight saving isn't implemented yet.

Also renamed gmtime to utc.
2014-11-19 13:53:12 +01:00
Ralf Schlatterbeck cfec3c6e2d Initial implementation of avr hardware timer
Mainly for PWM use for now.
With example to set the LED to different brightness via COAP.
We switch the LED with 50 kHz (20µs) in this example.
2014-11-19 13:47:37 +01:00