• R/O
  • SSH
  • HTTPS

chibios: Commit


Commit MetaInfo

Revision15635 (tree)
Time2022-05-24 22:37:19
Authorgdisirio

Log Message

(empty log message)

Change Summary

Incremental Difference

--- trunk/os/sb/host/sbvrq.c (revision 15634)
+++ trunk/os/sb/host/sbvrq.c (revision 15635)
@@ -246,9 +246,9 @@
246246 void sb_api_vrq_set_alarm(struct port_extctx *ectxp) {
247247 sb_class_t *sbp = (sb_class_t *)chThdGetSelfX()->ctx.syscall.p;
248248 sysinterval_t interval = (sysinterval_t )ectxp->r0;
249- bool continuous = (bool)ectxp->r1;
249+ bool reload = (bool)ectxp->r1;
250250
251- if (continuous) {
251+ if (reload) {
252252 chVTSetContinuous(&sbp->alarm_vt, interval, delay_cb, (void *)sbp);
253253 }
254254 else {
--- trunk/os/sb/user/sbuser.h (revision 15634)
+++ trunk/os/sb/user/sbuser.h (revision 15635)
@@ -844,6 +844,31 @@
844844 }
845845
846846 /**
847+ * @brief Sets an alarm.
848+ * @note On alarm a VRQ is triggered, the VRQ number is hard-coded in the
849+ * sandbox configuration, default is zero.
850+ *
851+ * @param[in] interval the interval in system ticks
852+ * @param[in] reload specifies a periodic alarm
853+ *
854+ * @api
855+ */
856+static inline void sbSetAlarm(sysinterval_t interval, bool reload) {
857+
858+ __syscall2r(245, (uint32_t)interval, (uint32_t)reload);
859+}
860+
861+/**
862+ * @brief Resets an alarm.
863+ *
864+ * @api
865+ */
866+static inline void sbResetAlarm(void) {
867+
868+ __syscall0(246);
869+}
870+
871+/**
847872 * @brief VRQ @p wait pseudo-instruction.
848873 *
849874 * @api
Show on old repository browser