mirror of
git://projects.qi-hardware.com/iris.git
synced 2025-04-21 12:27:27 +03:00
removed old device handling
This commit is contained in:
@@ -211,50 +211,30 @@ Iris::Num start ():
|
||||
Iris::my_parent.init_done ()
|
||||
if kbd.scanning ():
|
||||
Iris::my_receiver.set_alarm (SCAN_INTERVAL)
|
||||
unsigned user (0), power_user (0)
|
||||
unsigned next_user (0)
|
||||
Iris::register_interrupt (IRQ_GPIO3)
|
||||
while true:
|
||||
Iris::wait ()
|
||||
switch Iris::recv.protected_data.h:
|
||||
case ~0:
|
||||
// Alarm.
|
||||
if Iris::recv.protected_data.h == ~0:
|
||||
// Alarm.
|
||||
kbd.scan ()
|
||||
if kbd.scanning ():
|
||||
Iris::my_receiver.set_alarm (SCAN_INTERVAL)
|
||||
continue
|
||||
switch Iris::recv.protected_data.l:
|
||||
case IRQ_GPIO3:
|
||||
// Interrupt.
|
||||
pwr.scan ()
|
||||
kbd.scan ()
|
||||
if kbd.scanning ():
|
||||
Iris::my_receiver.set_alarm (SCAN_INTERVAL)
|
||||
break
|
||||
case 0:
|
||||
switch Iris::recv.protected_data.l:
|
||||
case IRQ_GPIO3:
|
||||
// Interrupt.
|
||||
pwr.scan ()
|
||||
kbd.scan ()
|
||||
if kbd.scanning ():
|
||||
Iris::my_receiver.set_alarm (SCAN_INTERVAL)
|
||||
Iris::register_interrupt (IRQ_GPIO3)
|
||||
break
|
||||
case PWR:
|
||||
// Power button request.
|
||||
Iris::Cap reply = Iris::get_reply ()
|
||||
Iris::Cap arg = Iris::get_arg ()
|
||||
Iris::Device::host (PWR, power_user, reply, arg)
|
||||
break
|
||||
case KBD_DEV:
|
||||
// Keyboard device control request.
|
||||
Iris::Cap reply = Iris::get_reply ()
|
||||
Iris::Cap arg = Iris::get_arg ()
|
||||
Iris::Device::host (KBD_DEV, user, reply, arg)
|
||||
break
|
||||
default:
|
||||
break
|
||||
Iris::register_interrupt (IRQ_GPIO3)
|
||||
break
|
||||
case KBD_DEV:
|
||||
// Keyboard device user request.
|
||||
if Iris::recv.protected_data.l != user:
|
||||
kdebug ("invalid user requesting keyboard\n")
|
||||
Iris::recv.reply.invoke ()
|
||||
break
|
||||
switch Iris::recv.data[0].l:
|
||||
case Iris::Device::RESET:
|
||||
Iris::recv.reply.invoke ()
|
||||
break
|
||||
case Iris::Keyboard::SET_CB:
|
||||
Iris::Cap reply = Iris::get_reply ()
|
||||
kbd.active (Iris::get_arg ())
|
||||
@@ -272,11 +252,10 @@ Iris::Num start ():
|
||||
break
|
||||
break
|
||||
case PWR:
|
||||
if Iris::recv.protected_data.l != power_user:
|
||||
kdebug ("invalid user requesting power\n")
|
||||
Iris::recv.reply.invoke ()
|
||||
break
|
||||
switch Iris::recv.data[0].l:
|
||||
case Iris::Device::RESET:
|
||||
Iris::recv.reply.invoke ()
|
||||
break
|
||||
case Iris::Keyboard::SET_CB:
|
||||
Iris::Cap reply = Iris::get_reply ()
|
||||
pwr.set_cb (Iris::get_arg ())
|
||||
|
||||
Reference in New Issue
Block a user