diff options
| author | Miguel <m.i@gmx.at> | 2018-10-01 23:22:03 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-10-01 23:22:03 +0200 |
| commit | a455cd5af26bf8731e7c981a9421b16ab34dae6f (patch) | |
| tree | 140b184bf306cef258ba6e7965a78b3eecb598b9 /driver/mouse.c | |
| parent | b518f39803eaaf0b25b95baf951b12ef4d5a727e (diff) | |
fukkin scheduler
Diffstat (limited to 'driver/mouse.c')
| -rw-r--r-- | driver/mouse.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/driver/mouse.c b/driver/mouse.c index d0f1591..810cb83 100644 --- a/driver/mouse.c +++ b/driver/mouse.c @@ -19,12 +19,17 @@ static ringbuffer mouse_in; bool mouse_worker() { - bool wake=false; - while(ringbuffer_has(&mouse_in)){ - mouse_handler(ringbuffer_get(&mouse_in)); - wake=true; - } - return wake; + if(ringbuffer_full(&mouse_in)) + { + klog("mouse buffer full"); + } + + bool wake=false; + while(ringbuffer_has(&mouse_in)){ + mouse_handler(ringbuffer_get(&mouse_in)); + wake=true; + } + return wake; } @@ -121,7 +126,7 @@ void mouse_action() if(mouse_byte[0]&0x80||mouse_byte[0]&0x40) { - klog("mouse overflow, skipping packet"); + // klog("mouse overflow, skipping packet"); return; //skip packet on overflow } @@ -146,6 +151,7 @@ void mouse_action() if(mouse_x<0)mouse_x=0; if(mouse_y<0)mouse_y=0; + if(mouse_x>=1920)mouse_x=1920-1; if(mouse_y>=1080)mouse_y=1080-1; @@ -164,7 +170,7 @@ void mouse_handler(uint8_t byte)//struct regs *a_r) //struct regs *a_r (not used mouse_cycle++; if(!(mouse_byte[0]&0x8)) { - klog("mouse out of sync, try resync"); + //klog("mouse out of sync, try resync"); mouse_cycle--; // kpanic("mouse packets out of sync!?"); // this bit is always 1, otherwise panic! } |
