[PATCH rtems-examples 09/23] led/delay/init.c: Use local variable for one second of ticks

Joel Sherrill joel at rtems.org
Wed Feb 23 22:21:37 UTC 2022


---
 led/delay/init.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/led/delay/init.c b/led/delay/init.c
index c965ae1..00cbc7e 100644
--- a/led/delay/init.c
+++ b/led/delay/init.c
@@ -16,22 +16,24 @@ rtems_task Init(
   rtems_task_argument argument
 )
 {
-  rtems_status_code status;
+  rtems_interval    one_second;
 
   puts( "\n\n*** LED BLINKER -- task wake after ***" );
 
+  one_second = 1 * rtems_clock_get_ticks_per_second();
+
   LED_INIT();
 
   while (1) {
 
-    (void) rtems_task_wake_after( 1 * rtems_clock_get_ticks_per_second() );
+    (void) rtems_task_wake_after( one_second );
     LED_OFF();
-    (void) rtems_task_wake_after( 1 * rtems_clock_get_ticks_per_second() );
+    (void) rtems_task_wake_after( one_second );
     LED_ON();
 
   }
 
-  status = rtems_task_delete( RTEMS_SELF );
+  (void) rtems_task_delete( RTEMS_SELF );
 }
 
 /**************** START OF CONFIGURATION INFORMATION ****************/
-- 
1.8.3.1



More information about the devel mailing list