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.

Terminating a DSP-BIOS SWI before its completion?

I need to terminate a low priority SWI before it has run to completion. Is there a way to do this? According to the DSP-BIOS user guide a SWI must always run to completion. What if I have a long running low-priority SWI that I need to terminate prematurely for some reason out of a higher priority SWI?

Many thanks for helping,

Roland

  • Roland,

    You cannot delete a SWI from another SWI or HWI.  It can only be deleted in a TSK but by definition SWIs are higher priority than TSK which would mean your SWI would have run to completion already.  SWIs are meant to run to completion so I don't think you can do what you are doing with a SWI.

    Do you have other TSKs in your system?  Would it make sense to make this low priority SWI a TSK?

    Judah

  • Another option would be to use a flag variable to signal from the high priority SWI to the lower priority SWI that it should complete (i.e., do a return from its SWI function).  It is certainly not ideal, but it is one option versus using a TSK instead of the lower priority SWI.

    Scott

  • Hi Judah,

    Many thanks for your reply.

    My system uses many SWIs but no TSKs. I do not like the resource (e.g. separate stack memory) and overhead penalty of TSKs. But, I guess, I will have to re-consider a TSK for solving my problem.

    Roland

  • Hi Scott,

    Many thanks for your reply.

    I was thinking about your suggestion before of using a flag variable within the SWI which would signal it to complete. However, this would mean to place many checks for this flag within the entire code of the SWI (it's not just a simple loop but an extensive background task).

    Roland