📄 main.c
字号:
/*********************************************************************************************
* File: main.c
* Author: Embest
* Desc: c main entry
* History:
* Y.J.Guo, Programming modify, April 12, 2005
*********************************************************************************************/
/*------------------------------------------------------------------------------------------*/
/* include files */
/*------------------------------------------------------------------------------------------*/
#include <string.h>
#include <stdio.h>
#include "2410lib.h"
#include "lcdlib.h"
#include "glib.h"
#include "lcd.h"
#define LCD_D_ON rGPCDAT |= (1 << 4);
/*********************************************************************************************
* name: main
* func: c code entry
* para: none
* ret: none
* modify:
* comment:
*********************************************************************************************/
void Main(int argc,char **argv)
{
int i,j;
int m = 0;
int color = 0;
static k = 0;
struct point A;
struct point B;
struct point C;
A.x = 160;
A.y = 10;
B.x = 60;
B.y = 210;
C.x = 260;
C.y = 210;
sys_init(); // Initial s3c2410's Clock, MMU, Interrupt,Port and UART
while(1)
{
k++;
LCD_D_ON;
//color_lcd_test();
uart_printf("\n LCD display Test Example (please look at LCD screen)\n");
lcd_init_app();
#ifndef BOARDTEST
Lcd_DspHz24(50,10,BLUE,"英蓓特三星实验平台");
#endif
Lcd_DspAscII6x8(90,120,BLUE," Embest EduKit-III");
Lcd_DspAscII6x8(50,140,GREEN,"ShenZhen Embest Info&Tech Co.,LTD");
Lcd_DspAscII6x8(90,160,COLOR,"!!!!!!!!!!!!!!!!!!!!!!!!!!!");
//Glib_Line(10,10,130,170,RED);
//Glib_Line(10,10,150,150,BLUE);
//Glib_Line(130,170,150,150,GREEN);
Glib_Triangle(A,B,C);
for(;;)
{
if((k%3)==0)
color = RED;
else if((k%3)==1)
color = BLUE;
else
color = GREEN;
Glib_Rectangle(10,40,310,230,color,10);
k++;
while(1)
{
m++;
if(m>=1000000)
{
m=0;
break;
}
}
}
//Glib_Rectangle(15,45,305,225,GREEN,10);
//Glib_Rectangle(20,50,300,220,BLUE,10);
//Glib_Rectangle(25,55,295,215,GREEN,10);
//delay(30000);
/*for(i=15; i<300; i+=3)
{
for(j=15; j<200; j+=5)
{
if(j%2 ==0)
{
PutPixel(i,j,RED);
// LCD_D_ON;
delay(10);
}
else
{
PutPixel(i,j,GREEN);
// LCD_D_ON;
delay(10);
}
}
}*/
for(i=0; i<320; i++)
{
for(j=0; j<240; j++)
{
switch(k%3)
{
case 0:
PutPixel(i,j,RED);
break;
case 1:
PutPixel(i,j,GREEN);
break;
case 2:
PutPixel(i,j,BLUE);
break;
}
}
}
LCD_D_ON;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -