Changeset e4f8c77 in mainline for uspace/srv/hid/input/ctl/pc.c
- Timestamp:
- 2011-07-13T22:39:18Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e6910c8
- Parents:
- 5974661 (diff), 8ecef91 (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/ctl/pc.c
r5974661 re4f8c77 1 1 /* 2 * Copyright (c) 20 09Jiri Svoboda2 * Copyright (c) 2011 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 28 28 29 29 /** @addtogroup kbd_ctl 30 * @ingroup kbd30 * @ingroup input 31 31 * @{ 32 32 */ … … 43 43 #include <gsp.h> 44 44 45 static void pc_ctl_parse(sysarg_t); 46 static int pc_ctl_init(kbd_dev_t *); 47 static void pc_ctl_set_ind(kbd_dev_t *, unsigned int); 48 49 kbd_ctl_ops_t pc_ctl = { 50 .parse = pc_ctl_parse, 51 .init = pc_ctl_init, 52 .set_ind = pc_ctl_set_ind 53 }; 54 45 55 enum dec_state { 46 56 ds_s, … … 64 74 65 75 static enum dec_state ds; 76 static kbd_dev_t *kbd_dev; 66 77 67 78 static int scanmap_simple[] = { … … 197 208 }; 198 209 199 int kbd_ctl_init(void)210 static int pc_ctl_init(kbd_dev_t *kdev) 200 211 { 212 kbd_dev = kdev; 201 213 ds = ds_s; 202 214 return 0; 203 215 } 204 216 205 void kbd_ctl_parse_scancode(int scancode)217 static void pc_ctl_parse(sysarg_t scancode) 206 218 { 207 219 kbd_event_type_t type; … … 245 257 } 246 258 247 if ((s cancode < 0) || ((size_t) scancode >= map_length))259 if ((size_t) scancode >= map_length) 248 260 return; 249 261 250 262 key = map[scancode]; 251 263 if (key != 0) 252 kbd_push_ev (type, key);264 kbd_push_event(kbd_dev, type, key); 253 265 } 254 266 255 void kbd_ctl_set_ind(unsigned mods)267 static void pc_ctl_set_ind(kbd_dev_t *kdev, unsigned mods) 256 268 { 257 269 uint8_t b; … … 265 277 b = b | LI_SCROLL; 266 278 267 kbd_port_write(KBD_CMD_SET_LEDS);268 kbd_port_write(b);279 (*kbd_dev->port_ops->write)(KBD_CMD_SET_LEDS); 280 (*kbd_dev->port_ops->write)(b); 269 281 } 270 282
Note:
See TracChangeset
for help on using the changeset viewer.