mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 04:15:44 +03:00
Move utility macros to common/utils.h
This commit is contained in:
parent
b568b9c59d
commit
e56f46a756
2 changed files with 7 additions and 5 deletions
|
@ -26,6 +26,7 @@
|
||||||
#include "common/maths.h"
|
#include "common/maths.h"
|
||||||
#include "common/axis.h"
|
#include "common/axis.h"
|
||||||
#include "common/color.h"
|
#include "common/color.h"
|
||||||
|
#include "common/utils.h"
|
||||||
|
|
||||||
#include "drivers/gpio.h"
|
#include "drivers/gpio.h"
|
||||||
#include "drivers/sensor.h"
|
#include "drivers/sensor.h"
|
||||||
|
@ -86,11 +87,6 @@
|
||||||
typedef char assert_failed_ ## name [(condition) ? 1 : -1 ]
|
typedef char assert_failed_ ## name [(condition) ? 1 : -1 ]
|
||||||
|
|
||||||
// Some macros to make writing FLIGHT_LOG_FIELD_* constants shorter:
|
// Some macros to make writing FLIGHT_LOG_FIELD_* constants shorter:
|
||||||
#define STR_HELPER(x) #x
|
|
||||||
#define STR(x) STR_HELPER(x)
|
|
||||||
|
|
||||||
#define CONCAT_HELPER(x,y) x ## y
|
|
||||||
#define CONCAT(x,y) CONCAT_HELPER(x, y)
|
|
||||||
|
|
||||||
#define PREDICT(x) CONCAT(FLIGHT_LOG_FIELD_PREDICTOR_, x)
|
#define PREDICT(x) CONCAT(FLIGHT_LOG_FIELD_PREDICTOR_, x)
|
||||||
#define ENCODING(x) CONCAT(FLIGHT_LOG_FIELD_ENCODING_, x)
|
#define ENCODING(x) CONCAT(FLIGHT_LOG_FIELD_ENCODING_, x)
|
||||||
|
|
|
@ -21,6 +21,12 @@
|
||||||
|
|
||||||
#define ARRAYLEN(x) (sizeof(x) / sizeof((x)[0]))
|
#define ARRAYLEN(x) (sizeof(x) / sizeof((x)[0]))
|
||||||
|
|
||||||
|
#define CONCAT_HELPER(x,y) x ## y
|
||||||
|
#define CONCAT(x,y) CONCAT_HELPER(x, y)
|
||||||
|
|
||||||
|
#define STR_HELPER(x) #x
|
||||||
|
#define STR(x) STR_HELPER(x)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
http://resnet.uoregon.edu/~gurney_j/jmpc/bitwise.html
|
http://resnet.uoregon.edu/~gurney_j/jmpc/bitwise.html
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue