Method Description
exitMajorMode_f
This routine releases all resources that were allocated during the initialization and
execution of the major mode.
The EXIT routine is called if the major mode changes, or if we are between modes,
for example, after a TTY Chat q command, or a processor reset.
RVP is guaranteed not to be within an active PROC section when
exitMajorMode() is called. That is, if exitProcSection() must be invoked,
that always happens
first.
initProcSection_
f
exitProcSection_
f
Pair of routines called if RVP enters and exits active timeseries acquisition and
processing.
The INIT routine is called when a PROC opcode is executed that causes the
IQData thread to begin collecting data, and activates RVP compute threads for the
current major mode.
The EXIT routine is called if anything interrupts those processes, for example, the
execution of most other opcodes. The major mode itself does not change at these
transitions, but these functions allow the current major mode to interact with the
timeseries data acquisition as needed.
C.5 Real-Time Control of RVP
RVP9/Main includes a dedicated thread (named RT-Ctrl) ,which can be programmed to
handle real-time events while the processor is running.
This includes activities such as altering trigger patterns in response to antenna position or
other external conditions, tracking live inputs from an I/O-62 card, and so on. The RT-Ctrl
thread runs at a priority that is higher than any other RVP thread. This allows it to preempt
other activities to achieve near real-time behavior; but it should always be coded as
eciently as possible and should not do anything that could possibly become CPU bound.
Despite the high POSIX static priority of RT-Ctrl, its scheduling is still subject to jitter due
to uncertain latencies within the Linux kernel. The magnitude of this jitter depends on the
kernel version, the type of motherboard being used, and the nature of the other processes
that are competing for CPU time. Intense disk and network I/O are among the worst
contributors to high scheduling latency, sometimes amounting to as much as 25 ms of
variation. These uncertainties can usually be absorbed by proper coding of the thread.
C.5.1
Using Programmable Callback Timers
The RT-Ctrl thread is structured around a flexible set of real-time callback timers. The
thread is activated each time the initProcSection method is called, and it is
deactivated when that PROC section is eventually exited. Thus, real-time control is available
when live (I,Q) data are acquired and processed.
The rtCtrlCBF_f callback function is customized to handle the real-time control and
sequencing tasks for the current major mode. This routine is called once at the beginning of
each data processing section. It then performs whatever work needs to be done, and
requests that it be called back at some later time. Up to 3 independent timing and/or event
criteria can
define when the callback occurs, and each can be based on:
RVP900 User Guide M211322EN-J
384