From 8c7eed8d38e40431cb5f39c4c18a32c3fc7b9ec3 Mon Sep 17 00:00:00 2001 From: Daniel Esteban Date: Sun, 23 Feb 2020 19:52:22 +0100 Subject: [PATCH] some fixes on ili9341 driver --- ili9341/ili9341.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ili9341/ili9341.go b/ili9341/ili9341.go index 75b3585..2ff82c6 100644 --- a/ili9341/ili9341.go +++ b/ili9341/ili9341.go @@ -35,6 +35,7 @@ func (d *Device) Configure(config Config) { } d.width = config.Width d.height = config.Height + d.rotation = config.Rotation output := machine.PinConfig{machine.PinOutput} @@ -112,6 +113,7 @@ func (d *Device) Configure(config Config) { i += numArgs + 2 } + d.SetRotation(d.rotation) } // Size returns the current size of the display. @@ -252,7 +254,7 @@ func (d *Device) setWindow(x, y, w, h int16) { //x += d.columnOffset //y += d.rowOffset d.sendCommand(CASET, []uint8{ - uint8(x << 8), uint8(x), uint8((x + w - 1) >> 8), uint8(x + w - 1), + uint8(x >> 8), uint8(x), uint8((x + w - 1) >> 8), uint8(x + w - 1), }) d.sendCommand(PASET, []uint8{ uint8(y >> 8), uint8(y), uint8((y + h - 1) >> 8), uint8(y + h - 1),