aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/debug_uart.h
blob: f792ec01050feb7673ecec2e05ae851d321aaf37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#ifndef DEBUG_UART_H_
#define DEBUG_UART_H_

#include "util.h"
#include "fixpt.h"

#include <stdint.h>


#if CONF_DEBUG


void debug_print_int32(const char __flash *prefix, int32_t value);
void debug_print_int24(const char __flash *prefix, int24_t value);
void debug_print_int16(const char __flash *prefix, int16_t value);
void debug_print_int8(const char __flash *prefix, int8_t value);
void debug_print_fixpt(const char __flash *prefix, fixpt_t value);

void debug_report_int32(const char __flash *prefix,
			int32_t *old_value,
			int32_t new_value);
void debug_report_int24(const char __flash *prefix,
			int24_t *old_value,
			int24_t new_value);
void debug_report_int16(const char __flash *prefix,
			int16_t *old_value,
			int16_t new_value);
void debug_report_int8(const char __flash *prefix,
		       int8_t *old_value,
		       int8_t new_value);
void debug_report_fixpt(const char __flash *prefix,
		       fixpt_t *old_value,
		       fixpt_t new_value);

void debug_enable(bool enable);
bool debug_is_enabled(void);

void debug_uart_init(void);


#else /* CONF_DEBUG */


static inline
void debug_print_int32(const char __flash *prefix, int32_t value)
{
}

static inline
void debug_print_int24(const char __flash *prefix, int24_t value)
{
}

static inline
void debug_print_int16(const char __flash *prefix, int16_t value)
{
}

static inline
void debug_print_int8(const char __flash *prefix, int8_t value)
{
}

static inline
void debug_print_fixpt(const char __flash *prefix, fixpt_t value)
{
}

static inline
void debug_report_int32(const char __flash *prefix,
			int32_t *old_value,
			int32_t new_value)
{
}

static inline
void debug_report_int24(const char __flash *prefix,
			int24_t *old_value,
			int24_t new_value)
{
}

static inline
void debug_report_int16(const char __flash *prefix,
			int16_t *old_value,
			int16_t new_value)
{
}

static inline
void debug_report_int8(const char __flash *prefix,
			int8_t *old_value,
			int8_t new_value)
{
}

static inline
void debug_report_fixpt(const char __flash *prefix,
		       fixpt_t *old_value,
		       fixpt_t new_value)
{
}

static inline
void debug_enable(bool enable)
{
}

static inline
bool debug_is_enabled(void)
{
	return false;
}

static inline
void debug_uart_init(void)
{
}


#endif /* CONF_DEBUG */
#endif /* DEBUG_UART_H_ */
bues.ch cgit interface