Skip to content

Commit b3d6593

Browse files
author
Andrew Boie
committed
Revert "misc: Remove generic PRINT macros from aio samples"
This reverts commit b39399b. Change-Id: Idfa8e277af6f23c522f0afc4d4d0f29cb6bae307 Signed-off-by: Andrew Boie <[email protected]>
1 parent 03c40a2 commit b3d6593

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
CONFIG_STDOUT_CONSOLE=y
22
CONFIG_PRINTK=y
33
CONFIG_AIO_COMPARATOR=y
4-
CONFIG_SYS_LOG=y

samples/drivers/aio_comparator/src/main.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@
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

Comments
 (0)