2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
26 #define DEBUG32_VALUE_COUNT 8
27 extern int32_t debug
[DEBUG32_VALUE_COUNT
];
28 extern uint8_t debugMode
;
30 #define DEBUG_SET(mode, index, value) {if (debugMode == (mode)) {debug[(index)] = (value);}}
32 #define DEBUG_SECTION_TIMES
34 #ifdef DEBUG_SECTION_TIMES
35 #include "common/time.h"
36 extern timeUs_t sectionTimes
[2][4];
38 #define TIME_SECTION_BEGIN(index) { \
39 extern timeUs_t sectionTimes[2][4]; \
40 sectionTimes[0][index] = micros(); \
43 #define TIME_SECTION_END(index) { \
44 extern timeUs_t sectionTimes[2][4]; \
45 sectionTimes[1][index] = micros(); \
46 debug[index] = sectionTimes[1][index] - sectionTimes[0][index]; \
50 #define TIME_SECTION_BEGIN(index) {}
51 #define TIME_SECTION_END(index) {}
61 DEBUG_SAG_COMP_VOLTAGE
,
64 DEBUG_REM_FLIGHT_TIME
,
69 DEBUG_DYNAMIC_GYRO_LPF
,
77 DEBUG_ADAPTIVE_FILTER
,
81 DEBUG_COUNT
// also update debugModeNames in cli.c