Command disabled: backlink
 
Available Languages?:

OSA : OS_Stimer_Free

OS_Stimer_Free (stimer_id)

Not allowed in interruptService uses system timer

Free static timer by its ID.

Number of static timers OS_STIMERS (1..32) must be specified in OSAcfg.h. Size of static timers is set by OS_STIMER_SIZE constant

Constant OS_STIMERS_ENABLE_ALLOCATION should be defined in OSAcfg.h

Call allowed:

Not in interrupt

Parameters:

stimer_id Static timer identifier. Number and size of static timers are set in OSAcfg.h with OS_STIMERS and OS_STIMER_SIZE constants

Returns:

nothing

Example:

void Task (void)
{
    static unsigned char stimer_id;
    for (;;) {
        /*...*/
        OS_Wait(OS_Stimer_Found());    // Wait for free timer
        OS_Stimer_Alloc(stimer_id);    // Allocate it for use
        OS_Stimer_Run(stimer_id, 100); // Now we can use static timer through variable
 
        do {
           // ...
        } while (!OS_Stimer_Check(stimer_id));
 
        OS_Stimer_Free(stimer_id);    // Make timer free
        /*...*/
    }
}

See also

 
en/osa/ref/allservices/os_stimer_free.txt · Last modified: 07.10.2010 13:57 (external edit)
 
Creative Commons License Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki