summaryrefslogtreecommitdiff
path: root/kernel/mouse.c
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-11-13 00:35:06 +0100
committerMichal Idziorek <m.i@gmx.at>2014-11-13 00:35:06 +0100
commitb126d01e9687e6509c9d49b1b174c95aee603a89 (patch)
treefe05187f4f9c28ef65bf530116c20c05f1a679b8 /kernel/mouse.c
parente3c4f3b03aa77ea19ddf7d982d39871dbdc018c0 (diff)
fixing implicit functions!
Diffstat (limited to 'kernel/mouse.c')
-rw-r--r--kernel/mouse.c79
1 files changed, 40 insertions, 39 deletions
diff --git a/kernel/mouse.c b/kernel/mouse.c
index 610baa8..910f0cf 100644
--- a/kernel/mouse.c
+++ b/kernel/mouse.c
@@ -19,6 +19,45 @@ static volatile uint8_t mouse_a;
uint8_t mouse_read();
+void mouse_wait(uint8_t a_type) //unsigned char
+{
+ uint32_t _time_out=100000; //unsigned int
+ if(a_type==0)
+ {
+ while(_time_out--) //Data
+ {
+ if((x86_inb(0x64) & 1)==1)
+ {
+ return;
+ }
+ }
+ return;
+ }
+ else
+ {
+ while(_time_out--) //Signal
+ {
+ if((x86_inb(0x64) & 2)==0)
+ {
+ return;
+ }
+ }
+ return;
+ }
+}
+
+void mouse_write(uint8_t a_write)
+{
+ //Wait to be able to send a command
+ mouse_wait(1);
+ //Tell the mouse we are sending a command
+ x86_outb(0x64, 0xD4);
+ //Wait for the final part
+ mouse_wait(1);
+ //Finally write
+ x86_outb(0x60, a_write);
+}
+
int8_t mouse_get_x()
{
return mouse_x;
@@ -97,7 +136,7 @@ void mouse_log()
//log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"%d / %d / %02x ",mouse_x, mouse_y,mouse_byte[2]);
- PutFont('X', mouse_x,600-mouse_y, 0xffffff);
+ //PutFont('X', mouse_x,600-mouse_y, 0xffffff);
}
//Mouse functions
@@ -134,41 +173,3 @@ uint8_t mouse_read()
return x86_inb(0x60);
}
-inline void mouse_write(uint8_t a_write)
-{
- //Wait to be able to send a command
- mouse_wait(1);
- //Tell the mouse we are sending a command
- x86_outb(0x64, 0xD4);
- //Wait for the final part
- mouse_wait(1);
- //Finally write
- x86_outb(0x60, a_write);
-}
-
-inline void mouse_wait(uint8_t a_type) //unsigned char
-{
- uint32_t _time_out=100000; //unsigned int
- if(a_type==0)
- {
- while(_time_out--) //Data
- {
- if((x86_inb(0x64) & 1)==1)
- {
- return;
- }
- }
- return;
- }
- else
- {
- while(_time_out--) //Signal
- {
- if((x86_inb(0x64) & 2)==0)
- {
- return;
- }
- }
- return;
- }
-}