Pumpkin, Inc.

Pumpkin User Forums

docu-bug: OSSetTS() bug in the example

If you think you've found a bug or other mistake in your Salvo distribution, post it here.

docu-bug: OSSetTS() bug in the example

Postby lattenzaun » Thu Jan 08, 2004 3:45 am

Hello AEK.

I usually do not report docu-bugs, but this one bothers me:

In the example of OSSetTS() on page 353 you are changing the task's timestamp to a variable which is volatile:

code:

void Task(void)
{
OStypeTS timestamp;
...
timestamp = OSGetTS();
OS_Delay(1, label2);
OSSetTS(timestamp);
...
}


This example cannot work, because all OS_xxx() calls will lose volatile stack-variables. You must define "timestamp" as static:
code:

void Task(void)
{
static OStypeTS timestamp;
...
}


Otherwhise you could set "timestamp" to a random value.

BTW, I played a little bit with OSGetTS(), but I never got a return-value <> 0. ...

Regards,
Martin

lattenzaun
 
Posts: 11
Joined: Thu Dec 18, 2003 12:00 am
Location: Vienna, Austria

Re: docu-bug: OSSetTS() bug in the example

Postby aek » Thu Jan 08, 2004 4:14 am

Hi Martin.

I guess the bitter winter cold in Vienna finds you reading the Salvo User Manual ...

You are of course correct about the need for static in that example.

I'll check on OSGetTS()'s return value ... the run-time "persistence" of the TS is a little tricky ... I may have to document that function better.

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

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


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest