User`s manual

PK2100
4-4 s System Development
The following preprocessor variables control features of the virtual driver.
#define N_WATCHDOG nn
Specify the number of virtual watchdog timers. Each virtual watchdog
has a counter that has to be reloaded. If the counter for any virtual
watchdog counts down to zero, a hardware reset is forced. To reload a
virtual watchdog, type
up_wdoghit( int watchdog, byte count )
where count is the number of 25-millisecond ticks to countdown. A
virtual watchdog wdog can be monitored, if necessary, by reading the
internal variable lc_wdogarray[wdog-1]. The program VWDOG.C
in the subdirectory SAMPLES\CPLC illustrates the use of virtual
watchdog timers.
#define RUNKERNEL
Request the real-time kernel. It will be initialized.
#define KEYREQUEST nn
Request a real-time kernel task when a key is pressed. The sample
program SAMPLES\CPLC\VWDOG.C illustrates the use of this directive.
Invoking the Virtual Driver
Call uplc_init() from the main function to invoke the virtual driver.
This call will initialize the following items:
Variables for the virtual driver.
Virtual watchdog timers (if requested).
The liquid crystal display (unless disabled).
The real-time kernel (if requested).
The timer that runs the background routine.
The program must periodically hit the (hardware) watchdog
uplc_init() to keep it from timing out.
Virtual Driver Services
up_beep( int milliseconds )
Beeps the built-in beeper for the number of milliseconds specified.
up_beepvol( int code )
Sets beeper volume. The code is 0, 1, or 2, and corresponds to beeper
off, low, or high volume.