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);