Add NO_PRINT and NO_DEBUG config options.
- NO_PRINT: disable print.h API(also disable debug.h) - NO_DEBUG: disable debug.h API
This commit is contained in:
parent
8580c8d291
commit
9a106537f6
7 changed files with 77 additions and 32 deletions
|
@ -27,12 +27,17 @@
|
|||
#include "print.h"
|
||||
|
||||
|
||||
#define sendchar(c) do { if (print_enable && print_sendchar_func) (print_sendchar_func)(c); } while (0)
|
||||
#ifndef NO_PRINT
|
||||
|
||||
#define sendchar(c) do { if (print_sendchar_func) (print_sendchar_func)(c); } while (0)
|
||||
|
||||
|
||||
int8_t (*print_sendchar_func)(uint8_t) = 0;
|
||||
bool print_enable = true;
|
||||
static int8_t (*print_sendchar_func)(uint8_t) = 0;
|
||||
|
||||
void print_set_sendchar(int8_t (*sendchar_func)(uint8_t))
|
||||
{
|
||||
print_sendchar_func = sendchar_func;
|
||||
}
|
||||
|
||||
/* print string stored in data memory(SRAM)
|
||||
* print_P("hello world");
|
||||
|
@ -184,3 +189,5 @@ void print_bin_reverse32(uint32_t data)
|
|||
print_bin_reverse8(data>>16);
|
||||
print_bin_reverse8(data>>24);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue