RTOS Bridge


Each product has a number of interfaces, see the image below:



We focus on the interface to the RTOS - please refer to the description on all interfaces on details for non-RTOS interfaces. All RXF source files always include WSTRTOS.h

Example:

#include "RxfConstants.h"
#include "WSTProduct.h"
#include "WSTProlog.h"
#include "WSTCompiler.h"
#include "WSTTarget.h"
#include "WSTRTOS.h"
#include "WSTPMF.h"
#include "RxfDimensions.h"

..  (include files for ANSI-C like stddef.h, include files for RXF)

#include "WSTEpilog.h"


Interface RTOS implementation embOS


Files Description
WSTRTOS.h This file defines the following functions:
  • WSTRTOS_Init
This function is called as last call in main(), which initializes the embOS RTOS and starts the main task.

Its prototype is:

void     WSTRTOS_Init( void );
  • WSTRTOS_Cleanup
This function is not called by the RXF.
You must implement it and call it in your <Rhapsody component>__Cleanup() if you need it.

Its prototype is:

void     WSTRTOS_Cleanup( void );
         
This file defines the following macros, see also the section on RTOS Resource Management:
  • RIC_MS_PER_TICK
10
  • RiCOSDefaultThreadPriority
(long) RTOS_PRIORITY_NORMAL
  • RiCOSDefaultStackSize
(long) RTOS_DEFAULT_STACK
  • RiCOSDefaultMessageQueueSize
(long) RTOS_MQ_DEFAULT_SIZE
  • RTOS_PRIORITY_NORMAL
120
  • RTOS_PRIORITY_ABOVE_NORMAL
130
  • RTOS_PRIORITY_HIGH
255
  • RTOS_PRIORITY_LOW
0
  • RTOS_DEFAULT_STACK
256
  • RTOS_MQ_DEFAULT_SIZE
32
  • RTOS_MAIN_STK_SIZE
512
  • RTOS_SMALL_STACK
256
  • RiC_RAW_MEMORY_ALIGNMENT
16
  • RiCOSMemoryAllocation_malloc
malloc is mapped to this function
  • RiCOSMemoryAllocation_calloc
calloc is mapped to this function
  • RiCOSMemoryAllocation_realloc
realloc is mapped to this function
  • RiCOSMemoryAllocation_free
free is mapped to this function

The constant RIC_OS_MUTEX_LOCK_AS_OPERATION is defined.
WSTRTOS.c This file is used in the GettingStarted example. It implements the following functions:
  • WSTRTOS_Init
Is implemented as follows:
  • OS_IncDI() to disable interrupts
  • OS_InitKern() to iniitialize the embOS kernel
  • OS_INIT_SYS_LOCKS() to prepare thread safe heap usage
  • OS_InitHW() to initialize the hardware
  • the main task rhpMainTask and the Bridge task BridgeTask are created
  • a message box TimerMB for the timer used by BridgeTask is created
  • the embOS RTOS is started using OS_Start().
    This will result in a running rhpMainTask, which calls the Rhapsody generated WST_RXF_Main() so your application starts to run.
  • WSTRTOS_Cleanup
This function is left empty.





Copyright (c) Willert Software Tools GmbH. All rights reserved.