- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello there,
I implemented code in psoc 4 with uC / OS, where there are tasks and interruptions, but I had a problem with the interruption. The interrupt I created is a button. The interrupt works, but when the interruption comes to an end, the tasks return to where they left off and I would like them to return from the beginning, is there any function of uC / OS III that does this?
To access the project, open Psoc Create and then click on "file-> Open-> Project / workspace" and open the folder "Micrium\Examples\Cypress\CY8CKIT-044\OS3\PSoC\OS3.cywrk"
Solved! Go to Solution.
- Labels:
-
PSoC 4 MCU
- Tags:
- psoc 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @RoFr_4201436,
When an interrupt occurs, the task context is saved and the ISR is serviced. After the execution of ISR is completed, the task is resumed at the point the execution was stopped. Do you want to reset the task so that it starts from first? Is my understanding correct? If that is the case, I believe it will be easier to change the logic to not execute the code when the interrupt occurs. I am not aware of an API that would reset the task.
One thing that I think can be done is create a task (say Task1) specifically to manage other tasks. Let us consider that a task (Task2) was running. When the interrupt occurs, delete Task2 that was executing before the interrupt using Task1 and then create Task2 again with a priority higher than Task1. This way Task1 will be blocked and Task2 will be reset.
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @RoFr_4201436,
When an interrupt occurs, the task context is saved and the ISR is serviced. After the execution of ISR is completed, the task is resumed at the point the execution was stopped. Do you want to reset the task so that it starts from first? Is my understanding correct? If that is the case, I believe it will be easier to change the logic to not execute the code when the interrupt occurs. I am not aware of an API that would reset the task.
One thing that I think can be done is create a task (say Task1) specifically to manage other tasks. Let us consider that a task (Task2) was running. When the interrupt occurs, delete Task2 that was executing before the interrupt using Task1 and then create Task2 again with a priority higher than Task1. This way Task1 will be blocked and Task2 will be reset.
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So, I tried to change the priority of the tasks as shown in the image: Then I changed the signals in the task: "App_Botao_Pedestre_1_Task" and then I came back with the original priorities, like the image:
Then I changed the signals in the task: "App_Botao_Pedestre_1_Task" and then I came back with the original priorities, like the image:
But after I press the interrupt button, the program simply stops. I even tried to delete the tasks, but without success! Can you help me?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes. You understand me very well. Can you put this in my code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From the private message that I received, I believe that you were able to implement the workaround. So, I will be marking the workaround as the solution. If that is not the case and you are still facing issues, please let us know.
Rakshith M B