MCPcopy Create free account
hub / github.com/SmingHub/Sming / printf

Method printf

Sming/Wiring/Print.cpp:41–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41size_t Print::printf(const char* fmt, ...)
42{
43 size_t buffSize = INITIAL_PRINTF_BUFFSIZE;
44 for(;;) {
45 char tempBuff[buffSize];
46 va_list va;
47 va_start(va, fmt);
48 size_t sz = m_vsnprintf(tempBuff, buffSize, fmt, va);
49 va_end(va);
50 if(sz > (buffSize - 1)) {
51 buffSize = sz + 1; // Leave room for terminating null char
52 continue; // try again
53 }
54
55 if(sz > 0) {
56 write(tempBuff, sz);
57 }
58
59 return sz;
60 }
61}
62
63size_t Print::printNumber(unsigned long num, uint8_t base, uint8_t width, char pad)
64{

Callers 12

readConsoleFunction · 0.80
testPrintfFunction · 0.80
testSpeedFunction · 0.80
updateMethod · 0.80
connectOkFunction · 0.80
processExampleCommandFunction · 0.80
initCamFunction · 0.80
onCaptureFunction · 0.80
dataReadyMethod · 0.80
initFunction · 0.80
printMethod · 0.80
pritlnMethod · 0.80

Calls 1

m_vsnprintfFunction · 0.85

Tested by 1

testSpeedFunction · 0.64