- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

# mouse_task.h File Reference

,vThis file contains the function declarations More...

`#include "config.h"`

Include dependency graph for mouse_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
bit | is_usb_mouse_event (void)
| Is_usb_mouse_event.
void | sof_action (void)
| sof_action

## Detailed Description

,vThis file contains the function declarations

Copyright (c) 2004 Atmel.

Please read file license.txt for copyright notice.

Version:
  1.2 at90usb162-2enum-mouse_ms-1_0_1
  Id
    mouse_task.h,v 1.2 2006/12/12 13:52:18 arobert Exp

Todo:

Bug:

Definition in file mouse_task.h.

## Define Documentation

#define Is_usb_report_ready | ( |  | ) | (report_ready)

Definition at line 25 of file mouse_task.h.

Referenced by mouse_task_by_IT().

#define Usb_set_report_not_ready | ( |  | ) | (report_ready = 0)

Definition at line 26 of file mouse_task.h.

Referenced by mouse_task_by_IT().

#define Usb_set_report_ready | ( |  | ) | (report_ready = 1)

Definition at line 27 of file mouse_task.h.

## Function Documentation

bit is_usb_mouse_event | ( | void |  | ) |

Is_usb_mouse_event.

This function returns TRUE if a event occurs on the mouse (FALSE if not). The mouse report is updated by this function

Parameters:

  | none |

Returns:
  none

Definition at line 146 of file mouse_task.c.

References FALSE, Is_device_enumerated, Is_mouse_click_left_event, Is_mouse_down_event, Is_mouse_left_event, Is_mouse_release_left_event, Is_mouse_right_event, Is_mouse_up_event, TRUE, Usb_mouse_click_left, Usb_mouse_down, Usb_mouse_left, Usb_mouse_release_left, Usb_mouse_report_reset, Usb_mouse_right, and Usb_mouse_up.

Referenced by mouse_task_by_IT().

    00147 {
    00148    bit usb_mouse_event_stored;
    00149
    00150 // Following must not be used if interrupt handled task
    00151 //   if(cpt_sof<NB_IDLE_POLLING_SOF) return FALSE;
    00152 //   cpt_sof=0;
    00153
    00154    Usb_mouse_report_reset();
    00155
    00156    if(Is_device_enumerated())
    00157    {
    00158            // Check left click report
    00159       if(Is_mouse_click_left_event())
    00160       {
    00161          Usb_mouse_click_left();
    00162          usb_mouse_event_stored = 1;
    00163       }
    00164
    00165       if(Is_mouse_release_left_event())
    00166       {
    00167          Usb_mouse_release_left();
    00168          usb_mouse_event_stored = 1;
    00169       }
    00170
    00171       if (Is_mouse_left_event())
    00172       {
    00173         Usb_mouse_left();
    00174          usb_mouse_event_stored = 1;
    00175       }
    00176
    00177       if (Is_mouse_right_event())
    00178       {
    00179          Usb_mouse_right();
    00180          usb_mouse_event_stored = 1;
    00181       }
    00182
    00183       if (Is_mouse_down_event())
    00184       {
    00185          Usb_mouse_down();
    00186          usb_mouse_event_stored = 1;
    00187       }
    00188
    00189      if (Is_mouse_up_event())
    00190      {
    00191         Usb_mouse_up();
    00192         usb_mouse_event_stored = 1;
    00193      }
    00194
    00195      if (usb_mouse_event_stored == 1)
    00196      {
    00197         usb_mouse_event_stored = 0;
    00198         return TRUE;
    00199      }
    00200        else {return FALSE;}
    00201    }
    00202    return FALSE;
    00203 }