#include "stm32f10x.h"
#include "stm32f10x_gpio.h"
#include "led.h"
#include "key.h"
#include "system.h"
#include "usart.h"
int main(void)
{
LED_GPIO_init();//3õê¼»ˉLED1ü½Å
KEY_GPIO_init();//ÅäÖÃkey1ü½Å
KEY_GPIO_init();
EXTI_init();
NVIC_init();
uasrt_config();
while(1)
{
USART_SendData(USART1, 0x55);//Ñ¡Ôñ′®¿ú£¬·¢Ëíêy¾Y
//delay_ms(50);
}
}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
#include "system.h"
__IO uint32_t TimingDelay;
void Systick_init(void) //Ïμí3ê±Öó3õê¼»ˉ
{
/*ÅäÖÃÏμí3êÇê±ÖóÖØÔØÖ죬Ïμí3ê±ÖóÎa72MH*/
/*éèÖÃ72000£¬ÖD¶Ïê±¼ä 72000*(1/72000000)=1ms*/
if(SysTick_Config(72000)== 1)//·μ»ØÎa1£¬±íê¾éèÖÃ2»3é1|
{
while(1);
}
}
void SysTick_Handler(void)//ÖD¶Ï′|àíoˉêy
{
TiningDelay_Decrement();
}
void TiningDelay_Decrement(void)
{
if(TimingDelay !=0x00)
{
TimingDelay--;
}
}
void delay_ms(uint32_t nTime)//Ñóê±oˉêy
{
TimingDelay = nTime;
while(TimingDelay!= 0);
}
好像是延时函数问题
一周热门 更多>