From 8a57662681ad7654e2c59e58e181cb366f73b4ab Mon Sep 17 00:00:00 2001 From: Rupus Reinefjord Date: Sat, 25 Feb 2023 17:33:57 +0100 Subject: [PATCH] store uint8 ref in a let --- abstractlcd.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/abstractlcd.nim b/abstractlcd.nim index c1c8502..03d3586 100644 --- a/abstractlcd.nim +++ b/abstractlcd.nim @@ -44,13 +44,14 @@ func diff(frame, newFrame: LcdFrame): FrameDiff = proc send(cs: ChipState, cd: ChipDiff) = for pageIdx in 0..7: for colIdx in 0..63: - if cd[pageIdx][colIdx] == nil: + let dataRef = cd[pageIdx][colIdx] + if dataRef == nil: continue if cs.page != pageIdx: lcdSetPage(pageIdx) if cs.address != colIdx: lcdSetAddress(colIdx) - lcdWriteData(cd[pageIdx][colIdx][]) + lcdWriteData(dataRef[]) if cs.address == 63: if cs.page == 7: cs.page = 0