\r
OS_STD_END_3(OSServiceId_SetRelAlarm,AlarmId, Increment, Cycle);\r
}\r
+
+/**
+ * The system service occupies the alarm <AlarmID> element.
+ * When <start> ticks are reached, the task assigned to the alarm
+ *
+ * If the absolute value <start> is very close to the current counter
+ * value, the alarm may expire, and the task may become ready or
+ * the alarm-callback may be called before the system service
+ * returns to the user.
+ * If the absolute value <start> already was reached before the
+ * system call, the alarm shall only expire when the absolute value
+ * <start> is reached again, i.e. after the next overrun of the
+ * counter.
+ *
+ * If <cycle> is unequal zero, the alarm element is logged on again
+ * immediately after expiry with the relative value <cycle>.
+ *
+ * The alarm <AlarmID> shall not already be in use.
+ * To change values of alarms already in use the alarm shall be
+ * cancelled first.
+ *
+ * If the alarm is already in use, this call will be ignored and the
+ * error E_OS_STATE is returned.
+ *
+ * Allowed on task level and in ISR, but not in hook routines.
+ *
+ * @param AlarmId
+ * @param Start
+ * @param Cycle
+ * @return
+ */
\r
StatusType SetAbsAlarm(AlarmType AlarmId, TickType Start, TickType Cycle) {\r
\r
\r
Irq_Save(flags);\r
if( aPtr->active == 1 ) {\r
- rv = E_OS_STATE;\r
+ rv = E_OS_STATE;
+ Irq_Restore(flags);\r
goto err;\r
}\r
\r