<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="RIGHT: auto">Hello,</div>
<div style="RIGHT: auto"> </div>
<div style="RIGHT: auto">I'm runing this code of periodic task with rate monotonic period. I would like to test the case where task missed it's period, could someone help me to do it ? </div>
<div style="RIGHT: auto">I tried to put a loop within but that does not work (the loop does not end). </div>
<div style="RIGHT: auto">What does RTEMS do when rtems_rate_monotonic_period return TIMEOUT <VAR id=yui-ie-cursor></VAR>? </div>
<div style="RIGHT: auto"> </div>
<div style="RIGHT: auto">rtems_task Task_Rate_Monotonic_Period(<BR> rtems_task_argument unused<BR>)<BR>{<BR> rtems_time_of_day time;<BR> rtems_status_code status;<BR> uint32_t ticks_since_boot;<BR> rtems_name my_period_name; <BR> rtems_id RM_period;<BR style="RIGHT: auto"> bool is_RM_created = 0;<BR> uint32_t count;</div>
<div style="RIGHT: auto"> </div>
<div style="RIGHT: auto"> while( 1 ) {<BR> status = rtems_clock_get_tod( &time );</div>
<div style="RIGHT: auto"> printf( "\n\nTask 2 - activating every %d second using rate monotonic manager to schedule (rtems_rate_monotonic_period)\n", PERIOD_TASK_RATE_MONOTONIC);<BR> print_time( " - rtems_clock_get_tod - ", &time, "\n" );<BR> ticks_since_boot = rtems_clock_get_ticks_since_boot();<BR> printf(" - Ticks since boot: %" PRIu32 "\n", ticks_since_boot);</div>
<div style="RIGHT: auto"> if( TRUE != is_RM_created ) {<BR> count = 0;<BR> my_period_name = rtems_build_name( 'P', 'E', 'R', '1' );<BR> status = rtems_rate_monotonic_create( my_period_name, &RM_period );<BR> if( RTEMS_SUCCESSFUL != status ) {<BR> printf("RM failed with status: %d\n", status);<BR> exit(1);<BR> }<BR> // Initiate RM period -- every N2 seconds<BR> status = rtems_rate_monotonic_period(<BR> RM_period,<BR> rtems_clock_get_ticks_per_second() * PERIOD_TASK_RATE_MONOTONIC<BR> );<BR> if( RTEMS_SUCCESSFUL != status ) {<BR> printf("RM failed with status: %d\n",
status);<BR> exit(1);<BR> }</div>
<div style="RIGHT: auto"> is_RM_created = TRUE;<BR> }<BR> // Block until RM period has expired -- every N2 seconds<BR> status = rtems_rate_monotonic_period(<BR> RM_period,<BR> rtems_clock_get_ticks_per_second() * PERIOD_TASK_RATE_MONOTONIC<BR> );</div>
<div style="RIGHT: auto"> </div>
<div style="RIGHT: auto">//###########################################</div>
<div style="RIGHT: auto">int x = 0;</div>
<div style="RIGHT: auto">while (x < 10000)</div>
<div style="RIGHT: auto">{</div>
<div style="RIGHT: auto">x++;</div>
<div style="RIGHT: auto">}</div>
<div style="RIGHT: auto">//###########################################</div>
<div style="RIGHT: auto"> if( RTEMS_SUCCESSFUL != status ) {<BR> if( RTEMS_TIMEOUT != status ) {<BR> printf("RM missed period!\n");<BR> }<BR> printf("RM failed with status: %d\n", status);<BR> exit(1);<BR> }</div>
<div style="RIGHT: auto"> }<BR> }<BR>}</div>
<div style="RIGHT: auto"> </div></div></body></html>