EVE 1.0
mwork.h File Reference

Header file for the EVE millisecond-scale work scheduling. More...

#include <stdbool.h>
#include <stdint.h>
#include <lib/dlist.h>
#include <core/work.h>
#include <nrf52.h>
#include <hal/nrf_rtc.h>
Include dependency graph for mwork.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mwork_t
 

Macros

#define MWORK_COUNTER_WIDTH   (24)
 
#define MWORK_GUARD_WIDTH   (2)
 
#define MWORK_EFFECTIVE_WIDTH   (MWORK_COUNTER_WIDTH - MWORK_GUARD_WIDTH)
 
#define MWORK_TIME_MASK   ((1 << MWORK_EFFECTIVE_WIDTH) - 1)
 
#define MWORK_ROUND_TIME(tick)   ((tick) & MWORK_TIME_MASK)
 
#define MWORK_TIME_SPAN_IS_NEGATIVE(span)   (((span) & (1 << (MWORK_EFFECTIVE_WIDTH - 1))) != 0)
 
#define MWORK_MSEC(ms)    MS_TO_TICKS(ms)
 
#define MWORK_INIT(x, callback)
 
#define MWORK_INIT_TYPED(x, callback)   (struct mwork_t) MWORK_INIT(x, callback)
 
#define DECLARE_MWORK(x, callback)   struct mwork_t x = MWORK_INIT(x, callback)
 

Typedefs

typedef uint32_t mwork_time_t
 
typedef void(* mwork_cb_t) (struct mwork_t *work)
 

Functions

static mwork_time_t mwork_now ()
 
void mwork_schedule (struct mwork_t *work)
 
void mwork_cancel (struct mwork_t *work)
 
static bool mwork_pending (struct mwork_t *work)
 
void mwork_timer (void)
 

Detailed Description

Header file for the EVE millisecond-scale work scheduling.

Author
DT, Jetro AS

Definition in file mwork.h.