File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 1
1
CONFIG_STDOUT_CONSOLE=y
2
- CONFIG_SYS_LOG=y
Original file line number Diff line number Diff line change 19
19
#include <gpio.h>
20
20
#include <misc/util.h>
21
21
22
- #define SYS_LOG_LEVEL SYS_LOG_LEVEL_INFO
23
- #include <misc/sys_log.h>
22
+ #if defined(CONFIG_STDOUT_CONSOLE )
23
+ #include <stdio.h>
24
+ #define PRINT printf
25
+ #else
26
+ #include <misc/printk.h>
27
+ #define PRINT printk
28
+ #endif
24
29
25
30
/* change this to use another GPIO port */
26
31
#define PORT "GPIOC"
35
40
void button_pressed (struct device * gpiob ,
36
41
struct gpio_callback * cb , uint32_t pins )
37
42
{
38
- SYS_LOG_INF ("Button pressed at %d" , sys_tick_get_32 ());
43
+ PRINT ("Button pressed at %d\n " , sys_tick_get_32 ());
39
44
}
40
45
41
46
static struct gpio_callback gpio_cb ;
@@ -60,7 +65,7 @@ void main(void)
60
65
int val = 0 ;
61
66
62
67
gpio_pin_read (gpiob , PIN , & val );
63
- SYS_LOG_INF ("GPIO val: %d" , val );
68
+ PRINT ("GPIO val: %d\n " , val );
64
69
task_sleep (MSEC (500 ));
65
70
}
66
71
}
You can’t perform that action at this time.
0 commit comments