Changeset a35b458 in mainline for kernel/genarch/src/kbrd/kbrd_at.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/kbrd/kbrd_at.c
r3061bc1 ra35b458 71 71 { 72 72 spinlock_lock(&instance->keylock); 73 73 74 74 switch (sc) { 75 75 case SC_LSHIFT: … … 87 87 break; 88 88 } 89 89 90 90 spinlock_unlock(&instance->keylock); 91 91 } … … 100 100 bool shift; 101 101 bool capslock; 102 102 103 103 spinlock_lock(&instance->keylock); 104 104 105 105 switch (sc) { 106 106 case SC_LSHIFT: … … 118 118 capslock = (instance->keyflags & PRESSED_CAPSLOCK) || 119 119 (instance->lockflags & LOCKED_CAPSLOCK); 120 120 121 121 if ((letter) && (capslock)) 122 122 shift = !shift; 123 123 124 124 if (shift) 125 125 indev_push_character(instance->sink, sc_secondary_map[sc]); … … 128 128 break; 129 129 } 130 130 131 131 spinlock_unlock(&instance->keylock); 132 132 } … … 137 137 static int is_locked = 0; 138 138 kbrd_instance_t *instance = (kbrd_instance_t *) arg; 139 139 140 140 while (true) { 141 141 wchar_t sc = indev_pop_character(&instance->raw); … … 162 162 } 163 163 } 164 164 165 165 } 166 166 } … … 174 174 instance->thread = thread_create(kkbrd, (void *) instance, TASK, 0, 175 175 "kkbrd"); 176 176 177 177 if (!instance->thread) { 178 178 free(instance); 179 179 return NULL; 180 180 } 181 181 182 182 instance->sink = NULL; 183 183 indev_initialize("kbrd", &instance->raw, &kbrd_raw_ops); 184 184 185 185 spinlock_initialize(&instance->keylock, "kbrd_at.instance.keylock"); 186 186 instance->keyflags = 0; 187 187 instance->lockflags = 0; 188 188 } 189 189 190 190 return instance; 191 191 } … … 195 195 assert(instance); 196 196 assert(sink); 197 197 198 198 instance->sink = sink; 199 199 thread_ready(instance->thread); 200 200 201 201 return &instance->raw; 202 202 }
Note:
See TracChangeset
for help on using the changeset viewer.