From ea7a82b5a47509dcbc9cbbda465332b8eea0cf13 Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Mon, 10 Apr 2017 14:11:45 +0200 Subject: [PATCH] [ion/device] pushRectUniform goes in the same direction as the screen refresh Change-Id: Iec3cc67c20bd128bbd7d16b6132b2878fe883aa2 --- ion/src/device/display.cpp | 30 ++++++++++++++++++++---------- ion/src/device/display.h | 7 ++++++- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/ion/src/device/display.cpp b/ion/src/device/display.cpp index ffe92eccb..a0e9d85d1 100644 --- a/ion/src/device/display.cpp +++ b/ion/src/device/display.cpp @@ -18,19 +18,19 @@ namespace Display { void pushRect(KDRect r, const KDColor * pixels) { Device::waitForPendingDMAUploadCompletion(); - Device::setDrawingArea(r); + Device::setDrawingArea(r, Device::Orientation::Landscape); Device::pushPixels(pixels, r.width()*r.height()); } void pushRectUniform(KDRect r, KDColor c) { Device::waitForPendingDMAUploadCompletion(); - Device::setDrawingArea(r); + Device::setDrawingArea(r, Device::Orientation::Portrait); Device::pushColor(c, r.width()*r.height()); } void pullRect(KDRect r, KDColor * pixels) { Device::waitForPendingDMAUploadCompletion(); - Device::setDrawingArea(r); + Device::setDrawingArea(r, Device::Orientation::Landscape); Device::pullPixels(pixels, r.width()*r.height()); } @@ -56,7 +56,6 @@ namespace Device { #define SEND_COMMAND(c, ...) {*CommandAddress = Command::c; uint8_t data[] = {__VA_ARGS__}; for (unsigned int i=0;i> 8); diff --git a/ion/src/device/display.h b/ion/src/device/display.h index e29426592..e9147b90a 100644 --- a/ion/src/device/display.h +++ b/ion/src/device/display.h @@ -49,7 +49,12 @@ void shutdownFSMC(); void initPanel(); void shutdownPanel(); -void setDrawingArea(KDRect r); +enum class Orientation { + Landscape = 0, + Portrait = 1 +}; + +void setDrawingArea(KDRect r, Orientation o); void waitForPendingDMAUploadCompletion(); void pushPixels(const KDColor * pixels, size_t numberOfPixels); void pushColor(KDColor color, size_t numberOfPixels);