Received: from mailhost.comp.vuw.ac.nz (kaukau.comp.vuw.ac.nz) by karazm.math.UH.EDU with SMTP id AA15148 (5.65c/IDA-1.4.4 for ); Mon, 21 Oct 1991 18:05:20 -0500 Received: from cit by mailhost.comp.vuw.ac.nz with 5.65cVUW/4.59 id ; Mon, 21 Oct 1991 19:01:09 -0400 Received: from cit1.cit.ac.nz by cit2.cit.ac.nz id aa00944; Mon, 21 Oct 91 17:38:40 NZT From: frankv@cit.ac.nz (Tutor) X-Mailer: SCO System V Mail (version 3.2) To: glove-list@karazm.math.uh.edu Date: Mon, 21 Oct 91 17:41:29 NZT Message-Id: <9110211741.aa05529@cit1.cit.ac.nz> Commenting on Dave Stampe's suggestions for a standard PowerGlove interface: > I would like to define the minimum functionality as: > - initialize with one call, which enters hi-res mode, sets up a timer interrupt every 4 mS, and initializes the code. > - an interrupt handler which: > - polls the glove for $A0 start code, exits if not ready > - if the glove was not ready after 500 tries, resets the glove mode > - reads the 6-byte data packet, and 2 more throwaway bytes > - deglitches and denoises the X and Y data (deglitches Z???) > - stores the data int the glove_int_data buffer > - sets the glove_int_data.new flag > - a glove_read routine which: > - disables interrupts > - copies the glove_int_data (including .new flag) to buffer > - clears the glove_int_data.new flag > - enables interrupts > - a reset routine (onexit(?)) which resets the timer interrupt > It is probably worthwhile to have a LORES and HIRES mode set on > initialization, which means that only the .keys data field is valid. > The timer interupt would happen less often, to reduce CPU interrupt > load. Total CPU load on a 386 looks to be about 3%. > Proposed names for routines: > int init_glove(int mode) > #define LORES 0 > #define HIRES 1 > void reset_glove() > int glove_read(glove_data *) /* returns 0 if old, 1 if new data */ > If we try to keep some interface stuff the same, everyone can develop > code for their machine that meets the specs. Then they can either be > combined or distibuted seperatly. I think this is a great idea. Here's my $0.02 worth: 1. Define what each function must do, not how to do it -- leave it as a black box. I intend to communicate with a glove-controller built here (when its done) via an RS-232 interface. In which case all this talk about interrupts is irrelevant. 2. I'd rather call change the name of reset_glove() to glove_quit() -- reset implies to me get ready to start, not get ready to exit the program. Frank.