git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15635 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
3e910146e9
commit
ae718c401a
|
@ -246,9 +246,9 @@ void sbVRQTriggerFromISR(sb_class_t *sbp, sb_vrqmask_t vmask) {
|
|||
void sb_api_vrq_set_alarm(struct port_extctx *ectxp) {
|
||||
sb_class_t *sbp = (sb_class_t *)chThdGetSelfX()->ctx.syscall.p;
|
||||
sysinterval_t interval = (sysinterval_t )ectxp->r0;
|
||||
bool continuous = (bool)ectxp->r1;
|
||||
bool reload = (bool)ectxp->r1;
|
||||
|
||||
if (continuous) {
|
||||
if (reload) {
|
||||
chVTSetContinuous(&sbp->alarm_vt, interval, delay_cb, (void *)sbp);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -843,6 +843,31 @@ static inline void sbSleepMicroseconds(time_usecs_t usecs) {
|
|||
sbSleep(sbTimeUS2I(usecs));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets an alarm.
|
||||
* @note On alarm a VRQ is triggered, the VRQ number is hard-coded in the
|
||||
* sandbox configuration, default is zero.
|
||||
*
|
||||
* @param[in] interval the interval in system ticks
|
||||
* @param[in] reload specifies a periodic alarm
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
static inline void sbSetAlarm(sysinterval_t interval, bool reload) {
|
||||
|
||||
__syscall2r(245, (uint32_t)interval, (uint32_t)reload);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Resets an alarm.
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
static inline void sbResetAlarm(void) {
|
||||
|
||||
__syscall0(246);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief VRQ @p wait pseudo-instruction.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue