Select one of the symbols to view example projects that use it.
 
Outline
#define _PICO_PRINTF_H
#include "pico.h"
#include <stdio.h>
#include <stdarg.h>
#define PICO_PRINTF_ALWAYS_INCLUDED
#define PICO_PRINTF_ALWAYS_INCLUDED
#define weak_raw_printf
#define weak_raw_vprintf
vfctprintf(void (*)(char, void *), void *, const char *, va_list);
#define weak_raw_printf
#define weak_raw_vprintf
Files
loading...
SourceVuRaspberry Pi Pico SDK and ExamplesPicoSDKsrc/rp2_common/pico_printf/include/pico/printf.h
 
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/////////////////////////////////////////////////////////////////////////////// // \author (c) Marco Paland (info@paland.com) // 2014-2019, PALANDesign Hannover, Germany // // \license The MIT License (MIT) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // // \brief Tiny printf, sprintf and snprintf implementation, optimized for speed on // embedded systems with a very limited resources. // Use this instead of bloated standard/newlib printf. // These routines are thread safe and reentrant. // /////////////////////////////////////////////////////////////////////////////// #ifndef _PICO_PRINTF_H #define _PICO_PRINTF_H /** \file printf.h * \defgroup pico_printf pico_printf * * \brief Compact replacement for printf by Marco Paland (info@paland.com) *//* ... */ #ifdef __cplusplus extern "C" { #endif #include "pico.h" #include <stdio.h> #include <stdarg.h> // PICO_CONFIG: PICO_PRINTF_ALWAYS_INCLUDED, Whether to always include printf code even if only called weakly (by panic), type=bool, default=1 in debug build 0 otherwise, group=pico_printf #ifndef PICO_PRINTF_ALWAYS_INCLUDED #ifndef NDEBUG #define PICO_PRINTF_ALWAYS_INCLUDED 1 #else #define PICO_PRINTF_ALWAYS_INCLUDED 0 #endif/* ... */ #endif #if LIB_PICO_PRINTF_PICO // weak raw printf may be a puts if printf has not been called, // so that we can support gc of printf when it isn't called // // it is called raw to distinguish it from the regular printf which // is in stdio.c and does mutex protection #if !PICO_PRINTF_ALWAYS_INCLUDED bool __printflike(1, 0) weak_raw_printf(const char *fmt, ...); bool weak_raw_vprintf(const char *fmt, va_list args);/* ... */ #else #define weak_raw_printf(...) ({printf(__VA_ARGS__); true;}) #define weak_raw_vprintf(fmt,va) ({vprintf(fmt,va); true;}) /* ... */#endif /** * \brief printf with output function * You may use this as dynamic alternative to printf() with its fixed _putchar() output * \param out An output function which takes one character and an argument pointer * \param arg An argument pointer for user data passed to output function * \param format A string that specifies the format of the output * \return The number of characters that are sent to the output function, not counting the terminating null character *//* ... */ int vfctprintf(void (*out)(char character, void *arg), void *arg, const char *format, va_list va); /* ... */ #else #define weak_raw_printf(...) ({printf(__VA_ARGS__); true;}) #define weak_raw_vprintf(fmt,va) ({vprintf(fmt,va); true;}) /* ... */ #endif #ifdef __cplusplus }extern "C" { ... } #endif /* ... */ #endif // _PRINTF_H_
Details
Show:
from
Types: Columns: