From a260adda927c514917487f565e2d242eeaabd80e Mon Sep 17 00:00:00 2001 From: tracer-ysyx Date: Wed, 10 Jan 2024 21:44:14 +0800 Subject: [PATCH] =?UTF-8?q?>=20build=5Fnpc=5FVKeyboard=5Fnvboard=20=20ysyx?= =?UTF-8?q?=5F22040000=20=E6=9D=8E=E5=BF=83=E6=9D=A8=20=20Linux=20calcite?= =?UTF-8?q?=206.1.69=20#1-NixOS=20SMP=20PREEMPT=5FDYNAMIC=20Wed=20Dec=2020?= =?UTF-8?q?=2016:00:29=20UTC=202023=20x86=5F64=20GNU/Linux=20=20=2021:44:1?= =?UTF-8?q?4=20=20up=202=20days=2020:44,=20=202=20users,=20=20load=20avera?= =?UTF-8?q?ge:=201.59,=201.63,=201.35?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- npc/core/src/main/scala/Keyboard.scala | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/npc/core/src/main/scala/Keyboard.scala b/npc/core/src/main/scala/Keyboard.scala index 16e39f1..716c304 100644 --- a/npc/core/src/main/scala/Keyboard.scala +++ b/npc/core/src/main/scala/Keyboard.scala @@ -64,6 +64,7 @@ class KeyboardSegController extends Module { io.keycode.ready := true.B } + // 0x1C.U -> 0x41.U, ... val keycode_to_ascii = Seq( 0x1C.U, 0x32.U, 0x21.U, 0x23.U, 0x24.U, 0x2B.U, 0x34.U, 0x33.U, 0x43.U, 0x3B.U, 0x42.U, 0x4B.U, @@ -80,9 +81,7 @@ class KeyboardSegController extends Module { when(io.keycode.bits === 0xF0.U) { release_state := true.B }.elsewhen(!release_state) { - when(io.keycode.bits =/= keycode) { - counter.inc() - } + counter.inc() keycode := io.keycode.bits }.otherwise{ // Release code on io.keycode.bits