From 7683fbc44811b9c84e5a6c0d9fe7000ea414d63c Mon Sep 17 00:00:00 2001 From: Laurence Bank Date: Sun, 20 Oct 2024 19:27:01 +0100 Subject: [PATCH] Fixed UC81xx writePlane to set the address window and use the correct memory plane --- examples/partial_update/partial_update.ino | 2 +- src/bb_ep.inl | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/partial_update/partial_update.ino b/examples/partial_update/partial_update.ino index bffce6b..1907cba 100644 --- a/examples/partial_update/partial_update.ino +++ b/examples/partial_update/partial_update.ino @@ -73,7 +73,7 @@ void setup() DrawScene(i, 1); // new scene drawn to plane 1 bbep.refresh(REFRESH_PARTIAL); bbep.wait(); -// bbep.sleep(LIGHT_SLEEP); + bbep.sleep(LIGHT_SLEEP); } // for i delay(5000); // wait 5 seconds, then erase to white bbep.setPlane(0); diff --git a/src/bb_ep.inl b/src/bb_ep.inl index 4984ee3..65ff691 100644 --- a/src/bb_ep.inl +++ b/src/bb_ep.inl @@ -1448,9 +1448,11 @@ int bbepWritePlane(BBEPDISP *pBBEP, int iPlane) if (pBBEP == NULL || pBBEP->ucScreen == NULL || iPlane < PLANE_0 || iPlane > PLANE_DUPLICATE) return BBEP_ERROR_BAD_PARAMETER; + bbepSetAddrWindow(pBBEP, 0,0, pBBEP->native_width, pBBEP->native_height); + if (pBBEP->chip_type == BBEP_CHIP_UC81xx) { - ucCMD1 = UC8151_DTM1; - ucCMD2 = UC8151_DTM2; + ucCMD1 = UC8151_DTM2; + ucCMD2 = UC8151_DTM1; } else { ucCMD1 = SSD1608_WRITE_RAM; ucCMD2 = SSD1608_WRITE_ALTRAM;