34
34
* The line "*** A0, AIN[10] triggered falling." should appear.
35
35
*/
36
36
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
39
44
40
45
#include <zephyr.h>
41
46
#include <stdint.h>
@@ -66,8 +71,9 @@ void cb(void *param)
66
71
67
72
aio_cmp_dev = device_get_binding ("AIO_CMP_0" );
68
73
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
+ );
71
77
72
78
if (p -> pol == AIO_CMP_POL_RISE )
73
79
p -> pol = AIO_CMP_POL_FALL ;
@@ -89,20 +95,20 @@ void main(void)
89
95
90
96
aio_cmp_dev = device_get_binding ("AIO_CMP_0" );
91
97
92
- SYS_LOG_INF ("===== app started ========" );
98
+ PRINT ("===== app started ========\n " );
93
99
94
100
for (i = 0 ; i < 4 ; i ++ ) {
95
101
/* REF_A is to use AREF for reference */
96
102
ret = aio_cmp_configure (aio_cmp_dev , cb_data .ain_idx ,
97
103
cb_data .pol , cb_data .ref ,
98
104
cb , & cb_data );
99
105
if (ret )
100
- SYS_LOG_ERR ("ERROR registering callback for %s (%d)" ,
106
+ PRINT ("ERROR registering callback for %s (%d)\n " ,
101
107
& cb_data .name , ret );
102
108
}
103
109
104
110
while (1 ) {
105
- SYS_LOG_INF ("... waiting for event! (%d)" , ++ cnt );
111
+ PRINT ("... waiting for event! (%d)\n " , ++ cnt );
106
112
107
113
/* wait a while */
108
114
nano_task_timer_start (& timer , SLEEPTIME );
0 commit comments