Rev 575 | Rev 588 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 575 | Rev 577 | ||
---|---|---|---|
Line 186... | Line 186... | ||
186 | arc_putchar('R'); |
186 | arc_putchar('R'); |
187 | arc_putchar('C'); |
187 | arc_putchar('C'); |
188 | arc_putchar('\n'); |
188 | arc_putchar('\n'); |
189 | } |
189 | } |
190 | 190 | ||
191 | static int kbd_polling_enabled; |
191 | static bool kbd_polling_enabled; |
192 | static chardev_t console; |
192 | static chardev_t console; |
193 | 193 | ||
194 | /** Try to get character, return character or -1 if not available */ |
194 | /** Try to get character, return character or -1 if not available */ |
195 | static void arc_keyboard_poll(void) |
195 | static void arc_keyboard_poll(void) |
196 | { |
196 | { |
Line 218... | Line 218... | ||
218 | arc_putchar(ch); |
218 | arc_putchar(ch); |
219 | } |
219 | } |
220 | 220 | ||
221 | static void arc_enable(chardev_t *dev) |
221 | static void arc_enable(chardev_t *dev) |
222 | { |
222 | { |
223 | kbd_polling_enabled = 1; |
223 | kbd_polling_enabled = true; |
224 | } |
224 | } |
225 | 225 | ||
226 | static void arc_disable(chardev_t *dev) |
226 | static void arc_disable(chardev_t *dev) |
227 | { |
227 | { |
228 | kbd_polling_enabled = 0; |
228 | kbd_polling_enabled = false; |
229 | } |
229 | } |
230 | 230 | ||
231 | static chardev_operations_t arc_ops = { |
231 | static chardev_operations_t arc_ops = { |
232 | .resume = arc_enable, |
232 | .resume = arc_enable, |
233 | .suspend = arc_disable, |
233 | .suspend = arc_disable, |
Line 244... | Line 244... | ||
244 | } |
244 | } |
245 | 245 | ||
246 | 246 | ||
247 | chardev_t * arc_console(void) |
247 | chardev_t * arc_console(void) |
248 | { |
248 | { |
249 | kbd_polling_enabled = 1; |
249 | kbd_polling_enabled = true; |
250 | 250 | ||
251 | chardev_initialize("arc_console", &console, &arc_ops); |
251 | chardev_initialize("arc_console", &console, &arc_ops); |
252 | old_timer = exc_register(TIMER_IRQ, "arc_kb_poll", timer_replace); |
252 | old_timer = exc_register(TIMER_IRQ, "arc_kb_poll", timer_replace); |
253 | return &console; |
253 | return &console; |
254 | } |
254 | } |