misc: Remove generic PRINT macros from aio samples

Remove generic PRINT macros from aio samples and replace
with SYS_LOG  module.

Jira: ZEP-240

Change-Id: If50d8de2256f38902b5a4b68c57553cb5e8b8a94
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
This commit is contained in:
Juan Manuel Cruz Alcaraz 2016-08-02 22:08:43 -05:00 committed by Inaky Perez-Gonzalez
commit b39399b069
2 changed files with 8 additions and 13 deletions

View file

@ -1,3 +1,4 @@
CONFIG_STDOUT_CONSOLE=y CONFIG_STDOUT_CONSOLE=y
CONFIG_PRINTK=y CONFIG_PRINTK=y
CONFIG_AIO_COMPARATOR=y CONFIG_AIO_COMPARATOR=y
CONFIG_SYS_LOG=y

View file

@ -34,13 +34,8 @@
* The line "*** A0, AIN[10] triggered falling." should appear. * The line "*** A0, AIN[10] triggered falling." should appear.
*/ */
#if defined(CONFIG_STDOUT_CONSOLE) #define SYS_LOG_LEVEL SYS_LOG_LEVEL_INFO
#include <stdio.h> #include <misc/sys_log.h>
#define PRINT printf
#else
#include <misc/printk.h>
#define PRINT printk
#endif
#include <zephyr.h> #include <zephyr.h>
#include <stdint.h> #include <stdint.h>
@ -71,9 +66,8 @@ void cb(void *param)
aio_cmp_dev = device_get_binding("AIO_CMP_0"); aio_cmp_dev = device_get_binding("AIO_CMP_0");
PRINT("*** %s triggered %s.\n", &p->name, SYS_LOG_INF("*** %s triggered %s.", &p->name,
(p->pol == AIO_CMP_POL_RISE) ? "rising" : "falling" (p->pol == AIO_CMP_POL_RISE) ? "rising" : "falling");
);
if (p->pol == AIO_CMP_POL_RISE) if (p->pol == AIO_CMP_POL_RISE)
p->pol = AIO_CMP_POL_FALL; p->pol = AIO_CMP_POL_FALL;
@ -95,7 +89,7 @@ void main(void)
aio_cmp_dev = device_get_binding("AIO_CMP_0"); aio_cmp_dev = device_get_binding("AIO_CMP_0");
PRINT("===== app started ========\n"); SYS_LOG_INF("===== app started ========");
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
/* REF_A is to use AREF for reference */ /* REF_A is to use AREF for reference */
@ -103,12 +97,12 @@ void main(void)
cb_data.pol, cb_data.ref, cb_data.pol, cb_data.ref,
cb, &cb_data); cb, &cb_data);
if (ret) if (ret)
PRINT("ERROR registering callback for %s (%d)\n", SYS_LOG_ERR("ERROR registering callback for %s (%d)",
&cb_data.name, ret); &cb_data.name, ret);
} }
while (1) { while (1) {
PRINT("... waiting for event! (%d)\n", ++cnt); SYS_LOG_INF("... waiting for event! (%d)", ++cnt);
/* wait a while */ /* wait a while */
nano_task_timer_start(&timer, SLEEPTIME); nano_task_timer_start(&timer, SLEEPTIME);