inp_start()This is called whenever the application signals that it wishes to start receiving input from a particular input device (how calls from applications are made is covered in the section on Application Programming). The relevant input device numbers are passed to this function as an argument. Thus, when the application starts using input device n, this function is called with n as the argument. The value of n is the value of the input device bit mask selected in the application.
inp_start() should do whatever initialisation is required to start accepting input. For example, under FlexOS it will typically start an asynchronous read on the appropriate device file. Initialisation which is required only once (such as setting baud rates) should be done in prg_start() or in the initialisation of output device PRN_INIT (see Definitions and Declarations for this constant).
As an example, for our DP4 Till inp_start() only takes action when it detects that the input device selected is the scanner. It calls init_scanner() (operating-system dependent and so not shown) when it detects that the scanner has been selected.
void inp_start(int device)
{
if (device & INP_SCANNER)
init_scanner();
}
|