1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 05:15:25 +03:00

Cleaned up the debug code.

This commit is contained in:
Michael Keller 2021-09-07 02:10:26 +12:00
parent 1a97cbc9db
commit 96e9f73437
2 changed files with 1 additions and 27 deletions

View file

@ -24,29 +24,7 @@
extern int16_t debug[DEBUG16_VALUE_COUNT];
extern uint8_t debugMode;
#define DEBUG_SET(mode, index, value) {if (debugMode == (mode)) {debug[(index)] = (value);}}
#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
#define DEBUG_SET(mode, index, value) do { if (debugMode == (mode)) { debug[(index)] = (value); } } while (0)
typedef enum {
DEBUG_NONE,