Using the wRTOS Application Template

wRTOS provides two templates in supported versions of Microsoft Visual Studio under the Templates/Visual C++ branch:

The wRTOS project contains four build configurations: Windows Release, Windows Debug, RTSSRelease, and RTSSDebug. The wRTOS Application Template sets the project settings for each configuration according to the program and project options that you specify. The template can also provide a basic C/C++ program framework with which to work. This program framework can include wRTOS program elements, which contain C/C++ code to create wRTOS objects and demonstrate their use.

Note: wRTOS only supports absolute pathnames.

Sections in this Topic:

Creating a wRTOS Application

The wRTOS Application template provides the structure for creating wRTOS applications. Use the following procedure to create a wRTOS project using the wRTOS Application template in Microsoft Visual Studio.

Note: wRTOS does not support the building of managed RTSS applications. For additional information on using wRTOS from within a Windows managed code application, see the wRTOS Managed Code Reference.

To create a wRTOS application project:

  1. Create a new project in Visual Studio.
  2. Select C or C++ as the template type.
  3. Select the wRTOS Application template. This template is a single-page dialog that displays the default project settings and provides optional application and program settings.
  4. To accept the current settings, click Finish. Optionally, you can specify other options and libraries that you want to include in your wRTOS application project:
  1. If no other options are needed, click Finish to create the project. Otherwise, continue editing program settings for this application.

When the Provide a program framework box is selected, you can optionally add elements to the program framework. These code segments show proper usage of Real-time API function calls and can serve as examples of how to set up these elements.  Areas in the element code that need to be customized by the user are indicated by "TO DO" comments. You can select more than one type of programming element for a single project. The following table provides the available program elements.

    Element Description

    Event server thread

    Inserts a code segment into the program framework that creates a child thread function shell, a named event and a child thread, and sets thread priorities and resumes/suspends threads. The user should supply the child thread function code, the event name and exception code.

    Periodic timer thread

    Creates a periodic timer function shell and inserts a code segment into the program framework that creates and sets a periodic timer. The user should supply the timer period, the periodic timer function code, and exception code.

    Interrupt Service Routine (ISR)

    Creates a basic Interrupt Service Routine template that can be used to determine the interrupt owner when an interrupt is shared. Inserts code segments into the program framework to support interrupt sharing.

    Interrupt Service Thread (IST)

    Creates a basic Interrupt Service Thread template that can be called when an interrupt occurs. Inserts code segments into the program framework to support interrupts.

    Basic Port I/O

    Inserts a code segment into the program framework that supports Port I/O. Enables/disables Port I/O and demonstrates basic reading and writing to an I/O Port.

    Basic mapped memory

    Inserts a code segment into the program framework that supports Memory Mapping.

  1. Click Finish. This generates the wRTOS solution and project according to the options you selected.

wRTOS Custom Macro

wRTOS utilizes a custom macro, $(wRTOSPlatform), to find the correct library directory for projects. This custom macro requires two property files, which are installed with the wRTOS SDK:

All projects import these property files. If they are edited in any way, projects will not load correctly.

Resulting Configurations

Four configurations for creating applications are generated in Visual Studio when you create a project using the wRTOS Application template:

x64

For instructions on manually building a 32-bit application, see Building a 32-bit User Space Application.

Compiler and Linker Options

For a complete list, see Compiler and Linker Options for Visual Studio .

Related topics: