Skip to content

Commit ebf02d4

Browse files
author
Andrew Boie
committed
Revert "misc: Remove generic PRINT macros from hello world samples"
This reverts commit 86507b1. Change-Id: I5dc7bb2808f9fc942f48de798902a7185fb05d99 Signed-off-by: Andrew Boie <[email protected]>
1 parent b8a27f3 commit ebf02d4

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
CONFIG_STDOUT_CONSOLE=y
2-
CONFIG_SYS_LOG=y

samples/hello_world/microkernel/src/main.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@
1616

1717
#include <zephyr.h>
1818

19-
#define SYS_LOG_LEVEL SYS_LOG_LEVEL_INFO
20-
#include <misc/sys_log.h>
19+
#if defined(CONFIG_STDOUT_CONSOLE)
20+
#include <stdio.h>
21+
#define PRINT printf
22+
#else
23+
#include <misc/printk.h>
24+
#define PRINT printk
25+
#endif
2126

2227
void main(void)
2328
{
24-
SYS_LOG_INF("Hello World! %s", CONFIG_ARCH);
29+
PRINT("Hello World! %s\n", CONFIG_ARCH);
2530
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CONFIG_SYS_LOG=y
1+
# nothing yet

samples/hello_world/nanokernel/src/main.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@
1515
*/
1616

1717
#include <zephyr.h>
18-
#define SYS_LOG_LEVEL SYS_LOG_LEVEL_INFO
19-
#include <misc/sys_log.h>
18+
19+
#if defined(CONFIG_STDOUT_CONSOLE)
20+
#include <stdio.h>
21+
#define PRINT printf
22+
#else
23+
#include <misc/printk.h>
24+
#define PRINT printk
25+
#endif
26+
2027

2128
/*
2229
* @file
@@ -27,6 +34,6 @@
2734

2835
void main(void)
2936
{
30-
SYS_LOG_INF("Hello World! %s", CONFIG_ARCH);
37+
PRINT("Hello World! %s\n", CONFIG_ARCH);
3138
}
3239

0 commit comments

Comments
 (0)