diff --git a/waveshare2in13v2/controller.go b/waveshare2in13v2/controller.go index adcb53a..cd65897 100644 --- a/waveshare2in13v2/controller.go +++ b/waveshare2in13v2/controller.go @@ -66,16 +66,11 @@ func configDisplayMode(ctrl controller, mode PartialUpdate, lut LUT) { ctrl.sendCommand(writeDisplayOptionRegister) ctrl.sendData([]byte{0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00}) - if mode == Partial { - ctrl.sendCommand(displayUpdateControl2) - ctrl.sendData([]byte{ - displayUpdateEnableClock | - displayUpdateEnableAnalog, - }) - - ctrl.sendCommand(masterActivation) - } + // Start up the parts likely used by a draw operation soon. + ctrl.sendCommand(displayUpdateControl2) + ctrl.sendData([]byte{displayUpdateEnableClock | displayUpdateEnableAnalog}) + ctrl.sendCommand(masterActivation) ctrl.waitUntilIdle() } diff --git a/waveshare2in13v2/controller_test.go b/waveshare2in13v2/controller_test.go index 5c6436f..16496ae 100644 --- a/waveshare2in13v2/controller_test.go +++ b/waveshare2in13v2/controller_test.go @@ -92,6 +92,8 @@ func TestConfigDisplayMode(t *testing.T) { {cmd: borderWaveformControl, data: []byte{0x03}}, {cmd: writeLutRegister, data: bytes.Repeat([]byte{'F'}, 70)}, {cmd: 0x37, data: []byte{0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00}}, + {cmd: displayUpdateControl2, data: []byte{0xc0}}, + {cmd: masterActivation}, }, }, {