From 3819674d600070864e9d106294791627962aad50 Mon Sep 17 00:00:00 2001 From: tracer-ysyx Date: Wed, 10 Jan 2024 21:43:03 +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:43:0?= =?UTF-8?q?3=20=20up=202=20days=2020:43,=20=202=20users,=20=20load=20avera?= =?UTF-8?q?ge:=202.99,=201.81,=201.39?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- npc/core/src/main/scala/Keyboard.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/npc/core/src/main/scala/Keyboard.scala b/npc/core/src/main/scala/Keyboard.scala index 30159e0..16e39f1 100644 --- a/npc/core/src/main/scala/Keyboard.scala +++ b/npc/core/src/main/scala/Keyboard.scala @@ -80,8 +80,10 @@ class KeyboardSegController extends Module { when(io.keycode.bits === 0xF0.U) { release_state := true.B }.elsewhen(!release_state) { + when(io.keycode.bits =/= keycode) { + counter.inc() + } keycode := io.keycode.bits - counter.inc() }.otherwise{ // Release code on io.keycode.bits release_state := false.B