最近在做一个ucGUI的移植,系统移植后,可编译通过。一旦调用了GUI的函数,在执行函数时程序(如:GUI_SetBkColor(Red))就运行至HardFault_Handler中,调试发现程序未进入
LCD_L0_SetPixelIndex(int x, int y, int PixelIndex) 画点函数,请各位大神指点。
以下是更改的步骤及修改的代码:
LCDConf.h定义内容:
#define LCD_XSIZE (800)
#define LCD_YSIZE (480)
#define LCD_CONTROLLER (-1)
#define LCD_BITSPERPIXEL (16)
#define LCD_FIXEDPALETTE (565)
#define LCD_SWAP_RB (1)
extern void Lcd_Init(void);
#define LCD_INIT_CONTROLLER() Lcd_Init(); //
GUIConf.h定义内容
#define GUI_OS (0) /* Compile with multitasking support */
#define GUI_SUPPORT_TOUCH (1) /* Support a touch screen (req. win-manager) */
#define GUI_SUPPORT_UNICODE (1) /* Support mixed ASCII/UNICODE strings */
#define GUI_DEFAULT_FONT &GUI_Font6x8
#define GUI_ALLOC_SIZE 5000 /* Size of dynamic memory ... For WM and memory devices*/
#define GUI_WINSUPPORT 1 /* Window manager package available */
#define GUI_SUPPORT_MEMDEV 1 /* Memory devices available */
#define GUI_SUPPORT_AA 1 /* Anti aliasing available */
GUI_TouchConf.h定义内容
#define GUI_TOUCH_SWAP_XY 0
#define GUI_TOUCH_MIRROR_X 0
#define GUI_TOUCH_MIRROR_Y 0
#define GUI_TOUCH_AD_LEFT 1863
#define GUI_TOUCH_AD_RIGHT 97
#define GUI_TOUCH_AD_TOP 1864
#define GUI_TOUCH_AD_BOTTOM 100
LCDDummy.c更改内容
#include <stdint.h> //兼容定义uint16_t格式
#include "LCD_Private.h"
#include "GUI_Private.h"
#include "GUIDebug.h"
#include "lcd_function.h" //调用LCD驱动函数
代码修改位置:
#if (LCD_CONTROLLER == -1) //
#ifndef LCD_INIT_CONTROLLER
#define LCD_INIT_CONTROLLER()
#endif
void LCD_L0_SetPixelIndex(int x, int y, int PixelIndex)
{
LCD_SetPoint(x,y,PixelIndex);
}
unsigned int LCD_L0_GetPixelIndex(int x, int y)
{
return (LCD_GetPoint(x,y));
}
int LCD_L0_Init(void)
{
LCD_Initialize();
return 0;
}
|