Pumpkin, Inc.

Pumpkin User Forums

OS_DelayTS() in SALVO2.3

Have an idea on how to make Salvo better? Post it here!

OS_DelayTS() in SALVO2.3

Postby aek » Fri Nov 16, 2001 2:42 am

Hi Luben.

Thank you for your feedback. I haven't yet created an example or test program for the TS stuff on the PIC -- I've only tested it on the PC so far, so I suspect some of the examples, etc. are not quite as good as more established Salvo services.

Regards

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: OS_DelayTS() in SALVO2.3

Postby luben » Fri Nov 16, 2001 12:51 pm

Hello,

In the preliminary Manual of SALVO2.2 I saw the description of OS_Interval and I liked the name OS_DelayTS - it's really good mnemonic for such command. But the description of the function is a little bit unclear - I mean, the user can't get the real meaning and the purpose of such instruction.

On page 244 (292 PDF) you made small mistake - you wrote - you should not call OS_Delay() from within interrupt, it should be OS_DelayTS() (maybe you copied the OS_Delay explanation and forgot to change this row).

If you ask me you should change some "weak" places:
1. To say clear that this is used to start some commands in fixed interval, that doesn't depend on unpredictable delays. The purpose of this command should be mentioned, it's not only Delay, it has something more - it keeps track of the moment of creation, so it keeps fixed pace rate.

2. You should change the example (or to be more exactly - to add some more functionality) - from the current one the user can't get any difference between OS_Delay and OS_DelayTS (even for me is unclear where is the difference between them and why I should OS_DelayTS() instead of OS_Delay(). Well, because I was involved from the beginning in creating the function I know what you meant, but for external users this will be unclear.
I propose to change the project in this way:

code:

void TaskA(void)
{
while(TRUE) {
OS_DelayTS(40,Task_Label1);
// here passes every 40 ticks, despite that other delays could appear
........do something.......
PORTA_bit0 ^= 1; // generates on PORTA pin 0 fixed frequency

OS_Yield(Task_Label2);
........do something.......
// the OS_Yield is put to show that the other unpredictable delays could be added,
// but the pace rate will be still 40 ticks - the OS_Delay will produce different times

{
}


3. It's very convenient for generating fixed frequency on some pins, or something like that. This command has very clear purpose - periodic processes with increased accurate. Without mentioning this the user can't get the difference between OS_Delay and OS_DelayTS

4. You didn't mentioned that you have not to call other OS_Delay() between OS_DelayTS() without some additional workaround (to keep the time stamp) or is this already fixed?

I keep working with SALVO2.3, I hope today to run simple test on Keil51.

Regards
Luben

[This message has been edited by luben (edited November 16, 2001).]

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 3 guests

cron