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 54 of file keyboard_task.h.

 
#define Usb_set_report_not_ready (  )     (report_ready = 0)

Definition at line 55 of file keyboard_task.h.

 
#define Usb_set_report_ready (  )     (report_ready = 1)

Definition at line 56 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 159 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.

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


Generated on Mon Sep 14 14:09:01 2009 for ATMEL by  doxygen 1.5.3