From e28c482d5d6f3c24dce6af066e2a9e18cf5efae8 Mon Sep 17 00:00:00 2001 From: tracer-ysyx Date: Tue, 9 Jan 2024 20:50:18 +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=2020:50:1?= =?UTF-8?q?8=20=20up=201=20day=2019:51,=20=202=20users,=20=20load=20averag?= =?UTF-8?q?e:=200.65,=200.62,=200.77?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- npc/core/src/main/scala/Keyboard.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/npc/core/src/main/scala/Keyboard.scala b/npc/core/src/main/scala/Keyboard.scala index d523a84..dadd762 100644 --- a/npc/core/src/main/scala/Keyboard.scala +++ b/npc/core/src/main/scala/Keyboard.scala @@ -59,11 +59,11 @@ class KeyboardController extends Module { class SegHandler(seg_count: Int) extends Module { val io = IO(new Bundle { val keycode = Flipped(Decoupled(UInt(8.W))) - val segs = Output(Vec(seg_count / 2, UInt(8.W))) + val segs = Output(Vec(seg_count / 2, UInt(16.W))) }) - val seg_regs = RegInit(VecInit(Seq.fill(seg_count / 2)(0.U(8.W)))) + val seg_regs = RegInit(VecInit(Seq.fill(seg_count / 2)(0.U(16.W)))) val last_keycode = RegInit(0.U(8.W)) val counter = Counter(0xFF) val digit_to_seg = Seq( @@ -103,7 +103,7 @@ class SegHandler(seg_count: Int) extends Module { } seg_regs := Seq(counter.value, last_keycode, last_keycode).map(d => { - MuxLookup(d & 0xF.U, 0.U)(digit_to_seg) | (MuxLookup((d >> 4.U) & 0xF.U, 0.U)(digit_to_seg) << 4.U) + MuxLookup(d & 0xF.U, 0.U)(digit_to_seg) | (MuxLookup((d >> 4.U) & 0xF.U, 0.U)(digit_to_seg) << 8.U) }) }