Changeset 15d0046 in mainline for uspace/srv/hid/input/port/niagara.c


Ignore:
Timestamp:
2014-09-12T13:22:33Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9b20126
Parents:
8db09e4 (diff), 105d8d6 (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:

Merge mainline changes

File:
1 edited

Legend:

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

    r8db09e4 r15d0046  
    4848
    4949static int niagara_port_init(kbd_dev_t *);
    50 static void niagara_port_yield(void);
    51 static void niagara_port_reclaim(void);
    5250static void niagara_port_write(uint8_t data);
    5351
    5452kbd_port_ops_t niagara_port = {
    5553        .init = niagara_port_init,
    56         .yield = niagara_port_yield,
    57         .reclaim = niagara_port_reclaim,
    5854        .write = niagara_port_write
    5955};
     
    7470        uint64_t read_ptr;
    7571        char data[INPUT_BUFFER_SIZE];
    76 }
    77         __attribute__ ((packed))
    78         __attribute__ ((aligned(PAGE_SIZE)))
    79         *input_buffer_t;
     72} __attribute__((packed)) __attribute__((aligned(PAGE_SIZE))) *input_buffer_t;
    8073
    8174/* virtual address of the shared buffer */
    82 static input_buffer_t input_buffer;
     75static input_buffer_t input_buffer = (input_buffer_t) AS_AREA_ANY;
    8376
    84 static volatile bool polling_disabled = false;
    8577static void niagara_thread_impl(void *arg);
    8678
    8779/**
    8880 * Initializes the Niagara driver.
    89  * Maps the shared buffer and creates the polling thread. 
     81 * Maps the shared buffer and creates the polling thread.
    9082 */
    9183static int niagara_port_init(kbd_dev_t *kdev)
     
    113105}
    114106
    115 static void niagara_port_yield(void)
    116 {
    117         polling_disabled = true;
    118 }
    119 
    120 static void niagara_port_reclaim(void)
    121 {
    122         polling_disabled = false;
    123 }
    124 
    125107static void niagara_port_write(uint8_t data)
    126108{
     
    130112/**
    131113 * Called regularly by the polling thread. Reads codes of all the
    132  * pressed keys from the buffer. 
     114 * pressed keys from the buffer.
    133115 */
    134116static void niagara_key_pressed(void)
     
    152134
    153135        while (1) {
    154                 if (polling_disabled == false)
    155                         niagara_key_pressed();
     136                niagara_key_pressed();
    156137                usleep(POLL_INTERVAL);
    157138        }
Note: See TracChangeset for help on using the changeset viewer.