|
| 1 | +/* |
| 2 | + * Core debug macros header for the Raspberry Pi Pico RP2040 |
| 3 | + * |
| 4 | + * Copyright (c) 2021 Earle F. Philhower, III <[email protected]> |
| 5 | + * |
| 6 | + * This library is free software; you can redistribute it and/or |
| 7 | + * modify it under the terms of the GNU Lesser General Public |
| 8 | + * License as published by the Free Software Foundation; either |
| 9 | + * version 2.1 of the License, or (at your option) any later version. |
| 10 | + * |
| 11 | + * This library is distributed in the hope that it will be useful, |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | + * Lesser General Public License for more details. |
| 15 | + * |
| 16 | + * You should have received a copy of the GNU Lesser General Public |
| 17 | + * License along with this library; if not, write to the Free Software |
| 18 | + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | + */ |
| 20 | + |
| 21 | +#if !defined(DEBUG_RP2040_PORT) |
| 22 | + #define DEBUGV(...) do { } while(0) |
| 23 | + #define DEBUGCORE(...) do { } while(0) |
| 24 | + #define DEBUGWIRE(...) do { } while(0) |
| 25 | + #define DEBUGSPI(...) do { } while(0) |
| 26 | +#else |
| 27 | + #define DEBUGV(fmt, ...) do { DEBUG_RP2040_PORT.printf(fmt, ## __VA_ARGS__); DEBUG_RP2040_PORT.flush(); } while (0) |
| 28 | + |
| 29 | + #if defined(DEBUG_RP2040_CORE) |
| 30 | + #define DEBUGCORE(fmt, ...) do { DEBUG_RP2040_PORT.printf(fmt, ## __VA_ARGS__); DEBUG_RP2040_PORT.flush(); } while (0) |
| 31 | + #else |
| 32 | + #define DEBUGCORE(...) do { } while(0) |
| 33 | + #endif |
| 34 | + |
| 35 | + #if defined(DEBUG_RP2040_WIRE) |
| 36 | + #define DEBUGWIRE(fmt, ...) do { DEBUG_RP2040_PORT.printf(fmt, ## __VA_ARGS__); DEBUG_RP2040_PORT.flush(); } while (0) |
| 37 | + #else |
| 38 | + #define DEBUGWIRE(...) do { } while(0) |
| 39 | + #endif |
| 40 | + |
| 41 | + #if defined(DEBUG_RP2040_SPI) |
| 42 | + #define DEBUGSPI(fmt, ...) do { DEBUG_RP2040_PORT.printf(fmt, ## __VA_ARGS__); DEBUG_RP2040_PORT.flush(); } while (0) |
| 43 | + #else |
| 44 | + #define DEBUGSPI(...) do { } while(0) |
| 45 | + #endif |
| 46 | +#endif |
0 commit comments