git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6646 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
9a9b70a61a
commit
9d9cbba7a6
|
@ -77,6 +77,16 @@
|
||||||
/* Module pre-compile time settings. */
|
/* Module pre-compile time settings. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enables an alternative timer implementation.
|
||||||
|
* @details Usually the port uses a timer interface defined in the file
|
||||||
|
* @p nilcore_timer.h, if this option is enabled then the file
|
||||||
|
* @p nilcore_timer_alt.h is included instead.
|
||||||
|
*/
|
||||||
|
#if !defined(PORT_USE_ALT_TIMER)
|
||||||
|
#define PORT_USE_ALT_TIMER FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Derived constants and error checks. */
|
/* Derived constants and error checks. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
@ -212,7 +222,11 @@ struct port_intctx {};
|
||||||
|
|
||||||
#if !defined(_FROM_ASM_)
|
#if !defined(_FROM_ASM_)
|
||||||
#if NIL_CFG_ST_TIMEDELTA > 0
|
#if NIL_CFG_ST_TIMEDELTA > 0
|
||||||
|
#if !PORT_USE_ALT_TIMER
|
||||||
#include "nilcore_timer.h"
|
#include "nilcore_timer.h"
|
||||||
|
#else /* PORT_USE_ALT_TIMER */
|
||||||
|
#include "nilcore_timer_alt.h"
|
||||||
|
#endif /* PORT_USE_ALT_TIMER */
|
||||||
#endif
|
#endif
|
||||||
#endif /* !defined(_FROM_ASM_) */
|
#endif /* !defined(_FROM_ASM_) */
|
||||||
|
|
||||||
|
|
|
@ -29,14 +29,6 @@
|
||||||
#ifndef _NILCORE_TIMER_H_
|
#ifndef _NILCORE_TIMER_H_
|
||||||
#define _NILCORE_TIMER_H_
|
#define _NILCORE_TIMER_H_
|
||||||
|
|
||||||
#if defined(PORT_DO_NOT_USE_ST)
|
|
||||||
/* If, for some reason, the use of the HAL-provided ST timer port interface
|
|
||||||
is not wanted, it is possible to provide the timer interface into a custom
|
|
||||||
module.*/
|
|
||||||
#include "nilcore_timer_ext.h"
|
|
||||||
|
|
||||||
#else /* !defined(PORT_DO_NOT_USE_ST) */
|
|
||||||
|
|
||||||
/* This is the only header in the HAL designed to be include-able alone.*/
|
/* This is the only header in the HAL designed to be include-able alone.*/
|
||||||
#include "st.h"
|
#include "st.h"
|
||||||
|
|
||||||
|
@ -60,6 +52,14 @@
|
||||||
/* Module macros. */
|
/* Module macros. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* External declarations. */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* Module inline functions. */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Starts the alarm.
|
* @brief Starts the alarm.
|
||||||
* @note Makes sure that no spurious alarms are triggered after
|
* @note Makes sure that no spurious alarms are triggered after
|
||||||
|
@ -69,9 +69,9 @@
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
#define port_timer_start_alarm(time) { \
|
static inline void port_timer_start_alarm(systime_t time) {
|
||||||
chDbgAssert(stIsAlarmActive() == false, "already active"); \
|
|
||||||
stStartAlarm(time); \
|
stStartAlarm(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -79,9 +79,9 @@
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
#define port_timer_stop_alarm() { \
|
static inline void port_timer_stop_alarm(void) {
|
||||||
chDbgAssert(stIsAlarmActive() != false, "not active"); \
|
|
||||||
stStopAlarm(); \
|
stStopAlarm();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -91,19 +91,11 @@
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
#define port_timer_set_alarm(time) { \
|
static inline void port_timer_set_alarm(systime_t time) {
|
||||||
chDbgAssert(stIsAlarmActive() != false, "not active"); \
|
|
||||||
stSetAlarm(time); \
|
stSetAlarm(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===========================================================================*/
|
|
||||||
/* External declarations. */
|
|
||||||
/*===========================================================================*/
|
|
||||||
|
|
||||||
/*===========================================================================*/
|
|
||||||
/* Module inline functions. */
|
|
||||||
/*===========================================================================*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the system time.
|
* @brief Returns the system time.
|
||||||
*
|
*
|
||||||
|
@ -128,8 +120,6 @@ static inline systime_t port_timer_get_alarm(void) {
|
||||||
return stGetAlarm();
|
return stGetAlarm();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !defined(PORT_DO_NOT_USE_ST) */
|
|
||||||
|
|
||||||
#endif /* _NILCORE_TIMER_H_ */
|
#endif /* _NILCORE_TIMER_H_ */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
Loading…
Reference in New Issue