From 64a4f10ec75a82bb4a5ccdee4893749277db4462 Mon Sep 17 00:00:00 2001 From: Kilrah Date: Mon, 9 Oct 2017 09:56:37 +0200 Subject: [PATCH] X10 simu upright and working --- radio/src/gui/480x272/bitmapbuffer.h | 8 ++++---- radio/src/gui/480x272/lcd.cpp | 6 +++--- radio/src/targets/simu/simpgmspace.cpp | 3 +-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/radio/src/gui/480x272/bitmapbuffer.h b/radio/src/gui/480x272/bitmapbuffer.h index 1ff0ee34f..0d0074137 100644 --- a/radio/src/gui/480x272/bitmapbuffer.h +++ b/radio/src/gui/480x272/bitmapbuffer.h @@ -24,7 +24,7 @@ #include #include "colors.h" -#if defined(PCBX10) +#if defined(PCBX10) && !defined(SIMU) #define MOVE_PIXEL_RIGHT(p, count) p -= count #else #define MOVE_PIXEL_RIGHT(p, count) p += count @@ -86,7 +86,7 @@ class BitmapBufferBase inline const display_t * getPixelPtr(coord_t x, coord_t y) const { -#if defined(PCBX10) +#if defined(PCBX10) && !defined(SIMU) x = width - x - 1; y = height - y - 1; #endif @@ -165,7 +165,7 @@ class BitmapBuffer: public BitmapBufferBase inline const display_t * getPixelPtr(coord_t x, coord_t y) const { -#if defined(PCBX10) +#if defined(PCBX10) && !defined(SIMU) x = width - x - 1; y = height - y - 1; #endif @@ -174,7 +174,7 @@ class BitmapBuffer: public BitmapBufferBase inline display_t * getPixelPtr(coord_t x, coord_t y) { -#if defined(PCBX10) +#if defined(PCBX10) && !defined(SIMU) x = width - x - 1; y = height - y - 1; #endif diff --git a/radio/src/gui/480x272/lcd.cpp b/radio/src/gui/480x272/lcd.cpp index 0e86e8b93..a6d69df10 100644 --- a/radio/src/gui/480x272/lcd.cpp +++ b/radio/src/gui/480x272/lcd.cpp @@ -414,7 +414,7 @@ BitmapBuffer * lcd = &_lcd; void DMAFillRect(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color) { -#if defined(PCBX10) +#if defined(PCBX10) && !defined(SIMU) x = destw - (x + w); y = desth - (y + h); #endif @@ -428,7 +428,7 @@ void DMAFillRect(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x, ui void DMACopyBitmap(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x, uint16_t y, const uint16_t * src, uint16_t srcw, uint16_t srch, uint16_t srcx, uint16_t srcy, uint16_t w, uint16_t h) { -#if defined(PCBX10) +#if defined(PCBX10) && !defined(SIMU) x = destw - (x + w); y = desth - (y + h); srcx = srcw - (srcx + w); @@ -442,7 +442,7 @@ void DMACopyBitmap(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x, void DMACopyAlphaBitmap(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x, uint16_t y, const uint16_t * src, uint16_t srcw, uint16_t srch, uint16_t srcx, uint16_t srcy, uint16_t w, uint16_t h) { -#if defined(PCBX10) +#if defined(PCBX10) && !defined(SIMU) x = destw - (x + w); y = desth - (y + h); srcx = srcw - (srcx + w); diff --git a/radio/src/targets/simu/simpgmspace.cpp b/radio/src/targets/simu/simpgmspace.cpp index 425155cc9..e7647b4a0 100644 --- a/radio/src/targets/simu/simpgmspace.cpp +++ b/radio/src/targets/simu/simpgmspace.cpp @@ -212,8 +212,7 @@ void simuSetKey(uint8_t key, bool state) KEY_CASE(KEY_MODEL, KEYS_GPIO_REG_UP, KEYS_GPIO_PIN_UP) KEY_CASE(KEY_EXIT, KEYS_GPIO_REG_DOWN, KEYS_GPIO_PIN_DOWN) #elif defined(PCBX10) - // KEY_CASE(KEY_PGUP, KEYS_GPIO_REG_MENU, KEYS_GPIO_PIN_MENU) - // KEY_CASE(KEY_PGDN, KEYS_GPIO_REG_EXIT, KEYS_GPIO_PIN_EXIT) + KEY_CASE(KEY_PGDN, KEYS_GPIO_REG_PGDN, KEYS_GPIO_PIN_PGDN) KEY_CASE(KEY_ENTER, KEYS_GPIO_REG_ENTER, KEYS_GPIO_PIN_ENTER) KEY_CASE(KEY_TELEM, KEYS_GPIO_REG_RIGHT, KEYS_GPIO_PIN_RIGHT) KEY_CASE(KEY_RADIO, KEYS_GPIO_REG_LEFT, KEYS_GPIO_PIN_LEFT)