Flags and command line arguments – Comtrol eCos User Manual

Page 778

Advertising
background image

Writing New Devices - host

synth::interrupt_raise can be called any time after initialization. The argument should be the vector returned
by synth::interrupt_allocate for this device. It will activate the normal eCos interrupt handling mechanism so,
subject to interrupts being enabled and this particular interrupt not being masked out, the appropriate ISR will run.

Note: At this time it is not possible for a device to allocate a specific interrupt vector. The order in which interrupt
vectors are assigned to devices effectively depends on the order in which the eCos devices get initialized, and
that may change if the eCos application is rebuilt. A future extension may allow devices to allocate specific
vectors, thus making things more deterministic. However that will introduce new problems, in particular the
code will have to start worrying about requests for vectors that have already been allocated.

Flags and Command Line Arguments

The generic I/O auxiliary code will process the standard command line arguments, and will set various flag vari-
ables accordingly. Some of these should be checked by device-specific scripts.

synth::flag_gui

This is set when the I/O auxiliary is operating in graphical mode rather than text mode. Some functionality
such as filters and the GUI layout are only available in graphical mode.

if { $synth::flag_gui } {

...

}

synth::flag_verbose

The user has requested additional information during startup. Each device driver can decide how much addi-
tional information, if any, should be produced.

synth::flag_keep_going

The user has specified

-k

or

--keep-going

, so even if an error occurs the I/O auxiliary and the various device

driver scripts should continue running if at all possible. Diagnostics should still be generated.

Some scripts may want to support additional command line arguments. This facility should be used with care since
there is no way to prevent two different scripts from trying to use the same argument. The following Tcl procedures
are available:

synth::argv_defined

<

name

>

synth::argv_get_value

<

name

>

synth::argv_defined returns a boolean to indicate whether or not a particular argument is present. If the argument
is the name part of a name/value pair, an

=

character should be appended. Typical uses might be:

if { [synth::argv_defined "-o13"] } {

...

}

if { [synth::argv_defined "-mark="] } {

...

674

Advertising