landscape mode options
Dependents: DISCO-F429ZI_LCDTS_demo_richard
Fork of LCD_DISCO_F429ZI by
Revision 2:55b265685e55, committed 2018-03-16
- Comitter:
- pierrebizouard
- Date:
- Fri Mar 16 09:56:25 2018 +0000
- Parent:
- 1:1bcdc0162217
- Commit message:
- added copy layer
Changed in this revision
LCD_DISCO_F429ZI.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 1bcdc0162217 -r 55b265685e55 LCD_DISCO_F429ZI.cpp --- a/LCD_DISCO_F429ZI.cpp Fri Mar 09 13:25:22 2018 +0000 +++ b/LCD_DISCO_F429ZI.cpp Fri Mar 16 09:56:25 2018 +0000 @@ -18,20 +18,28 @@ #include "LCD_DISCO_F429ZI.h" -#define LCD_FRAME_BUFFER_LAYER0 (LCD_FRAME_BUFFER+0x130000) -#define LCD_FRAME_BUFFER_LAYER1 LCD_FRAME_BUFFER -#define CONVERTED_FRAME_BUFFER (LCD_FRAME_BUFFER+0x260000) +#define FB_SIZE (320*240*4) +#define LAYER_COUNT 4 +#define LCD_FRAME_BUFFER_LAYER0 LCD_FRAME_BUFFER +#define CONVERTED_FRAME_BUFFER LCD_FRAME_BUFFER+FB_SIZE*LAYER_COUNT // Constructor LCD_DISCO_F429ZI::LCD_DISCO_F429ZI() { BSP_LCD_Init(); - BSP_LCD_LayerDefaultInit(1, LCD_FRAME_BUFFER_LAYER1); - BSP_LCD_SelectLayer(1); - BSP_LCD_Clear(LCD_COLOR_WHITE); - BSP_LCD_SetColorKeying(1, LCD_COLOR_WHITE); - BSP_LCD_SetLayerVisible(1, DISABLE); - BSP_LCD_LayerDefaultInit(0, LCD_FRAME_BUFFER_LAYER0); + int layer = 0; + for (int i=0; i<LAYER_COUNT; i++) + { + layer = (LAYER_COUNT-i-1); + BSP_LCD_LayerDefaultInit(layer, LCD_FRAME_BUFFER+layer*FB_SIZE); + BSP_LCD_SelectLayer(layer); + BSP_LCD_Clear(LCD_COLOR_WHITE); + if (layer != 0) { + BSP_LCD_SetColorKeying(layer, LCD_COLOR_WHITE); + BSP_LCD_SetLayerVisible(layer, DISABLE); + } + } + BSP_LCD_SelectLayer(0); BSP_LCD_SetFont(&Font16); BSP_LCD_DisplayOn();