Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/input/port/niagara.c

    r593e023 rbf9cb2f  
    4848
    4949static int niagara_port_init(kbd_dev_t *);
     50static void niagara_port_yield(void);
     51static void niagara_port_reclaim(void);
    5052static void niagara_port_write(uint8_t data);
    5153
    5254kbd_port_ops_t niagara_port = {
    5355        .init = niagara_port_init,
     56        .yield = niagara_port_yield,
     57        .reclaim = niagara_port_reclaim,
    5458        .write = niagara_port_write
    5559};
     
    7579static input_buffer_t input_buffer = (input_buffer_t) AS_AREA_ANY;
    7680
     81static volatile bool polling_disabled = false;
    7782static void niagara_thread_impl(void *arg);
    7883
     
    105110}
    106111
     112static void niagara_port_yield(void)
     113{
     114        polling_disabled = true;
     115}
     116
     117static void niagara_port_reclaim(void)
     118{
     119        polling_disabled = false;
     120}
     121
    107122static void niagara_port_write(uint8_t data)
    108123{
     
    112127/**
    113128 * Called regularly by the polling thread. Reads codes of all the
    114  * pressed keys from the buffer.
     129 * pressed keys from the buffer. 
    115130 */
    116131static void niagara_key_pressed(void)
     
    134149
    135150        while (1) {
    136                 niagara_key_pressed();
     151                if (polling_disabled == false)
     152                        niagara_key_pressed();
    137153                usleep(POLL_INTERVAL);
    138154        }
Note: See TracChangeset for help on using the changeset viewer.