main.c
资源名称:gca-150A.rar [点击查看]
上传用户:jndfzc
上传日期:2014-06-02
资源大小:325k
文件大小:2k
源码类别:
单片机开发
开发平台:
Others
- #include "maindef.h"
- #include "lcd.h"
- #include "uart.h"
- #include "display.h"
- #include "tc.h"
- #include "irq.h"
- #include "define.h"
- #include "P103_MMI2DSP.H"
- extern UI Screen_state;
- extern struct System_Info_fm System_Info; //实时信息
- extern unsigned int System_config_Old[CONFIG_NUM];
- extern unsigned int System_config[CONFIG_NUM];
- int main()
- {
- int j,i;
- Screen_state=2;
- delayfor(10000);
- WrPortE32(PIO_PER, 0xe0000);//P17?????? //????·???
- WrPortE32(PIO_OER, 0xe0000);//P17×÷????
- WrPortE32(PIO_CODR,0xe0000);//P17????0
- fnLCMInit();
- cls();
- Logo_View();
- //led
- System_Info.MMI_Statue=0x00;//液晶背光点亮
- for(j=1,i=0;i<8;i++)
- {
- WrPortE08(LED, j);
- delayfor(10000);
- j=j<<1;
- }
- ComMMI2DSP_init();
- InitCommBuf();
- Interrupt_Init();
- Interrupt_Enable(TC0IRQ);
- TC0_Init();
- TC0_RESET;
- EnableIRQ();
- //
- //key
- WrPortE32(PIO_PER, 0x01FF);//P0-P8口使能
- WrPortE32(PIO_ODR, 0x01FF);//P0-P8作输入
- MMI_DSP_Instruction(0x0500,0,0);/*读系统定值*/
- delayfor(10000);
- for(i=0;i<CONFIG_NUM;i++)
- System_config_Old[i]=System_config[i];
- while(1)
- {
- WATCHDOG_OUT1;
- RUN_Process();
- Show_Process();
- WATCHDOG_OUT0;
- CommRun();
- Comm_103_Run();
- /* delayfor(300);
- Key = RdPortE32(PIO_PDSR);
- //Updata_key(Key);
- delayfor(300);
- WrPortE08(LED, ~(RdPortE32(PIO_PDSR)%0x80));
- */
- }
- return 1;
- }