diff --git a/examples/ostest/sporadic.c b/examples/ostest/sporadic.c index 0b3233529..c05a08f8d 100644 --- a/examples/ostest/sporadic.c +++ b/examples/ostest/sporadic.c @@ -58,6 +58,10 @@ # define NULL (void*)0 #endif +#ifndef MIN +# define MIN(a,b) (((a) < (b)) ? (a) : (b)) +#endif + /*********************************************************************** * Private Data ***********************************************************************/ @@ -268,7 +272,7 @@ void sporadic_test(void) sparam.sched_ss_repl_period.tv_nsec = 0; sparam.sched_ss_init_budget.tv_sec = 2; sparam.sched_ss_init_budget.tv_nsec = 0; - sparam.sched_ss_max_repl = 5; + sparam.sched_ss_max_repl = MIN(5, CONFIG_SCHED_SPORADIC_MAXREPL); ret = pthread_attr_setschedparam(&attr, &sparam); if (ret != OK)