diff options
author | Anas Nashif <anas.nashif@intel.com> | 2016-10-03 19:06:15 -0400 |
---|---|---|
committer | Anas Nashif <nashif@linux.intel.com> | 2016-10-05 23:01:22 +0000 |
commit | 1ccad63744440af5fdad9665ff977e36d78c0c78 (patch) | |
tree | 8080288a2f540cdf6cfba4b830dbd5c94554785b /samples | |
parent | f52baa15fb1afb1273748876ccbf4f7d7afd82c0 (diff) |
samples: remove useless printf/printk wrappers
Change-Id: I4518171c85914785df1fc02ac679279b49a1be31
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Diffstat (limited to 'samples')
-rw-r--r-- | samples/cpp_synchronization/microkernel/prj.conf | 1 | ||||
-rw-r--r-- | samples/cpp_synchronization/microkernel/src/main.cpp | 16 | ||||
-rw-r--r-- | samples/cpp_synchronization/nanokernel/prj.conf | 1 | ||||
-rw-r--r-- | samples/hello_world/microkernel/src/main.c | 9 | ||||
-rw-r--r-- | samples/hello_world/nanokernel/src/main.c | 12 | ||||
-rw-r--r-- | samples/synchronization/microkernel/src/main.c | 9 | ||||
-rw-r--r-- | samples/synchronization/nanokernel/prj.conf | 2 | ||||
-rw-r--r-- | samples/synchronization/nanokernel/src/main.c | 11 | ||||
-rw-r--r-- | samples/task_profiler/sample_microkernel_app/src/hello.c | 11 | ||||
-rw-r--r-- | samples/task_profiler/sample_nanokernel_app/src/hello.c | 12 |
10 files changed, 17 insertions, 67 deletions
diff --git a/samples/cpp_synchronization/microkernel/prj.conf b/samples/cpp_synchronization/microkernel/prj.conf index 861c9d17c..2a189d969 100644 --- a/samples/cpp_synchronization/microkernel/prj.conf +++ b/samples/cpp_synchronization/microkernel/prj.conf @@ -1,2 +1,3 @@ +CONFIG_STDOUT_CONSOLE=y CONFIG_COMPILER_OPT="-O0" CONFIG_CPLUSPLUS=y diff --git a/samples/cpp_synchronization/microkernel/src/main.cpp b/samples/cpp_synchronization/microkernel/src/main.cpp index b1fd9ddff..0bd82c3d6 100644 --- a/samples/cpp_synchronization/microkernel/src/main.cpp +++ b/samples/cpp_synchronization/microkernel/src/main.cpp @@ -18,13 +18,7 @@ * @file C++ Synchronization demo. Uses basic C++ functionality. */ -#if defined(CONFIG_STDOUT_CONSOLE) #include <stdio.h> -#define PRINT printf -#else -#include <misc/printk.h> -#define PRINT printk -#endif /** * @class semaphore the basic pure virtual semaphore class @@ -75,7 +69,7 @@ public: */ task_semaphore::task_semaphore(): _sema_internal(__K_SEMAPHORE_DEFAULT) { - PRINT("Create semaphore %p\n", this); + printf("Create semaphore %p\n", this); sema = (ksem_t)&_sema_internal; } @@ -135,7 +129,7 @@ void hello_loop(const char *taskname, my_sem.wait(); /* say "hello" */ - PRINT("%s: Hello World!\n", taskname); + printf("%s: Hello World!\n", taskname); /* wait a while, then let other task have a turn */ task_sleep(SLEEPTICKS); @@ -200,7 +194,7 @@ public: */ nano_semaphore::nano_semaphore() { - PRINT("Create semaphore %p\n", this); + printf("Create semaphore %p\n", this); nano_sem_init(&_sema_internal); } @@ -263,7 +257,7 @@ void fiber_entry(void) nano_sem_fiber.wait(); /* say "hello" */ - PRINT("%s: Hello World!\n", __FUNCTION__); + printf("%s: Hello World!\n", __FUNCTION__); /* wait a while, then let task have a turn */ nano_fiber_timer_start(&timer, SLEEPTICKS); @@ -284,7 +278,7 @@ void main(void) while (1) { /* say "hello" */ - PRINT("%s: Hello World!\n", __FUNCTION__); + printf("%s: Hello World!\n", __FUNCTION__); /* wait a while, then let fiber have a turn */ nano_task_timer_start(&timer, SLEEPTICKS); diff --git a/samples/cpp_synchronization/nanokernel/prj.conf b/samples/cpp_synchronization/nanokernel/prj.conf index fa7da8057..fdd50ca0f 100644 --- a/samples/cpp_synchronization/nanokernel/prj.conf +++ b/samples/cpp_synchronization/nanokernel/prj.conf @@ -1 +1,2 @@ +CONFIG_STDOUT_CONSOLE=y CONFIG_CPLUSPLUS=y diff --git a/samples/hello_world/microkernel/src/main.c b/samples/hello_world/microkernel/src/main.c index 744251cf4..b7e013e7a 100644 --- a/samples/hello_world/microkernel/src/main.c +++ b/samples/hello_world/microkernel/src/main.c @@ -15,16 +15,9 @@ */ #include <zephyr.h> - -#if defined(CONFIG_STDOUT_CONSOLE) -#include <stdio.h> -#define PRINT printf -#else #include <misc/printk.h> -#define PRINT printk -#endif void main(void) { - PRINT("Hello World! %s\n", CONFIG_ARCH); + printk("Hello World! %s\n", CONFIG_ARCH); } diff --git a/samples/hello_world/nanokernel/src/main.c b/samples/hello_world/nanokernel/src/main.c index 2dd208dff..5957ee7a8 100644 --- a/samples/hello_world/nanokernel/src/main.c +++ b/samples/hello_world/nanokernel/src/main.c @@ -15,25 +15,15 @@ */ #include <zephyr.h> - -#if defined(CONFIG_STDOUT_CONSOLE) -#include <stdio.h> -#define PRINT printf -#else #include <misc/printk.h> -#define PRINT printk -#endif - /* * @file * @brief Hello World demo * Nanokernel version of hello world demo */ - - void main(void) { - PRINT("Hello World! %s\n", CONFIG_ARCH); + printk("Hello World! %s\n", CONFIG_ARCH); } diff --git a/samples/synchronization/microkernel/src/main.c b/samples/synchronization/microkernel/src/main.c index fa0379731..821bcf94b 100644 --- a/samples/synchronization/microkernel/src/main.c +++ b/samples/synchronization/microkernel/src/main.c @@ -17,14 +17,7 @@ */ #include <zephyr.h> - -#if defined(CONFIG_STDOUT_CONSOLE) -#include <stdio.h> -#define PRINT printf -#else #include <misc/printk.h> -#define PRINT printk -#endif /* * Microkernel version of hello world demo has two tasks that utilize @@ -51,7 +44,7 @@ void helloLoop(const char *taskname, ksem_t mySem, ksem_t otherSem) task_sem_take(mySem, TICKS_UNLIMITED); /* say "hello" */ - PRINT("%s: Hello World from %s!\n", taskname, CONFIG_ARCH); + printk("%s: Hello World from %s!\n", taskname, CONFIG_ARCH); /* wait a while, then let other task have a turn */ task_sleep(SLEEPTICKS); diff --git a/samples/synchronization/nanokernel/prj.conf b/samples/synchronization/nanokernel/prj.conf index 8b042db54..b2a4ba591 100644 --- a/samples/synchronization/nanokernel/prj.conf +++ b/samples/synchronization/nanokernel/prj.conf @@ -1 +1 @@ -CONFIG_STDOUT_CONSOLE=y +# nothing here diff --git a/samples/synchronization/nanokernel/src/main.c b/samples/synchronization/nanokernel/src/main.c index e9d3c0c9b..ab9cda71a 100644 --- a/samples/synchronization/nanokernel/src/main.c +++ b/samples/synchronization/nanokernel/src/main.c @@ -17,14 +17,7 @@ */ #include <zephyr.h> - -#if defined(CONFIG_STDOUT_CONSOLE) -#include <stdio.h> -#define PRINT printf -#else #include <misc/printk.h> -#define PRINT printk -#endif /* @@ -59,7 +52,7 @@ void fiberEntry(void) nano_fiber_sem_take(&nanoSemFiber, TICKS_UNLIMITED); /* say "hello" */ - PRINT("%s: Hello World!\n", __func__); + printk("%s: Hello World!\n", __func__); /* wait a while, then let task have a turn */ nano_fiber_timer_start(&timer, SLEEPTICKS); @@ -81,7 +74,7 @@ void main(void) while (1) { /* say "hello" */ - PRINT("%s: Hello World!\n", __func__); + printk("%s: Hello World!\n", __func__); /* wait a while, then let fiber have a turn */ nano_task_timer_start(&timer, SLEEPTICKS); diff --git a/samples/task_profiler/sample_microkernel_app/src/hello.c b/samples/task_profiler/sample_microkernel_app/src/hello.c index de66a94be..211aadf0e 100644 --- a/samples/task_profiler/sample_microkernel_app/src/hello.c +++ b/samples/task_profiler/sample_microkernel_app/src/hello.c @@ -17,14 +17,7 @@ */ #include <zephyr.h> - -#if defined(CONFIG_STDOUT_CONSOLE) #include <stdio.h> -#define PRINT printf -#else -#include <misc/printk.h> -#define PRINT printk -#endif #ifdef CONFIG_MICROKERNEL @@ -48,7 +41,7 @@ void myfiber(int param1, int param2) { volatile int i; - PRINT("Hello fiber %d\n", param1); + printf("Hello fiber %d\n", param1); for (i = 0; i < 300; i++) { } } @@ -74,7 +67,7 @@ void helloLoop(const char *taskname, ksem_t mySem, ksem_t otherSem) } /* say "hello" */ - PRINT("%s: Hello World!\n", taskname); + printf("%s: Hello World!\n", taskname); /* wait a while, then let other task have a turn */ task_sleep(SLEEPTICKS); diff --git a/samples/task_profiler/sample_nanokernel_app/src/hello.c b/samples/task_profiler/sample_nanokernel_app/src/hello.c index e73ea1185..5940d75f2 100644 --- a/samples/task_profiler/sample_nanokernel_app/src/hello.c +++ b/samples/task_profiler/sample_nanokernel_app/src/hello.c @@ -17,15 +17,7 @@ */ #include <zephyr.h> - -#if defined(CONFIG_STDOUT_CONSOLE) #include <stdio.h> -#define PRINT printf -#else -#include <misc/printk.h> -#define PRINT printk -#endif - #include "profiler.h" #ifdef CONFIG_NANOKERNEL @@ -56,7 +48,7 @@ void fiberEntry(void) nano_fiber_sem_take(&nanoSemFiber, TICKS_UNLIMITED); /* say "hello" */ - PRINT("%s: Hello World ! %d\n", __func__, sys_cycle_get_32()); + printf("%s: Hello World ! %d\n", __func__, sys_cycle_get_32()); fiber_sleep(SLEEPTICKS); nano_fiber_sem_give(&nanoSemTask); } @@ -72,7 +64,7 @@ void main(void) while (1) { /* say "hello" */ - PRINT("%s: Hello World ! %d\n", __func__, sys_cycle_get_32()); + printf("%s: Hello World ! %d\n", __func__, sys_cycle_get_32()); /* wait a while, then let fiber have a turn */ task_sleep(SLEEPTICKS); |