store uint8 ref in a let

This commit is contained in:
Rupus Reinefjord 2023-02-25 17:33:57 +01:00
parent db5a6e1246
commit 8a57662681

View file

@ -44,13 +44,14 @@ func diff(frame, newFrame: LcdFrame): FrameDiff =
proc send(cs: ChipState, cd: ChipDiff) = proc send(cs: ChipState, cd: ChipDiff) =
for pageIdx in 0..7: for pageIdx in 0..7:
for colIdx in 0..63: for colIdx in 0..63:
if cd[pageIdx][colIdx] == nil: let dataRef = cd[pageIdx][colIdx]
if dataRef == nil:
continue continue
if cs.page != pageIdx: if cs.page != pageIdx:
lcdSetPage(pageIdx) lcdSetPage(pageIdx)
if cs.address != colIdx: if cs.address != colIdx:
lcdSetAddress(colIdx) lcdSetAddress(colIdx)
lcdWriteData(cd[pageIdx][colIdx][]) lcdWriteData(dataRef[])
if cs.address == 63: if cs.address == 63:
if cs.page == 7: if cs.page == 7:
cs.page = 0 cs.page = 0