STM32F746G-Disco Bd, doesn't display correctly in portrait mode
- January 4, 2019
- 13 replies
- 5025 views
I started a project from scratch in CubeMX.
and the set TouchGFX for portrait as :
Middleware->Graphics->TouchGFX, changed width : 272 and Height : 480.
In TouchGFX designer it displays correctly as Portrait(see PortraitFromTouchGFX).PNG) but when I compiled using IAR and deployed it on the target bd, it doesn’t display correctly (see From STM32F746-Disco Display.jpg )
In Hal.hpp : It automatically sets the display orientation based on width/height, so I don't think I need to do anything else. (Changing LTDC etc)
HAL(DMA_Interface& dmaInterface, LCD& display, TouchController& touchCtrl, uint16_t width, uint16_t height) :
dma(dmaInterface),
lcdRef(display),
touchController(touchCtrl),
mcuInstrumentation(0),
buttonController(0),
taskDelayFunc(0),
frameBuffer0(0),
frameBuffer1(0),
frameBuffer2(0),
refreshStrategy(REFRESH_STRATEGY_DEFAULT),
fingerSize(1),
lockDMAToPorch(true),
touchSampleRate(1),
mcuLoadPct(0),
vSyncCnt(0),
vSyncForFrame(1),
vSyncCompensationEnabled(false),
clientDirty(false),
swapRequested(false),
lastTouched(false),
updateMCULoad(0),
cc_begin(0),
displayOrientationChangeRequested(false)
{
instance = this;
DISPLAY_WIDTH = width;
DISPLAY_HEIGHT = height;
DISPLAY_ROTATION = rotate0;
FRAME_BUFFER_WIDTH = DISPLAY_WIDTH;
FRAME_BUFFER_HEIGHT = DISPLAY_HEIGHT;
nativeDisplayOrientation = ((width >= height) ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT);
}