mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 21:35:44 +03:00
Cleaned up the debug code.
This commit is contained in:
parent
1a97cbc9db
commit
96e9f73437
2 changed files with 1 additions and 27 deletions
|
@ -27,10 +27,6 @@
|
||||||
int16_t debug[DEBUG16_VALUE_COUNT];
|
int16_t debug[DEBUG16_VALUE_COUNT];
|
||||||
uint8_t debugMode;
|
uint8_t debugMode;
|
||||||
|
|
||||||
#ifdef DEBUG_SECTION_TIMES
|
|
||||||
uint32_t sectionTimes[2][4];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Please ensure that these names are aligned with the enum values defined in 'debug.h' - for OSD be sure the name is unique with 12 chars.
|
// Please ensure that these names are aligned with the enum values defined in 'debug.h' - for OSD be sure the name is unique with 12 chars.
|
||||||
const char * const debugModeNames[DEBUG_COUNT] = {
|
const char * const debugModeNames[DEBUG_COUNT] = {
|
||||||
"NONE",
|
"NONE",
|
||||||
|
|
|
@ -24,29 +24,7 @@
|
||||||
extern int16_t debug[DEBUG16_VALUE_COUNT];
|
extern int16_t debug[DEBUG16_VALUE_COUNT];
|
||||||
extern uint8_t debugMode;
|
extern uint8_t debugMode;
|
||||||
|
|
||||||
#define DEBUG_SET(mode, index, value) {if (debugMode == (mode)) {debug[(index)] = (value);}}
|
#define DEBUG_SET(mode, index, value) do { if (debugMode == (mode)) { debug[(index)] = (value); } } while (0)
|
||||||
|
|
||||||
#define DEBUG_SECTION_TIMES
|
|
||||||
|
|
||||||
#ifdef DEBUG_SECTION_TIMES
|
|
||||||
extern uint32_t sectionTimes[2][4];
|
|
||||||
|
|
||||||
#define TIME_SECTION_BEGIN(index) { \
|
|
||||||
extern uint32_t sectionTimes[2][4]; \
|
|
||||||
sectionTimes[0][index] = micros(); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define TIME_SECTION_END(index) { \
|
|
||||||
extern uint32_t sectionTimes[2][4]; \
|
|
||||||
sectionTimes[1][index] = micros(); \
|
|
||||||
debug[index] = sectionTimes[1][index] - sectionTimes[0][index]; \
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define TIME_SECTION_BEGIN(index) {}
|
|
||||||
#define TIME_SECTION_END(index) {}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
DEBUG_NONE,
|
DEBUG_NONE,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue