diff options
author | Andrew Boie <andrew.p.boie@intel.com> | 2016-08-23 13:15:54 -0700 |
---|---|---|
committer | Andrew Boie <andrew.p.boie@intel.com> | 2016-08-23 13:19:45 -0700 |
commit | b3d65931a56f8c5c89f6e790314a129f8fbcb17a (patch) | |
tree | 7e5541867154091534df40eb1bbcc5847d367416 | |
parent | 03c40a268539d05fd4185b26e8e67a50d3ac3337 (diff) |
Revert "misc: Remove generic PRINT macros from aio samples"
This reverts commit b39399b069e5478b11f3ecad74cb1b316f49a0b5.
Change-Id: Idfa8e277af6f23c522f0afc4d4d0f29cb6bae307
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
-rw-r--r-- | samples/drivers/aio_comparator/prj.conf | 1 | ||||
-rw-r--r-- | samples/drivers/aio_comparator/src/main.c | 20 |
2 files changed, 13 insertions, 8 deletions
diff --git a/samples/drivers/aio_comparator/prj.conf b/samples/drivers/aio_comparator/prj.conf index e265c2305..75e335150 100644 --- a/samples/drivers/aio_comparator/prj.conf +++ b/samples/drivers/aio_comparator/prj.conf @@ -1,4 +1,3 @@ CONFIG_STDOUT_CONSOLE=y CONFIG_PRINTK=y CONFIG_AIO_COMPARATOR=y -CONFIG_SYS_LOG=y diff --git a/samples/drivers/aio_comparator/src/main.c b/samples/drivers/aio_comparator/src/main.c index 4f30a7714..b35787c34 100644 --- a/samples/drivers/aio_comparator/src/main.c +++ b/samples/drivers/aio_comparator/src/main.c @@ -34,8 +34,13 @@ * The line "*** A0, AIN[10] triggered falling." should appear. */ -#define SYS_LOG_LEVEL SYS_LOG_LEVEL_INFO -#include <misc/sys_log.h> +#if defined(CONFIG_STDOUT_CONSOLE) +#include <stdio.h> +#define PRINT printf +#else +#include <misc/printk.h> +#define PRINT printk +#endif #include <zephyr.h> #include <stdint.h> @@ -66,8 +71,9 @@ void cb(void *param) aio_cmp_dev = device_get_binding("AIO_CMP_0"); - SYS_LOG_INF("*** %s triggered %s.", &p->name, - (p->pol == AIO_CMP_POL_RISE) ? "rising" : "falling"); + PRINT("*** %s triggered %s.\n", &p->name, + (p->pol == AIO_CMP_POL_RISE) ? "rising" : "falling" + ); if (p->pol == AIO_CMP_POL_RISE) p->pol = AIO_CMP_POL_FALL; @@ -89,7 +95,7 @@ void main(void) aio_cmp_dev = device_get_binding("AIO_CMP_0"); - SYS_LOG_INF("===== app started ========"); + PRINT("===== app started ========\n"); for (i = 0; i < 4; i++) { /* REF_A is to use AREF for reference */ @@ -97,12 +103,12 @@ void main(void) cb_data.pol, cb_data.ref, cb, &cb_data); if (ret) - SYS_LOG_ERR("ERROR registering callback for %s (%d)", + PRINT("ERROR registering callback for %s (%d)\n", &cb_data.name, ret); } while (1) { - SYS_LOG_INF("... waiting for event! (%d)", ++cnt); + PRINT("... waiting for event! (%d)\n", ++cnt); /* wait a while */ nano_task_timer_start(&timer, SLEEPTIME); |