📄 main.c
字号:
//#include "bf5xx.h"
#include "types.h"
#include "main.h"
extern volatile unsigned char DisplayBuffer[251574];
extern volatile unsigned char TempBuffer_img[251574];
extern volatile unsigned char TempBuffer[251574] ;
extern volatile unsigned char Inputdata[251574];
//={
//#include "test.dat"
//};
/**********************************************************************************
* 名称 :main()
* 功能 :生成彩条数据,产生彩条
* 入口参数 :无
* 出口参数 :无
***********************************************************************************/
/*void bmp2rgb24(void)
{
int i,j;
int a,b;
for(i=0;i<251574;i++)
{
TempBuffer[i]=Inputdata[i];
}
for(i=0;i<262;i++)
{
for(j=0;j<960;j++)
{
TempBuffer_img[i][j] = TempBuffer[i*960+j+54];
}
}
for(i=0;i<262;i++)
{
for(j=0;j<320;j++)
{
a = TempBuffer_img[i][j*3];
b = TempBuffer_img[i][j*3+2];
TempBuffer_img[i][j*3] = b;
TempBuffer_img[i][j*3+2] = a;
}
}
for(i=0;i<262;i++)
{
for(j=0;j<960;j++)
{
DisplayBuffer[i][j] = TempBuffer_img[261-i][j];
}
}
}*/
int main()
{
int i,j;
Set_PLL( (short)(CORECLK/CLKIN), (short)(CORECLK/SYSCLK));
InitSDRAM();
//生成彩条,测试tft屏用
//#ifdef COLOR_BAR
//#if 0
for(i=0;i<262;i++)
{
for(j=0;j<40;j++)
{
*(DisplayBuffer+960*i+j*3+0) = 0x00;
*(DisplayBuffer+960*i+j*3+1) = 0x00;
*(DisplayBuffer+960*i+j*3+2) = 0x00;
}
for(j=40;j<80;j++)
{
*(DisplayBuffer+960*i+j*3+0) = 0xff;
//.*(DisplayBuffer+960*i+j*3+1) = 0x00; DisplayBuffer[i][j*3+1] = 0x00;
*(DisplayBuffer+960*i+j*3+2) = 0x00;//red
}
for(j=80;j<120;j++)
{
*(DisplayBuffer+960*i+j*3+0) = 0x00;
*(DisplayBuffer+960*i+j*3+1) = 0xff;
*(DisplayBuffer+960*i+j*3+2) = 0x00;//green
}
for(j=120;j<160;j++)
{
*(DisplayBuffer+960*i+j*3+0) = 0x00;
*(DisplayBuffer+960*i+j*3+1) = 0x00;
*(DisplayBuffer+960*i+j*3+2) = 0xff;//blue
}
for(j=160;j<200;j++)
{
*(DisplayBuffer+960*i+j*3+0) = 0xff;
*(DisplayBuffer+960*i+j*3+1) = 0xff;
*(DisplayBuffer+960*i+j*3+2) = 0x00;//red+green
}
for(j=200;j<240;j++)
{
*(DisplayBuffer+960*i+j*3+0) = 0x00;
*(DisplayBuffer+960*i+j*3+1) = 0xff;
*(DisplayBuffer+960*i+j*3+2) = 0xff;//red+blue
}
for(j=240;j<280;j++)
{
*(DisplayBuffer+960*i+j*3+0) = 0xff;
*(DisplayBuffer+960*i+j*3+1) = 0x00;
*(DisplayBuffer+960*i+j*3+2) = 0xff;//green+blue
}
for(j=280;j<320;j++)
{
*(DisplayBuffer+960*i+j*3+0) = 0xff;
*(DisplayBuffer+960*i+j*3+1) = 0xff;
*(DisplayBuffer+960*i+j*3+2) = 0xff;
}
}
//#else
/*for(i=0;i<60;i++)
{
for(j=0;j<960;j++)
{
DisplayBuffer[i][j*3+0] = 0x00;
DisplayBuffer[i][j*3+1] = 0x00;
DisplayBuffer[i][j*3+2] = 0x00;
}
}
for(i=60;i<120;i++)
{
for(j=0;j<960;j++)
{
DisplayBuffer[i][j*3+0] = 0xff;
DisplayBuffer[i][j*3+1] = 0x00;
DisplayBuffer[i][j*3+2] = 0x00;
}
}
for(i=120;i<180;i++)
{
for(j=0;j<960;j++)
{
DisplayBuffer[i][j*3+0] = 0xff;
DisplayBuffer[i][j*3+1] = 0xff;
DisplayBuffer[i][j*3+2] = 0x00;
}
}
for(i=180;i<220;i++)
{
for(j=0;j<960;j++)
{
DisplayBuffer[i][j*3+0] = 0x00;
DisplayBuffer[i][j*3+1] = 0xff;
DisplayBuffer[i][j*3+2] = 0x00;
}
}
for(i=220;i<262;i++)
{
for(j=0;j<960;j++)
{
DisplayBuffer[i][j*3+0] = 0x00;
DisplayBuffer[i][j*3+1] = 0xff;
DisplayBuffer[i][j*3+2] = 0xff;
}
}
#endif
#endif//COLOR_BAR*/
// bmp2rgb24();
Init_Platform_TFT();
while(1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -