Added a low level implementation of timer_set() that allows setting relative
timeouts as short as 0. This results in tests/periph_timer_short_relative_set
no passing.
Names with two leading underscores are reserved in any context of the c
standard, and thus must not be used. This ATmega platform used it however for
defining internal stuff. This commit fixes this.
- correct number of timers for atmega328p from 2 to 1
- correct number of timer channels for atmega328p from 3 to 2
- adapt atmega periph timer implementation accordingly
A debug pin can be used to probe timer interrupts with an oscilloscope or
other time measurement equipment. Thus, determine when an interrupt occurs
and how long the timer ISR takes.
The pin should be defined in the makefile as follows:
CFLAGS += -DDEBUG_TIMER_PORT=PORTF -DDEBUG_TIMER_DDR=DDRF \
-DDEBUG_TIMER_PIN=PORTF4
use generic avr/libc definition for conditionnal compilation.
eg: use #ifdef(PORTG) or #ifdef(TIMER_0_ISRC) instead of #ifdef(Atmega328p)
This is more generic and simplify future boards support.
Makes AVR register definitions dependent on what avr-libc defines
for a given MCU, rather then duplicating that effort here.
Definitions done in this way are based on functionality provided,
rather than a specific MCU device.