[PATCH] Modified Hello World task by Prateek

Prateek Pardeshi prateekp99 at zoho.com
Tue Feb 9 10:07:21 UTC 2021


From: pp <prateekpardeshi6 at gmail.com>

---
 testsuites/samples/hello/init.c | 47 +++++++++++++++++++++++++++++++--
 1 file changed, 45 insertions(+), 2 deletions(-)

diff --git a/testsuites/samples/hello/init.c b/testsuites/samples/hello/init.c
index 34ded37c55..47ac4b27d2 100644
--- a/testsuites/samples/hello/init.c
+++ b/testsuites/samples/hello/init.c
@@ -14,7 +14,7 @@
 #include <rtems.h>
 #include <tmacros.h>
 
-const char rtems_test_name[] = "HELLO WORLD";
+const char rtems_test_name[] = "HELLO OPEN SOURCE WORLD";
 
 static rtems_task Init(
   rtems_task_argument ignored
@@ -22,7 +22,50 @@ static rtems_task Init(
 {
   rtems_print_printer_fprintf_putc(&rtems_test_printer);
   TEST_BEGIN();
-  printf( "Hello World\n" );
+
+  //Printing Hello World for RTEMS
+  printf( "\nHello World, Open Source is amazing!\n\n" );
+
+
+  /*Starting of Star Pattern Code*/
+  int x = 0,y = 0;
+  int size = 8;
+  for(x=(size/2); x<=size; x+=2)
+  {
+      for(y=1; y<(size-x); y+=2)
+      {
+          printf(" ");
+      }
+      for(y=1; y<=x; ++y)
+      {
+          printf("*");
+      }
+      for(y=1; y<=(size-x); ++y)
+      {
+          printf(" ");
+      }
+      for(y=1; y<=x; ++y)
+      {
+          printf("*");
+      }
+      printf("\n");
+  }
+  
+  for(x=size; x>=1; --x)
+  {
+      for(y=x; y<size; ++y)
+      {
+          printf(" ");
+      }
+      for(y=1; y<=(x*2)-1; ++y)
+      {
+          printf("*");
+      }
+      printf("\n");
+  }
+/*End of Star Pattern Code*/
+
+
   TEST_END();
   rtems_test_exit( 0 );
 }
-- 
2.25.1




More information about the devel mailing list