IntrOS
Loading...
Searching...
No Matches
Once flag

once flags (one-time call of a function) More...

Macros

#define OS_ONE(one)
 define and initialize a once flag object
#define static_ONE(one)
 static alias of OS_ONE()
#define ONE_INIT()
 create and initialize a once flag object
#define ONE_CREATE()
 create and initialize a once flag object
#define ONE_NEW   ONE_CREATE
 alias of ONE_CREATE()

Typedefs

typedef uint_fast8_t one_t
 once flag

Functions

void one_init (one_t *one)
 initialize a once flag object
void one_call (one_t *one, fun_t *fun)
 try to execute given function

Detailed Description

once flags (one-time call of a function)

Macro Definition Documentation

◆ OS_ONE

#define OS_ONE ( one)
Value:
one_t one[] = { _ONE_INIT() }
uint_fast8_t one_t
once flag
Definition osonceflag.h:48

define and initialize a once flag object

Parameters
onename of a pointer to once flag object

◆ static_ONE

#define static_ONE ( one)
Value:
static one_t one[] = { _ONE_INIT() }

static alias of OS_ONE()

◆ ONE_INIT

#define ONE_INIT ( )
Value:
_ONE_INIT()

create and initialize a once flag object

Returns
once flag object
Note
use only in 'C' code

◆ ONE_CREATE

#define ONE_CREATE ( )
Value:
{ ONE_INIT () }
#define ONE_INIT()
create and initialize a once flag object
Definition osonceflag.h:104

create and initialize a once flag object

Returns
once flag object as array (id)
Note
use only in 'C' code

Function Documentation

◆ one_init()

void one_init ( one_t * one)
inline

initialize a once flag object

Parameters
onepointer to once flag object

◆ one_call()

void one_call ( one_t * one,
fun_t * fun )
inline

try to execute given function

     if the once flag has been previously set, the function is not executed
Parameters
onepointer to once flag object
funpointer to once function
Note
the once flag is set before the function is called, so another caller (another task or a timer callback, when the function gives up the processor, or an interrupt handler) does not wait for the completion of the function