?? common.c
字號(hào):
#include "include.h"
void sys_init()
{
WDTCN=0XDE; //關(guān)看門狗
WDTCN=0XAD;
// OSCICN=0x07; //內(nèi)部16M時(shí)鐘
OSCXCN=0X67; //使用外部11.0592MHz晶振作為時(shí)鐘
// while(!(OSCXCN&0X80)); //等待晶振工作穩(wěn)定
OSCICN|=0x08; //使用外部時(shí)鐘源作為系統(tǒng)時(shí)鐘
OSCICN=0X08; //禁內(nèi)部振蕩器
XBR0=0X00; //UART I2C
XBR1=0X00; //
XBR2=0X40; //交叉開關(guān)允許
PRT0CF=0x00; //
PRT1CF=0x00; //
PRT2CF=0xbf; //
PRT3CF=0x00; //
}
/*
void delayus()
{
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
}
void delay_us(uint count)
{
for(;count>0;count--)
{
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
}
}
*/
void delay(uint i)
{
for(;i>0;i--);
}
void delay_ms(uint count)
{
uint ii,jj;
for(ii=0;ii<count;ii++)
{
for(jj=0;jj<2300;jj++)
{
_nop_();
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -