(empty log message)
@@ -246,9 +246,9 @@ | ||
246 | 246 | void sb_api_vrq_set_alarm(struct port_extctx *ectxp) { |
247 | 247 | sb_class_t *sbp = (sb_class_t *)chThdGetSelfX()->ctx.syscall.p; |
248 | 248 | sysinterval_t interval = (sysinterval_t )ectxp->r0; |
249 | - bool continuous = (bool)ectxp->r1; | |
249 | + bool reload = (bool)ectxp->r1; | |
250 | 250 | |
251 | - if (continuous) { | |
251 | + if (reload) { | |
252 | 252 | chVTSetContinuous(&sbp->alarm_vt, interval, delay_cb, (void *)sbp); |
253 | 253 | } |
254 | 254 | else { |
@@ -844,6 +844,31 @@ | ||
844 | 844 | } |
845 | 845 | |
846 | 846 | /** |
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 | +/** | |
847 | 872 | * @brief VRQ @p wait pseudo-instruction. |
848 | 873 | * |
849 | 874 | * @api |