home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_09_03 / 9n03038b < prev    next >
Text File  |  1991-01-22  |  937b  |  40 lines

  1.  /*********************************************************
  2.   * NAME       :  key_msg
  3.   * DESCRIPTION:  get a key, decode, put in key queue
  4.   **********************************************************/
  5. #include "que.h"
  6.  
  7. extern struct g_queue key_que;
  8.  
  9. void key_msg()
  10. {
  11.    unsigned char position, key;
  12.  
  13.    position = (unsigned char)0x00;
  14.    while ( 1 )
  15.    {
  16.       while (getkey(&position) < 0)
  17.          suspend();
  18.       insert_one(position,&key_que);
  19.    }
  20. }
  21.  
  22.  /*********************************************************
  23.   * NAME:  getkey
  24.   * DESCRIPTION:  get key position from interrupt routine
  25.   *********************************************************/
  26.  
  27. getkey(position)
  28. unsigned char *position;
  29. {
  30.    int x;
  31.    /* has there been a read of keypad
  32.     * is there a disable msg
  33.     * if there has been a read - then
  34.     *  decode and verify the key then return
  35.     *  it in x
  36.     */
  37.  
  38.    return x;
  39. }
  40.