#include "stm32f10x.h"
#define PIN_PC13 0x2000
#define ON_BOARD_LED PIN_PC13
void LED_Init(void);
int main()
{
Function for Initialising on board LED of STM32F103C8T6
(STM32F103C8T6板上LED初始化功能)
LED_Init();
while(1)
{
}
return 0;
}
void LED_Init()
{
APB bus-2 clock enable ---> Enabled in order to use the peripheral
(APB总线2时钟启用--->为了使用外设而启用)
RCC->APB2ENR |= RCC_APB2ENR_IOPCEN;
GPIOC->CRH |=GPIO_CRH_MODE13;
GPIOC->CRH &= ~(GPIO_CRH_CNF13);
SysTick_Config(800000-1);
//SysTick->CTRL |=0x07;
//SysTick->LOAD =8000000/10 -1;
}
Interrupt handler not running why?
(中断处理程序为什么不运行?)
void SysTick_Handler(void)
{
GPIOC->ODR ^=ON_BOARD_LED; // Toggling the on board LED
}
ask by Devanshu Tripathi translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…