This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Task Suspend and resume

Hi,
I writing a new app based on the new Keil 5 CMSIS-RTOS Version 1.02, I wanted to be able to suspend and resume a task, several times in another task,

I have used osThreadTerminate for suspending and I'm using osThreadCreate for resuming, But the problem with that is I'm making several copy Tasks!

Here is the code that I'm using


void enable_alarm(void)
{
        if(
        t_AlarmTask  = osThreadCreate(osThread(AlarmTask),  NULL);
}
void disable_alarm(void)
{
        osThreadTerminate(t_AlarmTask);
}


void FlasherTask (void const *argument)
{
while(1)
{
    disable_alarm();
    //Do some stuff
    enable_alarm();
    //Do some other things
    osDelay(1);
}
}


Do you have any Idea how I should suspend and resume?

Parents
  • Thanks for the info, Suspending and resuming are two critical needed functions that are not existed on the CIMCIS RTOS, I think they have over simplified the things! They really wanted the kids to be able to use it! but at what cost?

    So do we have any ticks in here to implement them? or Am I totally missing something!!!

Reply
  • Thanks for the info, Suspending and resuming are two critical needed functions that are not existed on the CIMCIS RTOS, I think they have over simplified the things! They really wanted the kids to be able to use it! but at what cost?

    So do we have any ticks in here to implement them? or Am I totally missing something!!!

Children