Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 10, 2016, 07:25:52 19:25


Login with username, password and session length


Pages: [1]
Print
Author Topic: Clarification Request OSA  (Read 2132 times)
0 Members and 1 Guest are viewing this topic.
odsk
Junior Member
**
Offline Offline

Posts: 53

Thank You
-Given: 11
-Receive: 12


« on: July 27, 2011, 07:44:59 19:44 »

Hi,

working first time with RTOS and PIC and used OSA for that.
Questions:
i have a task that is aimed to work only when a flag is set, and after the flag is set then the task is run for only a scpecified time using Timers under OSA
So I have
for(;; ) {
OS_Flag_Wait_On (flag, Mask); //don't run task until mask is set
OS_Flag_Clear (flag, mask);  //clear the mask
OS_Ttimer_Run (20); // Run current task's timer for 20 ticks
         for(condition)
                {   ....../some actions
                   if (OS_Ttimer_Check()) { break;}   // If timer overflowed then break and exit this task

                 }
       }

Is this the way it should be, basically wants to run this task only when a condition is met and then run it for only a determined time?
The mask is set inside the Int routine using OS_Flag_Set(flag, mask).
The task is already created with OS_create_task...etc and I don't have any errors when compiling my concern is maybe my undestading of what OSA services are meant to do.
Regards,
ODSK
Logged
odsk
Junior Member
**
Offline Offline

Posts: 53

Thank You
-Given: 11
-Receive: 12


« Reply #1 on: July 31, 2011, 06:52:05 18:52 »

Gents,

Any help with that matter is highly appreciated. I am strugling with a function that I want to run only for a quantum of time. or other ways to accomplish that. I don;t want to put a load on the application by terminating that function if the allocated time is over.
Regards,
ODSK
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC