Prusa MINI Firmware overview
debug_out.h
Go to the documentation of this file.
1 /**
2  * Marlin 3D Printer Firmware
3  * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4  *
5  * Based on Sprinter and grbl.
6  * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 #pragma once
23 
24 //
25 // Serial aliases for debugging.
26 // Include this header after defining DEBUG_OUT
27 // (or not) in a given .cpp file
28 //
29 
30 #undef DEBUG_PRINT_P
31 #undef DEBUG_ECHO_START
32 #undef DEBUG_ERROR_START
33 #undef DEBUG_CHAR
34 #undef DEBUG_ECHO
35 #undef DEBUG_ECHO_F
36 #undef DEBUG_ECHOLN
37 #undef DEBUG_ECHOPGM
38 #undef DEBUG_ECHOLNPGM
39 #undef DEBUG_ECHOPAIR
40 #undef DEBUG_ECHOPAIR_F
41 #undef DEBUG_ECHOLNPAIR
42 #undef DEBUG_ECHOLNPAIR_F
43 #undef DEBUG_ECHO_MSG
44 #undef DEBUG_ERROR_MSG
45 #undef DEBUG_EOL
46 #undef DEBUG_POS
47 #undef DEBUG_XYZ
48 #undef DEBUG_DELAY
49 
50 #if DEBUG_OUT
51  #define DEBUG_PRINT_P(P) serialprintPGM(P)
52  #define DEBUG_ECHO_START SERIAL_ECHO_START
53  #define DEBUG_ERROR_START SERIAL_ERROR_START
54  #define DEBUG_CHAR SERIAL_CHAR
55  #define DEBUG_ECHO SERIAL_ECHO
56  #define DEBUG_ECHO_F SERIAL_ECHO_F
57  #define DEBUG_ECHOLN SERIAL_ECHOLN
58  #define DEBUG_ECHOPGM SERIAL_ECHOPGM
59  #define DEBUG_ECHOLNPGM SERIAL_ECHOLNPGM
60  #define DEBUG_ECHOPAIR SERIAL_ECHOPAIR
61  #define DEBUG_ECHOPAIR_F SERIAL_ECHOPAIR_F
62  #define DEBUG_ECHOLNPAIR SERIAL_ECHOLNPAIR
63  #define DEBUG_ECHOLNPAIR_F SERIAL_ECHOLNPAIR_F
64  #define DEBUG_ECHO_MSG SERIAL_ECHO_MSG
65  #define DEBUG_ERROR_MSG SERIAL_ERROR_MSG
66  #define DEBUG_EOL SERIAL_EOL
67  #define DEBUG_POS SERIAL_POS
68  #define DEBUG_XYZ SERIAL_XYZ
69  #define DEBUG_DELAY(ms) serial_delay(ms)
70 #else
71  #define DEBUG_PRINT_P(P) NOOP
72  #define DEBUG_ECHO_START() NOOP
73  #define DEBUG_ERROR_START() NOOP
74  #define DEBUG_CHAR(...) NOOP
75  #define DEBUG_ECHO(...) NOOP
76  #define DEBUG_ECHO_F(...) NOOP
77  #define DEBUG_ECHOLN(...) NOOP
78  #define DEBUG_ECHOPGM(...) NOOP
79  #define DEBUG_ECHOLNPGM(...) NOOP
80  #define DEBUG_ECHOPAIR(...) NOOP
81  #define DEBUG_ECHOPAIR_F(...) NOOP
82  #define DEBUG_ECHOLNPAIR(...) NOOP
83  #define DEBUG_ECHOLNPAIR_F(...) NOOP
84  #define DEBUG_ECHO_MSG(...) NOOP
85  #define DEBUG_ERROR_MSG(...) NOOP
86  #define DEBUG_EOL() NOOP
87  #define DEBUG_POS(...) NOOP
88  #define DEBUG_XYZ(...) NOOP
89  #define DEBUG_DELAY(...) NOOP
90 #endif
91 
92 #undef DEBUG_OUT