git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6634 35acf78f-673a-0410-8e92-d51de3d6d3f4
parent
841ab0b70e
commit
151ca1d309
|
@ -68,50 +68,6 @@
|
|||
*/
|
||||
#define stGetCounter() st_lld_get_counter()
|
||||
|
||||
/**
|
||||
* @brief Starts the alarm.
|
||||
* @note Makes sure that no spurious alarms are triggered after
|
||||
* this call.
|
||||
* @note This functionality is only available in free running mode, the
|
||||
* behaviour in periodic mode is undefined.
|
||||
*
|
||||
* @param[in] time the time to be set for the first alarm
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
#define stStartAlarm(time) st_lld_start_alarm(time)
|
||||
|
||||
/**
|
||||
* @brief Stops the alarm interrupt.
|
||||
* @note This functionality is only available in free running mode, the
|
||||
* behaviour in periodic mode is undefined.
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
#define stStopAlarm() st_lld_stop_alarm()
|
||||
|
||||
/**
|
||||
* @brief Sets the alarm time.
|
||||
* @note This functionality is only available in free running mode, the
|
||||
* behaviour in periodic mode is undefined.
|
||||
*
|
||||
* @param[in] time the time to be set for the next alarm
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
#define stSetAlarm(time) st_lld_set_alarm(time)
|
||||
|
||||
/**
|
||||
* @brief Returns the current alarm time.
|
||||
* @note This functionality is only available in free running mode, the
|
||||
* behaviour in periodic mode is undefined.
|
||||
*
|
||||
* @return The currently set alarm time.
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
#define stGetAlarm() st_lld_get_alarm()
|
||||
|
||||
/**
|
||||
* @brief Determines if the alarm is active.
|
||||
*
|
||||
|
@ -132,6 +88,10 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
void stInit(void);
|
||||
void stStartAlarm(systime_t time);
|
||||
void stStopAlarm(void);
|
||||
void stSetAlarm(systime_t time);
|
||||
systime_t stGetAlarm(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -66,6 +66,71 @@ void stInit(void) {
|
|||
st_lld_init();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Starts the alarm.
|
||||
* @note Makes sure that no spurious alarms are triggered after
|
||||
* this call.
|
||||
* @note This functionality is only available in free running mode, the
|
||||
* behavior in periodic mode is undefined.
|
||||
*
|
||||
* @param[in] time the time to be set for the first alarm
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void stStartAlarm(systime_t time) {
|
||||
|
||||
osalDbgAssert(stIsAlarmActive() == false, "already active");
|
||||
|
||||
st_lld_start_alarm(time);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Stops the alarm interrupt.
|
||||
* @note This functionality is only available in free running mode, the
|
||||
* behavior in periodic mode is undefined.
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void stStopAlarm(void) {
|
||||
|
||||
osalDbgAssert(stIsAlarmActive() != false, "not active");
|
||||
|
||||
st_lld_stop_alarm();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets the alarm time.
|
||||
* @note This functionality is only available in free running mode, the
|
||||
* behavior in periodic mode is undefined.
|
||||
*
|
||||
* @param[in] time the time to be set for the next alarm
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void stSetAlarm(systime_t time) {
|
||||
|
||||
osalDbgAssert(stIsAlarmActive() != false, "not active");
|
||||
|
||||
st_lld_set_alarm(time);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the current alarm time.
|
||||
* @note This functionality is only available in free running mode, the
|
||||
* behavior in periodic mode is undefined.
|
||||
*
|
||||
* @return The currently set alarm time.
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
systime_t stGetAlarm(void) {
|
||||
|
||||
osalDbgAssert(stIsAlarmActive() != false, "not active");
|
||||
|
||||
return st_lld_get_alarm();
|
||||
}
|
||||
|
||||
#endif /* OSAL_ST_MODE != OSAL_ST_MODE_NONE */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -60,6 +60,14 @@
|
|||
/* Module macros. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/*===========================================================================*/
|
||||
/* External declarations. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module inline functions. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Starts the alarm.
|
||||
* @note Makes sure that no spurious alarms are triggered after
|
||||
|
@ -69,9 +77,9 @@
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
#define port_timer_start_alarm(time) { \
|
||||
chDbgAssert(stIsAlarmActive() == false, "already active"); \
|
||||
stStartAlarm(time); \
|
||||
static inline void port_timer_start_alarm(systime_t time) {
|
||||
|
||||
stStartAlarm(time);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -79,9 +87,9 @@
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
#define port_timer_stop_alarm() { \
|
||||
chDbgAssert(stIsAlarmActive() != false, "not active"); \
|
||||
stStopAlarm(); \
|
||||
static inline void port_timer_stop_alarm(void) {
|
||||
|
||||
stStopAlarm();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -91,19 +99,11 @@
|
|||
*
|
||||
* @notapi
|
||||
*/
|
||||
#define port_timer_set_alarm(time) { \
|
||||
chDbgAssert(stIsAlarmActive() != false, "not active"); \
|
||||
stSetAlarm(time); \
|
||||
static inline void port_timer_set_alarm(systime_t time) {
|
||||
|
||||
stSetAlarm(time);
|
||||
}
|
||||
|
||||
/*===========================================================================*/
|
||||
/* External declarations. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Module inline functions. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Returns the system time.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue