src/ascension/utils.h

changeset 14
9dbfc0031887
parent 7
9dd76cbd6c90
child 58
26ebb2f1e6e6
equal deleted inserted replaced
13:f04a49b2aeee 14:9dbfc0031887
28 #ifndef ASCENSION_UTILS_H 28 #ifndef ASCENSION_UTILS_H
29 #define ASCENSION_UTILS_H 29 #define ASCENSION_UTILS_H
30 30
31 #include <stdbool.h> 31 #include <stdbool.h>
32 32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37
38 static inline bool asc_test_flag(unsigned int reg, int flag) { 33 static inline bool asc_test_flag(unsigned int reg, int flag) {
39 return (reg & flag) == flag; 34 return (reg & flag) == flag;
40 } 35 }
41 36
42 static inline void asc_set_flag(unsigned int *reg, int flag) { 37 static inline void asc_set_flag(unsigned int *reg, int flag) {
45 40
46 static inline void asc_clear_flag(unsigned int *reg, int flag) { 41 static inline void asc_clear_flag(unsigned int *reg, int flag) {
47 *reg &= ~flag; 42 *reg &= ~flag;
48 } 43 }
49 44
50 #ifdef __cplusplus
51 } // extern "C"
52 #endif
53
54 #endif /* ASCENSION_UTILS_H */ 45 #endif /* ASCENSION_UTILS_H */
55 46

mercurial