# OS_SetPeriodicAlarm

## C Specification

      #include <nitro/os.h>

      void OS_SetPeriodicAlarm(
                      OSAlarm*        alarm ,
                      OSTick          start ,
                      OSTick          period ,
                      OSAlarmHandler  handler ,
                      void*           arg );

## Description

Sets a periodic alarm

The alarm handler, `handler`, is first called when the tick value equals `start`. `handler` is then subsequently called after each tick `period` count. `handler` is a `OSAlarmHandler` type function defined by :

`typedef void (*OSAlarmHandler)( void*);`

When `handler` is called, it takes `arg` as an argument.

One tick count unit is 1/64 of the hardware system clock.

If `alarm` specifies the pointer to the `OSAlarm` structure which the alarm has set, `OS_Panic` stops the alarm.

`OS_CancelAlarm()` is used to stop the alarm.

## Arguments

`alarm` | Pointer to the alarm structure that sets the alarm
`start` | Tick count for first actuation of the alarm (calling the handler) (This is not a relative value from the current time, but an absolute value.)
`period` | Interval at which the alarm will be activated
`handler` | Alarm handler
`arg` | Argument used when the alarm handler is called

## Return Values

None

## See Also

`OS_InitAlarm`, `OS_CreateAlarm`, `OS_SetAlarm`, `OS_CancelAlarm`, `OS_*SecondsToTick`

## Revision History

08/30/2004 Added the description that the alarm structure that has been set is not usable.
02/25/2004 Changed `systemClock` to `tick`
02/04/2004 Initial Version