-
Notifications
You must be signed in to change notification settings - Fork 0
/
Event.h
executable file
·51 lines (40 loc) · 1.02 KB
/
Event.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
******************************************************************************
* @file Event.h
* @author Paolo Sassi
* @date 22 January 2016
* @brief Contains the macros used to handle the event masks.
******************************************************************************
*/
#ifndef EVENT_H_
#define EVENT_H_
/**
* @addtogroup events
* @{
*/
typedef unsigned char Event;
typedef unsigned char Events;
/**
* @brief Sets an event in the event mask
* @param Event: The event to be set.
*/
#define SetEvt(Event) (evts |= Event)
/**
* @brief Resets an event in the event mask
* @param Event: The event to be reset.
*/
#define ClearEvt(Event) (evts &= !Event)
/**
* @brief Resets the event mask.
*/
#define ClearEvents() (evts = 0)
/**
* @brief Checks if an event has been set.
* @param Event: The event to be checked in the event mask.
*/
#define IsEvent(Event) ((unsigned char)(evts & Event))
/**
* @}
*/
extern Events evts;
#endif /* EVENT_H_ */