2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
23 #define DEBUG16_VALUE_COUNT 4
24 extern int16_t debug
[DEBUG16_VALUE_COUNT
];
25 extern uint8_t debugMode
;
27 #define DEBUG_SET(mode, index, value) {if (debugMode == (mode)) {debug[(index)] = (value);}}
29 #define DEBUG_SECTION_TIMES
31 #ifdef DEBUG_SECTION_TIMES
32 extern uint32_t sectionTimes
[2][4];
34 #define TIME_SECTION_BEGIN(index) { \
35 extern uint32_t sectionTimes[2][4]; \
36 sectionTimes[0][index] = micros(); \
39 #define TIME_SECTION_END(index) { \
40 extern uint32_t sectionTimes[2][4]; \
41 sectionTimes[1][index] = micros(); \
42 debug[index] = sectionTimes[1][index] - sectionTimes[0][index]; \
46 #define TIME_SECTION_BEGIN(index) {}
47 #define TIME_SECTION_END(index) {}
59 DEBUG_RC_INTERPOLATION
,
74 DEBUG_DUAL_GYRO_COMBINE
,
77 DEBUG_MAX7456_SPICLOCK
,
81 DEBUG_RANGEFINDER_QUALITY
,
84 DEBUG_RUNAWAY_TAKEOFF
,
97 extern const char * const debugModeNames
[DEBUG_COUNT
];