|
@@ -118,6 +118,15 @@ void dbg_hex_dump_da ( unsigned long dispaddr, const void *data,
|
118
|
118
|
}
|
119
|
119
|
}
|
120
|
120
|
|
|
121
|
+/**
|
|
122
|
+ * Base message stream colour
|
|
123
|
+ *
|
|
124
|
+ * We default to using 31 (red foreground) as the base colour.
|
|
125
|
+ */
|
|
126
|
+#ifndef DBGCOL_MIN
|
|
127
|
+#define DBGCOL_MIN 31
|
|
128
|
+#endif
|
|
129
|
+
|
121
|
130
|
/**
|
122
|
131
|
* Maximum number of separately coloured message streams
|
123
|
132
|
*
|
|
@@ -125,7 +134,9 @@ void dbg_hex_dump_da ( unsigned long dispaddr, const void *data,
|
125
|
134
|
* of which will be the terminal default and one of which will be
|
126
|
135
|
* invisible on the terminal because it matches the background colour.
|
127
|
136
|
*/
|
128
|
|
-#define NUM_AUTO_COLOURS 6
|
|
137
|
+#ifndef DBGCOL_MAX
|
|
138
|
+#define DBGCOL_MAX ( DBGCOL_MIN + 6 - 1 )
|
|
139
|
+#endif
|
129
|
140
|
|
130
|
141
|
/** A colour assigned to an autocolourised debug message stream */
|
131
|
142
|
struct autocolour {
|
|
@@ -142,7 +153,7 @@ struct autocolour {
|
142
|
153
|
* @ret colour Colour ID
|
143
|
154
|
*/
|
144
|
155
|
static int dbg_autocolour ( unsigned long stream ) {
|
145
|
|
- static struct autocolour acs[NUM_AUTO_COLOURS];
|
|
156
|
+ static struct autocolour acs[ DBGCOL_MAX - DBGCOL_MIN + 1 ];
|
146
|
157
|
static unsigned long use;
|
147
|
158
|
unsigned int i;
|
148
|
159
|
unsigned int oldest;
|
|
@@ -180,7 +191,7 @@ static int dbg_autocolour ( unsigned long stream ) {
|
180
|
191
|
*/
|
181
|
192
|
void dbg_autocolourise ( unsigned long stream ) {
|
182
|
193
|
dbg_printf ( "\033[%dm",
|
183
|
|
- ( stream ? ( 31 + dbg_autocolour ( stream ) ) : 0 ) );
|
|
194
|
+ ( stream ? ( DBGCOL_MIN + dbg_autocolour ( stream ) ) :0));
|
184
|
195
|
}
|
185
|
196
|
|
186
|
197
|
/**
|