fix(sprintf) add format string for rp2 port (#2512)

* fixes for rp2 port (only format strings: int/int32_t mismatch, %d -> %ld)

* use portable PRId32 printf format, #include <inttypes.h> via lv_printf.h

* define LV_PRId32 macro (for int)

* figure out good way to build inside Micropython (plus indentation)

* re-add examples (lost on the way)

* hopefully fix PRI32d

* Revert off CMakeLists.txt changes so that this is about printf only
This commit is contained in:
eudoxos
2021-09-03 14:45:42 +02:00
committed by GitHub
parent f3342269f2
commit 4e58f74163
5 changed files with 14 additions and 5 deletions

View File

@@ -88,7 +88,7 @@ void _lv_log_add(lv_log_level_t level, const char * file, int line, const char *
char buf[512];
uint32_t t = lv_tick_get();
static const char * lvl_prefix[] = {"Trace", "Info", "Warn", "Error", "User"};
lv_snprintf(buf, sizeof(buf), "[%s]\t(%d.%03d, +%d)\t %s: %s \t(in %s line #%d)\n", lvl_prefix[level], t / 1000, t % 1000, t - last_log_time, func, msg, &file[p], line);
lv_snprintf(buf, sizeof(buf), "[%s]\t(%" LV_PRId32 ".%03" LV_PRId32 ", +%" LV_PRId32 ")\t %s: %s \t(in %s line #%d)\n", lvl_prefix[level], t / 1000, t % 1000, t - last_log_time, func, msg, &file[p], line);
last_log_time = t;
lv_log(buf);
}