Changeset 7309799 in mainline


Ignore:
Timestamp:
2011-03-10T14:13:15Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e8c1fb0
Parents:
17ada7a
Message:

Comments of kbdrepeat functions + minor changes to comments in kbddev.

Location:
uspace/drv/usbhid
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhid/kbddev.c

    r17ada7a r7309799  
    484484 * @param count Number of key codes in report (size of the report).
    485485 * @param modifiers Bitmap of modifiers (Ctrl, Alt, Shift, GUI).
    486  * @param arg User-specified argument.
     486 * @param arg User-specified argument. Expects pointer to the keyboard device
     487 *            structure representing the keyboard.
    487488 *
    488489 * @sa usbhid_kbd_check_key_changes(), usbhid_kbd_check_modifier_changes()
  • uspace/drv/usbhid/kbdrepeat.c

    r17ada7a r7309799  
    4545#include "kbddev.h"
    4646
     47
     48/** Delay between auto-repeat state checks when no key is being repeated. */
    4749static unsigned int CHECK_DELAY = 10000;
    4850
    4951/*----------------------------------------------------------------------------*/
    50 
     52/**
     53 * Main loop handling the auto-repeat of keys.
     54 *
     55 * This functions periodically checks if there is some key to be auto-repeated.
     56 *
     57 * If a new key is to be repeated, it uses the delay before first repeat stored
     58 * in the keyboard structure to wait until the key has to start repeating.
     59 *
     60 * If the same key is still pressed, it uses the delay between repeats stored
     61 * in the keyboard structure to wait until the key should be repeated.
     62 *
     63 * If the currently repeated key is not pressed any more (
     64 * usbhid_kbd_repeat_stop() was called), it stops repeating it and starts
     65 * checking again.
     66 *
     67 * @note For accessing the keyboard device auto-repeat information a fibril
     68 *       mutex (repeat_mtx) from the @a kbd structure is used.
     69 *
     70 * @param kbd Keyboard device structure.
     71 */
    5172static void usbhid_kbd_repeat_loop(usbhid_kbd_t *kbd)
    5273{
     
    86107
    87108/*----------------------------------------------------------------------------*/
    88 
     109/**
     110 * Main routine to be executed by a fibril for handling auto-repeat.
     111 *
     112 * Starts the loop for checking changes in auto-repeat.
     113 *
     114 * @param arg User-specified argument. Expects pointer to the keyboard device
     115 *            structure representing the keyboard.
     116 *
     117 * @retval EOK if the routine has finished.
     118 * @retval EINVAL if no argument is supplied.
     119 */
    89120int usbhid_kbd_repeat_fibril(void *arg)
    90121{
     
    104135
    105136/*----------------------------------------------------------------------------*/
    106 
     137/**
     138 * Start repeating particular key.
     139 *
     140 * @note Only one key is repeated at any time, so calling this function
     141 *       effectively cancels auto-repeat of the current repeated key (if any)
     142 *       and 'schedules' another key for auto-repeat.
     143 *
     144 * @param kbd Keyboard device structure.
     145 * @param key Key to start repeating.
     146 */
    107147void usbhid_kbd_repeat_start(usbhid_kbd_t *kbd, unsigned int key)
    108148{
     
    113153
    114154/*----------------------------------------------------------------------------*/
    115 
     155/**
     156 * Stop repeating particular key.
     157 *
     158 * @note Only one key is repeated at any time, but this function may be called
     159 *       even with key that is not currently repeated (in that case nothing
     160 *       happens).
     161 *
     162 * @param kbd Keyboard device structure.
     163 * @param key Key to stop repeating.
     164 */
    116165void usbhid_kbd_repeat_stop(usbhid_kbd_t *kbd, unsigned int key)
    117166{
Note: See TracChangeset for help on using the changeset viewer.