apps: hello: simplify hello world example
authorEunBong Song <eunb.song@samsung.com>
Mon, 13 Mar 2017 02:40:47 +0000 (11:40 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Mon, 17 Apr 2017 09:58:43 +0000 (18:58 +0900)
'hello world' is an example for showing minimum binary footprint. As
sleep() goes with signaling and scheduling functions which are a little
bit heavy, using it in this example increases the footprint and is
inappropriate.

Change-Id: I4140bd6393f89762182fc1f883fad86b112de154
Signed-off-by: EunBong Song <eunb.song@samsung.com>
apps/examples/hello/hello_main.c

index 7108714..ada58ad 100644 (file)
 
 #include <tinyara/config.h>
 #include <stdio.h>
-#include <unistd.h>
 
 /****************************************************************************
  * hello_main
  ****************************************************************************/
 
-#define PRINT_INTERVAL_SECS 20
-
 #ifdef CONFIG_BUILD_KERNEL
 int main(int argc, FAR char *argv[])
 #else
 int hello_main(int argc, char *argv[])
 #endif
 {
-       int i;
-
-       printf("This Hello World msg will be printed third every 20 seconds\n");
-       for (i = 0; i < 3; i++) {
-               printf("Hello, World!!\n");
-               sleep(PRINT_INTERVAL_SECS);
-       }
-
+       printf("Hello, World!!\n");
        return 0;
 }