[mw_shl_code=c,true]代码如下[/mw_shl_code]
[mw_shl_code=c,true]#include "sys.h"
#include "delay.h"
//#include "usart.h"
int main(void)
{
GPIO_InitTypeDef GPIO_InitStruct;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB,ENABLE);
GPIO_InitStruct.GPIO_Mode=GPIO_Mode_Out_PP;
GPIO_InitStruct.GPIO_Pin=GPIO_Pin_8;
GPIO_InitStruct.GPIO_Speed=GPIO_Speed_50MHz;
GPIO_Init(GPIOA,&GPIO_InitStruct);
delay_init ();
while(1)
{
GPIO_SetBits(GPIOA,GPIO_Pin_8);
delay_ms(300);
GPIO_ResetBits(GPIOA,GPIO_Pin_8);
delay_ms(300);
}
}
[/mw_shl_code]
我是初学者,看着跑马灯视频里照做的。板子是Mini3.0,LED输出引脚是PA8。
但是不知道为什么我的程序用J-link下载时没有反应,但是通过串口下载可以闪烁。
我以为是J-link坏了,但是使用J-link下载例程又可以跑,我不知道原因出在哪里,请各位前辈指教 |