Pumpkin, Inc.

Pumpkin User Forums

Cyclic timers

If you're having difficulty with Salvo's configuration options, post it here.

Cyclic timers

Postby aek » Mon Aug 26, 2002 1:48 am

Hello.

quote:
If OSCALL_OSSIGNALEVENT is configured as OSFROM_ANYWHERE in a source build which is using event flags and message queues, do OSProtect/OSUnprotect need to be applied only to only OSSetEFlag? I.e., is OSReadEFlag safe without protect calls?
The short answer is all services that can be called from the foreground / ISR level must be protected in the background / task / mainline level. O/wise you end up with corrupted arguments, etc.

quote:
In this configuration, if
OSSignalMsgQ is called only from mainline code, can it be safely called without protect calls?
Technically, yes, but it doesn't cost you much to protect it, and you'll be very unhappy down the line if you start calling OSSignalMsgQ() from an ISR and you forgot to protect it in the mainline code ... so we definitely don't recommend it.

quote:
On a related note, the Hi-Tech PICC18 linker forces a call to OSSignalMsgQ in this configuration. I just do an "if (0) OSSignalMsgQ(...);" to get around it. Strangely, the compiler correctly generates no code for the above expression, but the linker still sees OSSignalMsgQ in the ISR's call tree.
Yes, isn't that odd :-)

Regards,

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

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

Re: Cyclic timers

Postby jtemples » Mon Aug 26, 2002 11:42 am

If OSCALL_OSSIGNALEVENT is configured as OSFROM_ANYWHERE in a source build which is using event flags and message queues, do OSProtect/OSUnprotect need to be applied only to only OSSetEFlag? I.e., is OSReadEFlag safe without protect calls?

In this configuration, if
OSSignalMsgQ is called only from mainline code, can it be safely called without protect calls?

On a related note, the Hi-Tech PICC18 linker forces a call to OSSignalMsgQ in this configuration. I just do an "if (0) OSSignalMsgQ(...);" to get around it. Strangely, the compiler correctly generates no code for the above expression, but the linker still sees OSSignalMsgQ in the ISR's call tree.

jtemples
 
Posts: 45
Joined: Tue Jul 16, 2002 11:00 pm


Return to Configuration

Who is online

Users browsing this forum: No registered users and 0 guests

cron