This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Can a CLA task call an other CLA task

Genius 5910 points

I have one really fast task in my CLA and a slow one.

 The slow one is stalling the fast one. So I was thinking is it possible to split the slow task in 3 different  tasks. So than in between the slow task the fast task can  be handled.

So is it possible to do something like:

__interrupt void Cla1Task3 ( void )
{

Cla1ForceTask4 ();
}

  • EVS,

    Why not just put whatever it is that Task4 does into the function you call in Task3 (e.g., Cla1ForceTask4)?
    - David
  • David M. Alter said:
    EVS,

    Why not just put whatever it is that Task4 does into the function you call in Task3 (e.g., Cla1ForceTask4)?
    - David

    Because of the lack of interrupt priority handling.  I personally vote for the biggest mistake in the C2000.

    There is no way to guarantee that an interrupt is serviced in a certain time interval.  And that is really important in the current loop. Else It release the magic smoke.

    So I want to do this:

    Task3:

    {

    Do something

    Call task4

    }

    time for task1

    Task4

    {

    Continue to do something

    Call Task5

    }

    time for task1

    Task5

    {

    Finish to do something

    }

    Is it possible to set MIER register via the CLA?
     

    Thanks!

  • EVS,

    The register you want the CLA to access is the MIFR (CLA interrupt forcing register), but the CLA does not have access to this register.

    Remember that tasks are not pre-emptive anyway. That is, once a task starts it will run to completion before another task can execute. Even if you could have the CLA self-trigger task 1 in the middle of say task 2, task 2 would run to completion before task 1 would begin execution.

    Regards,
    David
  • Ok then I have to find an other solution to solve it.
  • I think you may be able to make it work if you have an unused peripheral ( PWM for example ). Your "lower priority" CLA task can force an interrupt on the PWM and then return, allowing the pending task to run.  The PWM interrupt can then be serviced by another CLA task.