keyboard_task.h File Reference

#include "config.h"

Include dependency graph for keyboard_task.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define Is_usb_report_ready()   (report_ready)
#define Usb_set_report_not_ready()   (report_ready = 0)
#define Usb_set_report_ready()   (report_ready = 1)

Functions

void sof_action (void)
void kbd_test_hit (void)


Detailed Description

This file contains the function declarations - Compiler: IAR EWAVR and GNU GCC for AVR

Definition in file keyboard_task.h.


Define Documentation

 
#define Is_usb_report_ready (  )     (report_ready)

Definition at line 51 of file keyboard_task.h.

 
#define Usb_set_report_not_ready (  )     (report_ready = 0)

Definition at line 52 of file keyboard_task.h.

 
#define Usb_set_report_ready (  )     (report_ready = 1)

Definition at line 53 of file keyboard_task.h.


Function Documentation

void sof_action ( void   ) 

void kbd_test_hit ( void   ) 

Chech keyboard key hit This function scans the keyboard keys and update the scan_key word. if a key is pressed, the key_hit bit is set to TRUE.

Definition at line 156 of file keyboard_task.c.

References FALSE, Is_btn_middle, key_hit, SIZEOF_USB_KEYS, transmit_no_key, TRUE, usb_data_to_send, usb_kbd_state, usb_key, usb_key_pointer, and usb_keys.

00157 {
00158    switch (usb_kbd_state)
00159    {
00160       case 0:
00161       if (Is_btn_middle())
00162       {
00163          usb_kbd_state = 1;
00164          usb_key_pointer = usb_keys;
00165          usb_data_to_send = SIZEOF_USB_KEYS;
00166       }
00167       break;
00168 
00169       case 1:
00170       if (usb_data_to_send != 0)
00171       {
00172          if ((key_hit == FALSE) && (transmit_no_key == FALSE))
00173          {
00174 #ifndef __GNUC__
00175             usb_key = *usb_key_pointer++;
00176 #else
00177             usb_key = pgm_read_byte_near(usb_key_pointer++);
00178 #endif
00179             usb_data_to_send --;
00180             key_hit = TRUE;
00181          }
00182       }
00183       else
00184       {
00185          usb_kbd_state = 0;
00186       }
00187       break;
00188    }
00189 }


Generated on Fri Oct 31 15:59:43 2008 for ATMEL by  doxygen 1.5.3