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:
parent
a0007012b7
commit
b39399b069
2 changed files with 8 additions and 13 deletions
|
@ -1,3 +1,4 @@
|
|||
CONFIG_STDOUT_CONSOLE=y
|
||||
CONFIG_PRINTK=y
|
||||
CONFIG_AIO_COMPARATOR=y
|
||||
CONFIG_SYS_LOG=y
|
||||
|
|
|
@ -34,13 +34,8 @@
|
|||
* The line "*** A0, AIN[10] triggered falling." should appear.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_STDOUT_CONSOLE)
|
||||
#include <stdio.h>
|
||||
#define PRINT printf
|
||||
#else
|
||||
#include <misc/printk.h>
|
||||
#define PRINT printk
|
||||
#endif
|
||||
#define SYS_LOG_LEVEL SYS_LOG_LEVEL_INFO
|
||||
#include <misc/sys_log.h>
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <stdint.h>
|
||||
|
@ -71,9 +66,8 @@ void cb(void *param)
|
|||
|
||||
aio_cmp_dev = device_get_binding("AIO_CMP_0");
|
||||
|
||||
PRINT("*** %s triggered %s.\n", &p->name,
|
||||
(p->pol == AIO_CMP_POL_RISE) ? "rising" : "falling"
|
||||
);
|
||||
SYS_LOG_INF("*** %s triggered %s.", &p->name,
|
||||
(p->pol == AIO_CMP_POL_RISE) ? "rising" : "falling");
|
||||
|
||||
if (p->pol == AIO_CMP_POL_RISE)
|
||||
p->pol = AIO_CMP_POL_FALL;
|
||||
|
@ -95,7 +89,7 @@ void main(void)
|
|||
|
||||
aio_cmp_dev = device_get_binding("AIO_CMP_0");
|
||||
|
||||
PRINT("===== app started ========\n");
|
||||
SYS_LOG_INF("===== app started ========");
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
/* REF_A is to use AREF for reference */
|
||||
|
@ -103,12 +97,12 @@ void main(void)
|
|||
cb_data.pol, cb_data.ref,
|
||||
cb, &cb_data);
|
||||
if (ret)
|
||||
PRINT("ERROR registering callback for %s (%d)\n",
|
||||
SYS_LOG_ERR("ERROR registering callback for %s (%d)",
|
||||
&cb_data.name, ret);
|
||||
}
|
||||
|
||||
while (1) {
|
||||
PRINT("... waiting for event! (%d)\n", ++cnt);
|
||||
SYS_LOG_INF("... waiting for event! (%d)", ++cnt);
|
||||
|
||||
/* wait a while */
|
||||
nano_task_timer_start(&timer, SLEEPTIME);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue