@@ -54,10 +54,7 @@ struct Posix : RtapiApp
5454 auto task = ::rtapi_get_task<PosixTask>(task_id);
5555 if (!task) return -EINVAL;
5656
57- if (period_nsec < (unsigned long )period) period_nsec = (unsigned long )period;
5857 task->period = period_nsec;
59- task->ratio = period_nsec / period;
60-
6158 struct sched_param param;
6259 memset (¶m, 0 , sizeof (param));
6360 param.sched_priority = task->prio ;
@@ -102,17 +99,7 @@ struct Posix : RtapiApp
10299 }
103100
104101 static void *wrapper (void *arg) {
105- struct rtapi_task *task;
106-
107- /* use the argument to point to the task data */
108- task = (struct rtapi_task *)arg;
109-
110- long int period = instance->period ;
111- if (task->period < period) task->period = period;
112- task->ratio = task->period / period;
113- task->period = task->ratio * period;
114- rtapi_print_msg (RTAPI_MSG_INFO, " task %p period = %lu ratio=%u\n " ,
115- task, task->period , task->ratio );
102+ auto task = reinterpret_cast <PosixTask*>(arg);
116103
117104 pthread_setspecific (key, arg);
118105 set_namef (" rtapi_app:T#%d" , task->id );
0 commit comments