File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ See [advanced_usage.md](advanced_usage.md).
47
47
48
48
If memory footprint is critical, you can disable library features using compiler definitions. Available controls are:
49
49
50
+ * ` PRINTF_DISABLE_ALL `
51
+ - Remove all ` printf ` calls from the program
50
52
* ` PRINTF_NTOA_BUFFER_SIZE ` (unsigned integer)
51
53
* 'ntoa' conversion buffer size, this must be big enough to hold one converted numeric number including padded zeros (dynamically created on stack)
52
54
* Default: 32 bytes
Original file line number Diff line number Diff line change 1
1
#include " LibPrintf.h"
2
+
3
+ #ifndef PRINTF_DISABLE_ALL
2
4
#include " Arduino.h"
3
5
4
6
#ifdef __AVR__
@@ -25,3 +27,5 @@ extern "C" __attribute__((weak)) void putchar_(char character)
25
27
{
26
28
print_instance->print (character);
27
29
}
30
+
31
+ #endif // PRINTF_DISABLE_ALL
Original file line number Diff line number Diff line change 1
1
#ifndef ARDUINO_PRINTF_H_
2
2
#define ARDUINO_PRINTF_H_
3
3
4
+ #ifdef PRINTF_DISABLE_ALL
5
+
6
+ #define printf (...)
7
+ #define sprintf (...)
8
+ #define vsprintf (...)
9
+ #define snprintf (...)
10
+ #define vsnprintf (...)
11
+ #define vprintf (...)
12
+
13
+ #define printf_init (...)
14
+
15
+ #else // printf is enabled
16
+
4
17
#include "Print.h"
5
18
#include "../extras/printf/printf.h"
6
19
24
37
void printf_init (arduino ::Print & StreamClass );
25
38
#else
26
39
void printf_init (Print & StreamClass );
27
- #endif
40
+ #endif // __AVR_ATmega4809__
28
41
42
+ #endif // PRINTF_DISABLE_ALL
29
43
#endif //ARDUINO_PRINTF_H_
You can’t perform that action at this time.
0 commit comments