Changeset 6a44ee4 in mainline for uspace/srv/hid/input/port/niagara.c
- Timestamp:
- 2011-07-20T15:26:21Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- efcebe1
- Parents:
- 25bef0ff (diff), a701812 (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. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/input/port/niagara.c
r25bef0ff r6a44ee4 1 1 /* 2 2 * Copyright (c) 2008 Pavel Rimsky 3 * Copyright (c) 2011 Jiri Svoboda 3 4 * All rights reserved. 4 5 * … … 46 47 #include <errno.h> 47 48 49 static int niagara_port_init(kbd_dev_t *); 50 static void niagara_port_yield(void); 51 static void niagara_port_reclaim(void); 52 static void niagara_port_write(uint8_t data); 53 54 kbd_port_ops_t niagara_port = { 55 .init = niagara_port_init, 56 .yield = niagara_port_yield, 57 .reclaim = niagara_port_reclaim, 58 .write = niagara_port_write 59 }; 60 61 static kbd_dev_t *kbd_dev; 62 48 63 #define POLL_INTERVAL 10000 49 64 … … 70 85 71 86 /* virtual address of the shared buffer */ 72 input_buffer_t input_buffer;87 static input_buffer_t input_buffer; 73 88 74 89 static volatile bool polling_disabled = false; … … 79 94 * Maps the shared buffer and creates the polling thread. 80 95 */ 81 int kbd_port_init(void)96 static int niagara_port_init(kbd_dev_t *kdev) 82 97 { 98 kbd_dev = kdev; 99 83 100 sysarg_t paddr; 84 101 if (sysinfo_get_value("niagara.inbuf.address", &paddr) != EOK) … … 105 122 } 106 123 107 void kbd_port_yield(void)124 static void niagara_port_yield(void) 108 125 { 109 126 polling_disabled = true; 110 127 } 111 128 112 void kbd_port_reclaim(void)129 static void niagara_port_reclaim(void) 113 130 { 114 131 polling_disabled = false; 115 132 } 116 133 117 void kbd_port_write(uint8_t data)134 static void niagara_port_write(uint8_t data) 118 135 { 119 136 (void) data; … … 131 148 c = input_buffer->data[input_buffer->read_ptr]; 132 149 input_buffer->read_ptr = 133 134 kbd_push_ scancode(c);150 ((input_buffer->read_ptr) + 1) % INPUT_BUFFER_SIZE; 151 kbd_push_data(kbd_dev, c); 135 152 } 136 153 } 137 154 138 155 /** 139 * Thread to poll SGCNfor keypresses.156 * Thread to poll Niagara console for keypresses. 140 157 */ 141 158 static void niagara_thread_impl(void *arg)
Note:
See TracChangeset
for help on using the changeset viewer.