?? main.c
字號:
//#include"../ucos-ii/includes.h" /* uC/OS interface */
//#include "../ucos-ii/add/osaddition.h"
#include "../inc/drivers.h"
#include "../inc/lib.h"
//#include "../src/gui/gui.h"
#include <string.h>
#include <stdio.h>
//#pragma import(__use_no_semihosting_swi) // ensure no functions that use semihosting
#define ADCCON_FLAG (0x1<<15)
#define ADCCON_ENABLE_START_BYREAD (0x1<<1)
#define rADCCON (*(volatile unsigned *)0x58000000)
#define rADCDAT0 (*(volatile unsigned *)0x5800000C)
#define PRSCVL (49<<6)
#define ADCCON_ENABLE_START (0x1)
#define STDBM (0x0<<2)
#define PRSCEN (0x1<<14)
void ARMTargetInit(void);
extern void OSInitUart(void);
extern int OpenUartRev(int ndev);
void init_ADdevice()
{
rADCCON=(PRSCVL|ADCCON_ENABLE_START|STDBM|PRSCEN);
}
/*int GetADresult(int channel)
{
rADCCON=ADCCON_ENABLE_START_BYREAD|(channel<<3)|PRSCEN|PRSCVL;
hudelay(10);
while(!(rADCCON&ADCCON_FLAG));//轉換結束
return (0x3ff&rADCDAT0);//返回采樣值
}*/
int main(void)
{
ARMTargetInit(); // do target (uHAL based ARM system) initialisation //
OSInitUart();
InitTimer4();
OpenUartRev(0);
start_Timerinterrupt();
//init_ADdevice();
//printf("\n");
Uart_Printf(0,"\n");
while(1)
{
Uart_Printf(0,"\nchuan");
hudelay(10000);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -