mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
emulation: keyboard: support "Wake Up" sequence
The hardcoded sequence "F1+F4" will wake a device that is suspended. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
b5a858938a
commit
d7c2033273
1 changed files with 15 additions and 1 deletions
|
|
@ -63,7 +63,8 @@ namespace Antmicro.Renode.Peripherals.Input
|
|||
},
|
||||
writeCallback: (_, value) =>
|
||||
{
|
||||
if (value != 0) {
|
||||
if (value != 0)
|
||||
{
|
||||
injectedKeys.Enqueue((char)value);
|
||||
UpdateInterrupts();
|
||||
}
|
||||
|
|
@ -230,6 +231,18 @@ namespace Antmicro.Renode.Peripherals.Input
|
|||
this.irqKeyPressedStatus = true;
|
||||
this.UpdateInterrupts();
|
||||
this.irqKeyPressedStatus = false;
|
||||
|
||||
// Wake the machine if it's suspended.
|
||||
if (PressedKeys.ContainsKey(KeyScanCode.F1)
|
||||
&& PressedKeys.ContainsKey(KeyScanCode.F4)
|
||||
&& (scanCode == KeyScanCode.F1 || scanCode == KeyScanCode.F4)
|
||||
&& isPress
|
||||
&& machine.IsPaused
|
||||
)
|
||||
{
|
||||
this.Log(LogLevel.Debug, "Resuming machine");
|
||||
machine.Start();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -256,6 +269,7 @@ namespace Antmicro.Renode.Peripherals.Input
|
|||
irqKeyPressedPending.Value = false;
|
||||
irqInjectEnabled.Value = false;
|
||||
irqInjectPending.Value = false;
|
||||
RegistersCollection.Reset();
|
||||
}
|
||||
|
||||
private Dictionary<KeyScanCode, bool> PressedKeys = new Dictionary<KeyScanCode, bool> { };
|
||||
|
|
|
|||
Loading…
Reference in a new issue