Difference between revisions of "MansOS Alarm"

From DiLab
Jump to: navigation, search
(New page: __NOTOC__ NOTE: This feature is not implemented as described currently. Older interface version exists. '''Include file:''' #include "alarm.h" == Data types == '''AlarmId_t''' - alarm ...)
 
(izeditēju laukā alarmu dokumentaciju, kas neatbilst esošajam kodam)
 
(20 intermediate revisions by one other user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{MansOS_ref_navbar|Alarm}}
NOTE: This feature is not implemented as described currently. Older interface version exists.
----


Alarms are used to execute some code after a certain time period, possibly repeatedly.
'''Include file:'''
#include "alarm.h"


The more timers you run, the less precise they may be due to the possibility for several of them to fire at the same time. Only one callback function will be executed immediately, the rest of them will wait for the previous callback to finish and thus will be delayed.
== Data types ==


'''Declared in:'''
'''AlarmId_t''' - alarm handle for identifying the alarm when calling the alarm procedures.
#include "alarm.h"


== Functions ==


----
{| border=0 cellspacing=0 cellpadding=4
{{MansOS_ref_navbar|Alarm}}
! Prototype !! Description
|-
|
AlarmId_t alarmNew();
| Create a new alarm. Returns the ID for the new alarm.
|-
|
void alarmSet( AlarmId_t id, AlarmType_t, uint delayInMs );
| Set the alarm type and time period. Do not start the alarm. Stop the alarm if it is already running.
|-
|
void alarmStart( AlarmId_t id );
| Start the alarm. Resets the alarm if it was already running.
|-
|
void alarmStop( AlarmId_t id );
| Stop the alarm. You may start this alarm later again.
|-
|}

Latest revision as of 15:49, 28 September 2011

MansOS --> Reference --> Alarm :: #Basic :: #Advanced :: #Example

Alarms are used to execute some code after a certain time period, possibly repeatedly.

The more timers you run, the less precise they may be due to the possibility for several of them to fire at the same time. Only one callback function will be executed immediately, the rest of them will wait for the previous callback to finish and thus will be delayed.

Declared in:

#include "alarm.h"

MansOS --> Reference --> Alarm :: #Basic :: #Advanced :: #Example