

   +------------+
   | MORRIS     |
   |            |
   |     PS2(1) |------------------------ Ext keyboard (or mouse)
   |            |
   |            |      o----------------- Ext mouse
   |            |     
   |     PS2(2) |----*
   |            |     \      +---+
   |            |      o-----|   | Internal
   |            |            |   | trackerball
   +------------+            +---+
         |
         |
         |
   +------------+
   | KDB micro  |
   +------------+



PS2Driver monitors Portable_Control service call.
If trackball/mouse line changes, reset approprate channel.
Must monitor mouse power lines as well.
 [ As channel is powered down, set the state machine into
   a 'no action' loop, incase spurious interrupts occur
   as the power disappears.

   On power-up, take state machine out of 'no action' loop
   call SendRESET.
 ]



Portable module can have a one-second ticker to monitor the
connector replicator.

When connector replicator appears, issue Portable_Control to
switch to external mouse. Set up callback handler, time
delay 1-2 second. Handler asks PS2Driver if anything has
responded on that channel. If not, issue Portable_Control
to switch back to internal trackerball.

When connector replicator is removed, switch to LCD (iff using monitor)
switch to trackerball (iff using external device).



When to power down trackerball?
Better not to do it at screenblank time, as user may wish
to move the trackerball to unblank the screen.
Can be turned off at freeze time.


Trackerball power TrackerballNotMouse
    Off                  Off
    On                   Off           pointless, wastes power
    Off                  On            sensible power saving state
    On                   On            


Should we specify that the docking connector should
be connected/removed with machine frozen?

On thaw, we can look for ext keyboard and mouse.


26/4/95

Why not redefine meanings of bits 17 & 18 of Portable_Control as
 Bit 17  Trackerball enable
 Bit 18  External mouse enable

whose states are:

Trackball ExtMouse
   0         0
   1         0   Trackball
   0         1   ExtMouse
   1         1   Illegal - force to 0 1 state, ie ExtMouse

If we receive a powerdown message for Trackball or ExtMouse (only
one is switching off, cos only one allowed on at a time), then
put state machine into 'no action' loop.

If we receive a powerup message for Trackball or ExtMouse (only
one is switching on, cos only one allowed on at a time), then
call SendRESET put state machine into 'wait for ack from reset'
state.

NB In the case of switching from one device to another, we receive
   an off service call for the old device THEN an on service for the
   new device.

