From 55168296940f9494d7e65a13a9abb00665f4ae2c Mon Sep 17 00:00:00 2001 From: Drath Date: Sun, 2 Nov 2025 13:25:48 +0100 Subject: [PATCH] we can simply memcpy instead --- src/LCDDisplay.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/LCDDisplay.cpp b/src/LCDDisplay.cpp index 78bed28..46fcf94 100644 --- a/src/LCDDisplay.cpp +++ b/src/LCDDisplay.cpp @@ -85,9 +85,8 @@ void LCDDisplay::setCursor(uint8_t row, uint8_t col) { } void LCDDisplay::setCustomChar(uint8_t index, std::array cchar) { - uint8_t cmdbuf[11] = {254, 78, index, 0, 0, 0, 0, 0, 0, 0, 0}; - for (uint8_t i = 0; i < 8; i++) - cmdbuf[i + 3] = cchar[i]; + uint8_t cmdbuf[] = {254, 78, index, 0, 0, 0, 0, 0, 0, 0, 0}; + std::memcpy(&cmdbuf[3], &cchar, cchar.size()); ::write(_lcd, &cmdbuf, 11); }