3434 * The line "*** A0, AIN[10] triggered falling." should appear.
3535 */
3636
37- #define SYS_LOG_LEVEL SYS_LOG_LEVEL_INFO
38- #include <misc/sys_log.h>
37+ #if defined(CONFIG_STDOUT_CONSOLE )
38+ #include <stdio.h>
39+ #define PRINT printf
40+ #else
41+ #include <misc/printk.h>
42+ #define PRINT printk
43+ #endif
3944
4045#include <zephyr.h>
4146#include <stdint.h>
@@ -66,8 +71,9 @@ void cb(void *param)
6671
6772 aio_cmp_dev = device_get_binding ("AIO_CMP_0" );
6873
69- SYS_LOG_INF ("*** %s triggered %s." , & p -> name ,
70- (p -> pol == AIO_CMP_POL_RISE ) ? "rising" : "falling" );
74+ PRINT ("*** %s triggered %s.\n" , & p -> name ,
75+ (p -> pol == AIO_CMP_POL_RISE ) ? "rising" : "falling"
76+ );
7177
7278 if (p -> pol == AIO_CMP_POL_RISE )
7379 p -> pol = AIO_CMP_POL_FALL ;
@@ -89,20 +95,20 @@ void main(void)
8995
9096 aio_cmp_dev = device_get_binding ("AIO_CMP_0" );
9197
92- SYS_LOG_INF ("===== app started ========" );
98+ PRINT ("===== app started ========\n " );
9399
94100 for (i = 0 ; i < 4 ; i ++ ) {
95101 /* REF_A is to use AREF for reference */
96102 ret = aio_cmp_configure (aio_cmp_dev , cb_data .ain_idx ,
97103 cb_data .pol , cb_data .ref ,
98104 cb , & cb_data );
99105 if (ret )
100- SYS_LOG_ERR ("ERROR registering callback for %s (%d)" ,
106+ PRINT ("ERROR registering callback for %s (%d)\n " ,
101107 & cb_data .name , ret );
102108 }
103109
104110 while (1 ) {
105- SYS_LOG_INF ("... waiting for event! (%d)" , ++ cnt );
111+ PRINT ("... waiting for event! (%d)\n " , ++ cnt );
106112
107113 /* wait a while */
108114 nano_task_timer_start (& timer , SLEEPTIME );
0 commit comments