mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cpu/atmega328p: Relocate default timer config
This commit is contained in:
parent
a950d6bbb6
commit
200afc46fa
@ -53,11 +53,6 @@ extern "C" {
|
||||
*
|
||||
* @details Only the 16 bit timers are used by xtimer
|
||||
*
|
||||
* ATmega328p
|
||||
* ==========
|
||||
* The timer driver only supports the 16-bit timer (Timer1)
|
||||
* so this is the only one we can use here.
|
||||
*
|
||||
* ATmega1281
|
||||
* ==========
|
||||
* The ATmega1281 has 6 timers. Timer0 and Timer2 are 8 Bit Timers,
|
||||
@ -81,16 +76,7 @@ extern "C" {
|
||||
* @{
|
||||
*/
|
||||
#ifndef TIMER_NUMOF
|
||||
#if defined(CPU_ATMEGA328P)
|
||||
#define TIMER_NUMOF (1U)
|
||||
#define TIMER_CHANNELS (2)
|
||||
|
||||
#define TIMER_0 MEGA_TIMER1
|
||||
#define TIMER_0_MASK &TIMSK1
|
||||
#define TIMER_0_FLAG &TIFR1
|
||||
#define TIMER_0_ISRA TIMER1_COMPA_vect
|
||||
#define TIMER_0_ISRB TIMER1_COMPB_vect
|
||||
#elif defined(CPU_ATMEGA1284P)
|
||||
#if defined(CPU_ATMEGA1284P)
|
||||
#define TIMER_NUMOF (2U)
|
||||
#define TIMER_CHANNELS (2)
|
||||
|
||||
|
44
cpu/atmega328p/include/default_timer_config.h
Normal file
44
cpu/atmega328p/include/default_timer_config.h
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (C) 2015 HAW Hamburg
|
||||
* 2016 Freie Universität Berlin
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup cpu_atmega328p
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Default timer configuration
|
||||
*
|
||||
* @author René Herthel <rene-herthel@outlook.de>
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifndef DEFAULT_TIMER_CONFIG_H
|
||||
#define DEFAULT_TIMER_CONFIG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef TIMER_NUMOF
|
||||
#define TIMER_NUMOF (1U)
|
||||
#define TIMER_CHANNELS (2)
|
||||
|
||||
#define TIMER_0 MEGA_TIMER1
|
||||
#define TIMER_0_MASK &TIMSK1
|
||||
#define TIMER_0_FLAG &TIFR1
|
||||
#define TIMER_0_ISRA TIMER1_COMPA_vect
|
||||
#define TIMER_0_ISRB TIMER1_COMPB_vect
|
||||
#endif /* TIMER_NUMOF */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* DEFAULT_TIMER_CONFIG_H */
|
||||
/** @} */
|
@ -68,5 +68,8 @@ enum {
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "periph_conf.h"
|
||||
#include "default_timer_config.h"
|
||||
|
||||
#endif /* PERIPH_CPU_H */
|
||||
/** @} */
|
||||
|
Loading…
Reference in New Issue
Block a user