mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-17 10:33:49 +01:00
cpu/atmega2560: Update timer_init to match API change
This commit is contained in:
parent
933ee91f72
commit
819d619bad
@ -46,10 +46,11 @@ timer_conf_t config[TIMER_NUMOF];
|
|||||||
* @brief Setup the given timer
|
* @brief Setup the given timer
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int timer_init(tim_t dev, unsigned int us_per_ticks, void (*callback)(int))
|
int timer_init(tim_t dev, unsigned long freq, void (*callback)(int))
|
||||||
{
|
{
|
||||||
/* reject impossible us_per_ticks values */
|
/* reject impossible freq values
|
||||||
if ((us_per_ticks != 4)) {
|
* todo: Add support for 2 MHz and 16 MHz */
|
||||||
|
if ((freq != 250000ul)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,7 +280,7 @@ int timer_clear(tim_t dev, int channel)
|
|||||||
unsigned int timer_read(tim_t dev)
|
unsigned int timer_read(tim_t dev)
|
||||||
{
|
{
|
||||||
uint16_t a;
|
uint16_t a;
|
||||||
uint32_t b;
|
uint16_t b;
|
||||||
/*
|
/*
|
||||||
* Disabling interrupts globally because read from 16 Bit register can
|
* Disabling interrupts globally because read from 16 Bit register can
|
||||||
* otherwise be messed up
|
* otherwise be messed up
|
||||||
@ -317,6 +318,7 @@ unsigned int timer_read(tim_t dev)
|
|||||||
|
|
||||||
case TIMER_UNDEFINED:
|
case TIMER_UNDEFINED:
|
||||||
default:
|
default:
|
||||||
|
(void)b;
|
||||||
a = 0;
|
a = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user