02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

VxWorks 5.5<br />

<strong>BSP</strong> Developer’s <strong>Guide</strong><br />

Step 3:<br />

Set Up Initialization<br />

If your component must be initialized, use the INIT_RTN property of the<br />

component object class to specify the initialization routine and its arguments to be<br />

called, as in fooInit(arg1, arg2). If your component needs more than a single line of<br />

initialization, create or add the initialization code to a .c file and use the<br />

CONFIGLETTES property instead. By associating a configlette with an<br />

initialization routine, you are securing the configlettes place in the initialization<br />

sequence.<br />

...<br />

INIT_RTN<br />

...<br />

fooInit(arg1, arg2);<br />

If you are not using the MODULES property of the component object, use the<br />

LINK_SYMS property to include your object module from a linked archive. The<br />

system generates an unresolved reference to the symbol _fooRtn1, causing the<br />

linker to resolve it by extracting your module from the archive.<br />

...<br />

LINK_SYMS<br />

...<br />

_fooRtn1<br />

Step 4:<br />

Establish the Initialization Sequence<br />

Initialization order is important. You can control when in the initialization<br />

sequence your component is initialized with the _INIT_ORDER property. A<br />

component (or initGroup) that is bound to an existing initGroup using the<br />

_INIT_ORDER property is, by default, initialized last within that group. This is<br />

typically the desired effect; however, you can override this behavior by explicitly<br />

using the INIT_BEFORE property.<br />

...<br />

_INIT_ORDER<br />

INIT_BEFORE<br />

...<br />

usrRoot<br />

INCLUDE_USER_APPL<br />

In the example, INCLUDE_FOO is declared a member of the usrRoot initGroup.<br />

INIT_BEFORE has been used for fine control, and INCLUDE_FOO is initialized<br />

before INCLUDE_USER_APPL.<br />

Alternatively, you can create a new initialization group and declare<br />

INCLUDE_FOO a member; however, you would have to declare the new initGroup<br />

a member of an existing initGroup. For more information on initialization groups,<br />

see E. Component Language.<br />

130

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!