add LCD devicecode check
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@478 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
2a9a934639
commit
34a9286f69
|
@ -243,12 +243,23 @@ unsigned short ili9325_ReadGRAM(unsigned short x,unsigned short y)
|
|||
return temp;
|
||||
}
|
||||
|
||||
void rt_kprintf(const char *fmt, ...);
|
||||
#define printf rt_kprintf
|
||||
void ili9325_Initializtion(void)
|
||||
{
|
||||
volatile unsigned int i;
|
||||
LCD_FSMCConfig();
|
||||
|
||||
DeviceCode = LCD_ReadReg(0x0000);
|
||||
|
||||
/* DeviceCode check */
|
||||
if( (DeviceCode != 0x9325) && (DeviceCode != 0x9328) && (DeviceCode != 0x7783) )
|
||||
{
|
||||
printf("Invalid LCD ID:%08X\r\n",DeviceCode);
|
||||
printf("Please check you hardware.")
|
||||
while(1);
|
||||
}
|
||||
|
||||
if (DeviceCode==0x9325||DeviceCode==0x9328)
|
||||
{
|
||||
ili9325_WriteReg(0x00e7,0x0010);
|
||||
|
|
Loading…
Reference in New Issue