tests: Allow tc_util to use printf when requested

printk() is too simplistic and does not handle byte precision on formats
like %02x etc... printf does, so letting the possibility to use it when
relevant. This might be useful when dumping out some network packets,
byte by byte where a precision of 1 byte (thus 2 0's) is necessary.

It's better to have this output:
	41 d8 ...
instead of:
	00000041 000000d8 ...

Change-Id: Idc15bbae67830f41388373e2ca1947bb274fb550
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2016-06-23 15:47:00 +02:00 committed by Inaky Perez-Gonzalez
parent 288305739a
commit 83c82e6cd6
2 changed files with 6 additions and 2 deletions

View file

@ -21,10 +21,15 @@
#include <zephyr.h>
#include <misc/printk.h>
#include <string.h>
#if defined(CONFIG_STDOUT_CONSOLE)
#include <stdio.h>
#define PRINT_DATA(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#include <misc/printk.h>
#define PRINT_DATA(fmt, ...) printk(fmt, ##__VA_ARGS__)
#endif /* CONFIG_STDOUT_CONSOLE */
/**
* @def TC_PRINT_RUN_ID

View file

@ -1,5 +1,4 @@
CONFIG_CONSOLE=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_IPM_CONSOLE_RECEIVER=y
CONFIG_IPM_CONSOLE_SENDER=y
CONFIG_IRQ_OFFLOAD=y