Changeset 9c0f158 in mainline for uspace/drv/usbkbd/kbdrepeat.c


Ignore:
Timestamp:
2011-03-25T15:21:01Z (13 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
57d9c05e
Parents:
96bfe76 (diff), f08c560 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

development merge

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbkbd/kbdrepeat.c

    r96bfe76 r9c0f158  
    6262 *
    6363 * If the currently repeated key is not pressed any more (
    64  * usbhid_kbd_repeat_stop() was called), it stops repeating it and starts
     64 * usb_kbd_repeat_stop() was called), it stops repeating it and starts
    6565 * checking again.
    6666 *
     
    7070 * @param kbd Keyboard device structure.
    7171 */
    72 static void usbhid_kbd_repeat_loop(usbhid_kbd_t *kbd)
     72static void usb_kbd_repeat_loop(usb_kbd_t *kbd)
    7373{
    7474        unsigned int delay = 0;
     
    7878        while (true) {
    7979                // check if the kbd structure is usable
    80                 if (!usbhid_kbd_is_usable(kbd)) {
    81                         usbhid_kbd_free(&kbd);
    82                         assert(kbd == NULL);
     80                if (!usb_kbd_is_initialized(kbd)) {
     81                        if (usb_kbd_is_ready_to_destroy(kbd)) {
     82                                usb_kbd_free(&kbd);
     83                                assert(kbd == NULL);
     84                        }
    8385                        return;
    8486                }
     
    9092                                usb_log_debug2("Repeating key: %u.\n",
    9193                                    kbd->repeat.key_repeated);
    92                                 usbhid_kbd_push_ev(kbd, KEY_PRESS,
     94                                usb_kbd_push_ev(kbd, KEY_PRESS,
    9395                                    kbd->repeat.key_repeated);
    9496                                delay = kbd->repeat.delay_between;
     
    125127 * @retval EINVAL if no argument is supplied.
    126128 */
    127 int usbhid_kbd_repeat_fibril(void *arg)
     129int usb_kbd_repeat_fibril(void *arg)
    128130{
    129131        usb_log_debug("Autorepeat fibril spawned.\n");
     
    134136        }
    135137       
    136         usbhid_kbd_t *kbd = (usbhid_kbd_t *)arg;
     138        usb_kbd_t *kbd = (usb_kbd_t *)arg;
    137139       
    138         usbhid_kbd_repeat_loop(kbd);
     140        usb_kbd_repeat_loop(kbd);
    139141       
    140142        return EOK;
     
    152154 * @param key Key to start repeating.
    153155 */
    154 void usbhid_kbd_repeat_start(usbhid_kbd_t *kbd, unsigned int key)
     156void usb_kbd_repeat_start(usb_kbd_t *kbd, unsigned int key)
    155157{
    156158        fibril_mutex_lock(kbd->repeat_mtx);
     
    170172 * @param key Key to stop repeating.
    171173 */
    172 void usbhid_kbd_repeat_stop(usbhid_kbd_t *kbd, unsigned int key)
     174void usb_kbd_repeat_stop(usb_kbd_t *kbd, unsigned int key)
    173175{
    174176        fibril_mutex_lock(kbd->repeat_mtx);
Note: See TracChangeset for help on using the changeset viewer.