PebbleOS
Loading...
Searching...
No Matches
Data Structures | Enumerations
Runlevel enable masks

Definitions used to implement runlevels. More...

Data Structures

struct  ServiceRunLevelSetting
 Runlevel control of one service. More...
 

Enumerations

enum  RunLevelBit
 Bit of each runlevel in an enable mask. More...
 

Detailed Description

Definitions used to implement runlevels.

Runlevels are defined in the runlevel.def X-macro file, from which RunLevel and RunLevelBit are built. A service's enable mask is the bitwise OR of the RunLevelBit of every runlevel it is enabled in; it is enabled in runlevel when (enable_mask & (1 << runlevel)) != 0.

The short R_<name> names keep masks readable. Only include this header from the files that define masks.

static const struct ServiceRunLevelSetting s_setting = {
.enable_mask = R_LowPower | R_FirmwareUpdate | R_Normal,
};
void light_allow(bool allowed)
Allow or disallow the backlight, e.g.
Runlevel control of one service.
Definition runlevel_impl.h:50
void(* set_enable_fn)(bool)
Enable or disable the service.
Definition runlevel_impl.h:52

Enumeration Type Documentation

◆ RunLevelBit

Bit of each runlevel in an enable mask.

One R_<name> value, (1 << number), per entry of runlevel.def.