📄 2410lcd.c
字号:
#include "def.h"
#include "uC_OS.h"
#include "2410addr.h"
#include "2410lib.h"
#include "2410slib.h"
#include "uart.h"
#include "timer.h"
#include "PowerManage.h"
#include "mmu.h"
#include "lcd_gui.h"
#include "config.h"
#define LCM_LEDCON 0x00400000
#define TaskStkLeath 10240*3 /* 任务堆栈大小. */
OS_STK TestTask1Stk[TaskStkLeath];
OS_STK TestTask2Stk[TaskStkLeath];
extern void OpenBiosTimer(void);
void TestTask1(void *pdata)
{
pdata = pdata;
// Init_Timer4();
// RequestBiosTimerEvent(10, OS_TICK_ISR); //when request, auto open bios timer
RequestBiosTimerEvent(30, Led4Flash); //when request, auto open bios timer
while (1) {
//RequestBiosTimerEvent(10, Led4Flash); //when request, auto open bios timer
printf("run Task1\n");
OSTimeDly(50);
}
}
/*
********************************************************************************************************
* 函数: .
* 描述: .
********************************************************************************************************
*/
void TestTask2 (void *pdata)
{
pdata = pdata;
while(1) {
printf("run Task2\n");
OSTimeDly(50);
}
}
// GPB1/TOUT1 for Backlight control(PWM)
#define GPB1_TO_OUT() (rGPBUP &= 0xfffd, rGPBCON &= 0xfffffff3, rGPBCON |= 0x00000004)
#define GPB1_TO_1() (rGPBDAT |= 0x0002)
#define GPB1_TO_0() (rGPBDAT &= 0xfffd)
//qjy: special power on timing, please research it!
extern void Lcd_Port_Init(void);
extern void Lcd_Init(void);
volatile int PwrKeyChkEnd;
U32 Console_Uart = 0;
U32 Console_Baud = 115200;
extern void Test_Lcd_LTV350QVF05(void);
/******************************************************************************
【功能说明】系统主函数
******************************************************************************/
int Main(U32 RstStat)
{
int i;
int curr_x,curr_y;
char code;
// ChangeClockDivider(1, 1); // 1:2:4
// ChangeMPllValue(172,4,1); //FCLK=180.0Mhz
SetClockDivider(1, 1);
SetSysFclk(FCLK_200M); //to save power, use 50M
Uart_Init(0, Console_Baud);
Uart_Select(0);
#if 0 //bank0 modified to RO_START
MMU_Init(); //MMU should be reconfigured or turned off for the debugger,
//After downloading, MMU should be turned off for the MMU based program,such as WinCE.
#else
MMU_EnableICache();
#endif
//enable GPIO,UART0,PWM TIMER,NAND FLASH module clock
// DisableModuleClock(CLOCK_ALL);
LcdBackLightOff();
putch('\n');
PwrKeyChkInit();
rMISCCR &= ~(0x3007); //USB port0,1 = normal, D0~D31 pull-up enable
Set_Tout1_Pwm( 60 ) ;
//turn on the LCD blacklight!
GPB1_TO_OUT();
GPB1_TO_1();
//special power on timing, please research it!
Lcd_Port_Init();
Lcd_Init();
rMISCCR &= ~(0x3007); //USB port0,1 = normal, D0~D31 pull-up enable
Set_Tout1_Pwm( 60 ) ;
RequestBiosTimerEvent(30, Led4Flash); //when request, auto open bios timer
printf("<*******************************************>\n");
printf("<* *>\n");
printf("<* S3C2410 Board BIOS V2006 *>\n");
printf("<*******************************************>\n");
Beep( 2000, 1000 ) ;
OSInit();
(void)OSTaskCreateExt(TestTask1,(void *)1,&TestTask1Stk[TaskStkLeath-1],1,0,&TestTask1Stk[0],TaskStkLeath,(void *)0,OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
(void)OSTaskCreateExt(TestTask2,(void *)2,&TestTask2Stk[TaskStkLeath-1],50,0,&TestTask2Stk[0],TaskStkLeath,(void *)0,OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
OSStart();
/*
while(1)
{
if(code=Uart_Getch(0)){
printf("%c",code);
display_char(curr_x,curr_y,code,0xf800);
curr_x+=8;
if(curr_x>=240){curr_x=20;curr_y+=16;}
}
}*/
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -