Subversion Repositories HelenOS-historic

Rev

Rev 520 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 520 Rev 521
Line 1... Line 1...
1
/*
1
/*
2
 * Copyright (C) 2003 Josef Cejka
2
 * Copyright (C) 2003 Josef Cejka
3
 * Copyright (C) 2005 Jakub Jermar
3
 * Copyright (C) 2005 Jakub Jermar
-
 
4
 * Copyright (C) 2005 Jakub Vana
4
 * All rights reserved.
5
 * All rights reserved.
5
 *
6
 *
6
 * Redistribution and use in source and binary forms, with or without
7
 * Redistribution and use in source and binary forms, with or without
7
 * modification, are permitted provided that the following conditions
8
 * modification, are permitted provided that the following conditions
8
 * are met:
9
 * are met:
Line 52... Line 53...
52
/** Initialize keyboard subsystem. */
53
/** Initialize keyboard subsystem. */
53
void keyboard_init(void)
54
void keyboard_init(void)
54
{
55
{
55
    chardev_initialize(&kbrd, &ops);
56
    chardev_initialize(&kbrd, &ops);
56
    stdin = &kbrd;
57
    stdin = &kbrd;
57
    kb_disable = 0;
58
    kb_disable = false;
58
}
59
}
59
 
60
 
60
/** Process keyboard interrupt. */
61
/** Process keyboard interrupt. */
61
void keyboard(void)
62
void poll_keyboard(void)
62
{
63
{
63
    if(kb_disable) return;
64
    if(kb_disable) return;
64
    char ch;
65
    char ch;
65
 
66
 
66
    ch = ski_getchar();
67
    ch = ski_getchar();
67
    if(ch==13) ch=10;
68
    if(ch=='\r') ch='\n';
68
    if(ch) chardev_push_character(&kbrd, ch);
69
    if(ch) chardev_push_character(&kbrd, ch);
69
   
70
   
70
}
71
}
71
 
72
 
72
/* Called from getc(). */
73
/* Called from getc(). */
73
void keyboard_enable(void)
74
void keyboard_enable(void)
74
{
75
{
75
    kb_disable=0;
76
    kb_disable=false;
76
}
77
}
77
 
78
 
78
/* Called from getc(). */
79
/* Called from getc(). */
79
void keyboard_disable(void)
80
void keyboard_disable(void)
80
{
81
{
81
    kb_disable=1;  
82
    kb_disable=true;   
82
}
83
}