/* Includes ------------------------------------------------------------------*/
#include "gd32f1x0.h"
#include <stdio.h>
#include "systick.h"
/* Private functions ---------------------------------------------------------*/
/**
* @brief Configure the GPIO ports.
* @param None
* @retval None
*/
void LED_config(void)
{
GPIO_InitPara GPIO_InitStructure;
RCC_AHBPeriphClock_Enable(RCC_AHBPERIPH_GPIOB,ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_PIN_9;
GPIO_InitStructure.GPIO_Mode = GPIO_MODE_OUT;
GPIO_InitStructure.GPIO_Speed = GPIO_SPEED_50MHZ;
GPIO_InitStructure.GPIO_OType = GPIO_OTYPE_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PUPD_NOPULL;
GPIO_Init(GPIOB,&GPIO_InitStructure);
}
/**
* @brief Toggle the LED every 500ms.
* @param None
* @retval None
*/
void LED_Spark(void)
{
/*static __IO uint32_t TimingDelayLocal = 0;
if (TimingDelayLocal != 0x00)
{
if(TimingDelayLocal < 500)
{
GPIO_ResetBits(GPIOC, GPIO_PIN_10);
}
else
{
GPIO_SetBits(GPIOC,GPIO_PIN_10);
}
TimingDelayLocal--;
}
else
{
TimingDelayLocal = 1000;
} */
}
/**
* @brief Main program.
* @param None
* @retval None
*/
int main(void)
{
LED_config();
SysTick_Configuration();
GPIO_SetBits(GPIOB, GPIO_PIN_9);
while (1)
{
}各位帮帮忙,不知道为什么LEN不亮,电路没有为题,这代码是以前用ST单片机时写的,可以运行的,现在用在GD上不行,程序编译后没有错。谢谢各位了 |