Download 8051 RTOS
Transcript
Interprocess Communication
C source file
DeclareComAppMode(COMMODE);
TASK(Init)
{
/* Whatever is left to initialize */
InitOS();
/* if other tasks need to run at startup */
ActivateTask(autoT1);
...
ActivateTask(autoTN);
StartCOM(COMMODE);
TerminateTask();
}
10.6.2 Starting the COM Extension
If in the OIL file the standard attribute COMSTARTCOMEXTENSION of the COM OIL object is set to
TRUE, the StartCOM routine calls a user-supplied function called StartCOMExtension to interfere
with the start-up process.
See section 10.4.4, Initializing Unqueued Messages to learn about how to use this com hook
routine in order to initialize messages that are too large or too complex for their initial value to be
specified in the OIL file.
10.6.3 Stopping the COM
The OSEK/VDX COM standard provides you with the following service to stop the communication
component:
StatusType StopCOM(COMShutdownModeType mode);
If the given parameter mode equals to COM_SHUTDOWN_IMMEDIATE, the service shuts down the
communication component immediately. This implementation does not define any other additional
shutdown mode for the COM component. Thus, you should always call this service with
COM_SHUTDOWN_IMMEDIATE as parameter.
StopCOM() sets the system ready for a new call to StartCOM().
10-21