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.

RTOS/MSP430F5529: Swi_inc does not increment trigger above 1

Part Number: MSP430F5529

Tool/software: TI-RTOS

Hello,

I defined in CFG GUI a Swi object with initial trigger of 0. This Swi is posted from a Clock function context, using Swi_inc function. When I invoke Swi_getTrigger() function from within the Swi function, I always get the result 1 - regardless of the number of times the Swi had been posted (using Swi_inc). This behaviour does not coincide with the description of Swi_inc within the API Documentation.

I will be grateful if someone can assist in investigating this issue.

Many thanks!

M

  • Are you seeing the following (in order)?

    Swi_inc
    Swi_inc
    Swi runs and calls Swi_getTrigger which returns 1

    This should return 2.

    Or are you seeing this
    Swi_inc
    Swi runs and calls Swi_getTrigger which returns 1
    Swi_inc
    Swi runs and calls Swi_getTrigger which returns 1

    This is correct.

  • Hello Todd and thank you for your prompt response!

    I guess I am seeing the second case, because Swi_inc is invoked from Clock function every 5 seconds.

    Can you please explain why this behaviour is correct?
    Is this , effectively, counting the number of Swi instances, of the same type, which are currently "alive"? (providing trigger is initially set to 0, of course).

    Many thanks!

    M
  • Swi_post is binary function. You could have called it 5 times in a loop in an Hwi but you'll only run the Swi once after the Hwi ends (I know...silly case, but hopefully gets the point across). When the Swi runs it does not know how many times it was posted. That's where Swi_inc comes in. If the Hwi had called Swi_inc 5 times, when the Swi runs and calls Swi_getTrigger, it knows it was posted 5 times and can act accordingly (if needed).

    Does that explain the use case?

    Todd