1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys: xtimer: replace XTIMER_MASK with XTIMER_WIDTH in board config

This commit is contained in:
Kaspar Schleiser 2016-05-06 22:10:52 +02:00 committed by Joakim Nohlgård
parent e31f034bb1
commit 46bd2f45d9
18 changed files with 43 additions and 30 deletions

View File

@ -33,7 +33,7 @@
*/
#define XTIMER (0)
#define XTIMER_CHAN (0)
#define XTIMER_MASK (0xff000000)
#define XTIMER_WIDTH (24)
#define XTIMER_BACKOFF (40)
/** @} */

View File

@ -56,7 +56,7 @@ extern "C" {
* @brief xtimer configuration values
* @{
*/
#define XTIMER_MASK (0xffff0000)
#define XTIMER_WIDTH (16)
#define XTIMER_SHIFT (2)
#define XTIMER_BACKOFF (40)
/** @} */

View File

@ -31,7 +31,7 @@ extern "C" {
* @brief Xtimer configuration
* @{
*/
#define XTIMER_MASK (0xFFFF0000)
#define XTIMER_WIDTH (16)
/** @} */
/**

View File

@ -40,7 +40,7 @@ extern "C" {
*/
#define XTIMER (0)
#define XTIMER_CHAN (0)
#define XTIMER_MASK (0xffff0000)
#define XTIMER_WIDTH (16)
/** @} */
/**

View File

@ -36,7 +36,7 @@ extern "C" {
/**
* @name Tell the xtimer that we use a 16-bit peripheral timer
*/
#define XTIMER_MASK (0xffff0000)
#define XTIMER_WIDTH (16)
/**
* @name Define the interface to the AT86RF231 radio

View File

@ -46,7 +46,7 @@ extern "C" {
/**
* @name Tell the xtimer that we use a 16-bit peripheral timer
*/
#define XTIMER_MASK (0xffff0000)
#define XTIMER_WIDTH (16)
/**
* @name Define the interface to the AT86RF231 radio

View File

@ -39,7 +39,7 @@ extern "C" {
*/
#define XTIMER (0)
#define XTIMER_CHAN (0)
#define XTIMER_MASK (0xffff0000)
#define XTIMER_WIDTH (16)
#define XTIMER_BACKOFF (40)
/** @} */

View File

@ -34,7 +34,7 @@ extern "C" {
*/
#define XTIMER (0)
#define XTIMER_CHAN (0)
#define XTIMER_MASK (0xff000000)
#define XTIMER_WIDTH (24)
#define XTIMER_BACKOFF (40)
/** @} */

View File

@ -35,7 +35,7 @@ extern "C" {
/**
* @name xtimer configuration
*/
#define XTIMER_MASK (0xffff0000)
#define XTIMER_WIDTH (16)
#define XTIMER_BACKOFF 5
/** @} */

View File

@ -34,7 +34,7 @@ extern "C" {
*/
#define XTIMER (0)
#define XTIMER_CHAN (0)
#define XTIMER_MASK (0xff000000)
#define XTIMER_WIDTH (24)
#define XTIMER_BACKOFF (40)
/** @} */

View File

@ -34,7 +34,7 @@ extern "C" {
*/
#define XTIMER (0)
#define XTIMER_CHAN (0)
#define XTIMER_MASK (0xff000000)
#define XTIMER_WIDTH (24)
#define XTIMER_BACKOFF (40)
/** @} */

View File

@ -38,7 +38,7 @@
/**
* @name Tell the xtimer that we use a 16-bit peripheral timer
*/
#define XTIMER_MASK (0xffff0000)
#define XTIMER_WIDTH (16)
/**
* @brief Macros for controlling the on-board LEDs

View File

@ -56,7 +56,7 @@ extern "C" {
*/
#define XTIMER (0)
#define XTIMER_CHAN (0)
#define XTIMER_MASK (0xffff0000)
#define XTIMER_WIDTH (16)
#define XTIMER_BACKOFF (40)
/** @} */

View File

@ -154,7 +154,7 @@ extern "C" {
* @brief xtimer configuration values
* @{
*/
#define XTIMER_MASK (0xffff0000)
#define XTIMER_WIDTH (16)
#define XTIMER_SHIFT (4)
#define XTIMER_BACKOFF (40)
#define XTIMER_TICKS_INIT (921600ul)

View File

@ -39,7 +39,7 @@ extern "C" {
*/
#define XTIMER (0)
#define XTIMER_CHAN (0)
#define XTIMER_MASK (0xffff0000)
#define XTIMER_WIDTH (16)
#define XTIMER_BACKOFF (40)
/** @} */

View File

@ -33,7 +33,7 @@ extern "C" {
*/
#define XTIMER (0)
#define XTIMER_CHAN (0)
#define XTIMER_MASK (0xff000000)
#define XTIMER_WIDTH (24)
#define XTIMER_BACKOFF (40)
/** @} */

View File

@ -50,7 +50,7 @@ extern "C" {
*/
#define XTIMER (0)
#define XTIMER_CHAN (0)
#define XTIMER_MASK (0xffff0000)
#define XTIMER_WIDTH (16)
#define XTIMER_BACKOFF (40)
/** @} */

View File

@ -357,26 +357,38 @@ int xtimer_msg_receive_timeout64(msg_t *msg, uint64_t us);
#define XTIMER_TICKS_TO_USEC(value) ( (value) << XTIMER_SHIFT )
#endif
/**
* @brief set xtimer default timer configuration
* @{
/*
* Default xtimer configuration
*/
#ifndef XTIMER
#define XTIMER (0)
/**
* @brief Underlying hardware timer device to assign to xtimer
*/
#define XTIMER TIMER_DEV(0)
/**
* @brief Underlying hardware timer channel to assign to xtimer
*/
#define XTIMER_CHAN (0)
#if TIMER_0_MAX_VALUE == 0xffffff
#define XTIMER_MASK 0xff000000
#elif TIMER_0_MAX_VALUE == 0xffff
#define XTIMER_MASK 0xffff0000
#if (TIMER_0_MAX_VALUE) == 0xfffffful
#define XTIMER_WIDTH (24)
#elif (TIMER_0_MAX_VALUE) == 0xffff
#define XTIMER_WIDTH (16)
#endif
#endif
#ifndef XTIMER_WIDTH
/**
* @}
* @brief xtimer timer width
*
* This value specifies the width (in bits) of the hardware timer used by xtimer.
* Default is 32.
*/
#define XTIMER_WIDTH (32)
#endif
#ifndef XTIMER_MASK
#if XTIMER_WIDTH != 32
/**
* @brief xtimer timer mask
*
@ -384,12 +396,13 @@ int xtimer_msg_receive_timeout64(msg_t *msg, uint64_t us);
* counts to, e.g., 0xffffffff & ~TIMER_MAXVALUE.
*
* For a 16bit timer, the mask would be 0xFFFF0000, for a 24bit timer, the mask
* would be 0xFF000000. Don't set this for 32bit timers.
*
* This is supposed to be defined per-device in e.g., periph_conf.h.
* would be 0xFF000000.
*/
#define XTIMER_MASK ((0xffffffff >> XTIMER_WIDTH) << XTIMER_WIDTH)
#else
#define XTIMER_MASK (0)
#endif
#define XTIMER_MASK_SHIFTED XTIMER_TICKS_TO_USEC(XTIMER_MASK)
#if XTIMER_MASK