dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_debug.h
Go to the documentation of this file.
1 
15 /*
16  * This program is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation; either version 3 of the License, or
19  * (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful, but
22  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
23  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24  * for more details.
25  *
26  * You should have received a copy of the GNU General Public License along
27  * with this program; if not, see <http://www.gnu.org/licenses/>
28  */
29 
30 #ifndef PIOS_DEBUG_H
31 #define PIOS_DEBUG_H
32 
33 extern const char *PIOS_DEBUG_AssertMsg;
34 
35 #ifndef PIOS_NO_HW
36 #include <pios_tim_priv.h>
37 
38 void PIOS_DEBUG_Init(const struct pios_tim_channel * channels, uint8_t num_channels);
39 #endif
40 
41 void PIOS_DEBUG_PinHigh(uint8_t pin);
42 void PIOS_DEBUG_PinLow(uint8_t pin);
43 void PIOS_DEBUG_PinValue8Bit(uint8_t value);
44 void PIOS_DEBUG_PinValue4BitL(uint8_t value);
45 void PIOS_DEBUG_Panic(const char *msg) __attribute__((noreturn));
46 
47 #ifdef DEBUG
48 #define PIOS_DEBUG_Assert(test) do { if (!(test)) PIOS_DEBUG_Panic(PIOS_DEBUG_AssertMsg); } while (0)
49 #define PIOS_Assert(test) PIOS_DEBUG_Assert(test)
50 #else
51 #define PIOS_DEBUG_Assert(test) do { } while(0)
52 #define PIOS_Assert(test) do { if (!(test)) PIOS_DEBUG_Panic(NULL); } while (0)
53 #endif
54 
55 #define PIOS_Abort() PIOS_Assert(0)
56 
57 #endif /* PIOS_DEBUG_H */
58 
void PIOS_DEBUG_PinValue8Bit(uint8_t value)
Definition: pios_debug.c:62
void PIOS_DEBUG_PinHigh(uint8_t pin)
Definition: pios_debug.c:49
const char * PIOS_DEBUG_AssertMsg
Definition: pios_debug.c:34
void PIOS_DEBUG_Init(const struct pios_tim_channel *channels, uint8_t num_channels)
Definition: pios_debug.c:44
void PIOS_DEBUG_PinLow(uint8_t pin)
Definition: pios_debug.c:57
uint16_t value
Definition: storm32bgc.c:155
void PIOS_DEBUG_PinValue4BitL(uint8_t value)
Definition: pios_debug.c:66
void PIOS_DEBUG_Panic(const char *msg) __attribute__((noreturn))
Definition: pios_debug.c:74
typedef __attribute__
Definition: serial_4way.h:43