Listing 3 (key_brd.c)

/******************************************************
 * NAME  : key_msg
 * DESCRIPTION: get a key, decode, put in key queue
 ******************************************************/
#include "que.h"

extern struct g_queue key_que;

void key_msg()
{
   
   unsigned char position, key;
   
   position = (unsigned char)0x00;
   while ( 1 )
   {
      while (getkey(&position) < 0)
         suspend();
      insert_one(position,&key_que);
   }
}

/******************************************************
 * NAME: getkey
 * DESCRIPTION:get key position from interrupt routine
 ******************************************************/

getkey(position)
unsigned char *position;
{
   int x;
   /* has there been a read of keypad
    * is there a disable msg
    * if there has been a read - then
    * decode and verify the key then return
    * it in x
    */
   
   return x;
}