void delay_us(u32 nus)
{
u32 temp;
SysTick->LOAD=nus*fac_us; //ê±¼ä¼óÔØ
SysTick->VAL=0x00; //Çå¿Õ¼ÆêyÆ÷
SysTick->CTRL|=SysTick_CTRL_ENABLE_Msk ; //¿aê¼μ1êy
do
{
temp=SysTick->CTRL;
}while((temp&0x01)&&!(temp&(1<<16))); //μè′yê±¼äμ½′ï
SysTick->CTRL&=~SysTick_CTRL_ENABLE_Msk; //1رռÆêyÆ÷
SysTick->VAL =0X00; //Çå¿Õ¼ÆêyÆ÷
}
还是没有用 |