修改后的MAIN函数:
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
/* STM32F4xx HAL library initialization:
- Configure the Flash prefetch, instruction and Data caches
- Configure the Systick to generate an interrupt each 1 msec
- Set NVIC Group Priority to 4
- Global MSP (MCU Support Package) initialization
*/
HAL_Init();
/* Configure the system clock to 100 Mhz */
SystemClock_Config();
/*##-1- Enable GPIOA Clock (to be able to program the configuration registers) */
__GPIOA_CLK_ENABLE();
/*##-2- Configure PA05 IO in output push-pull mode to drive external LED ###*/
GPIO_InitStruct.Pin = GPIO_PIN_5;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/*##-3- Toggle PA05 IO in an infinite loop #################################*/
for(;;)
{
// HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);
//
// /* Insert delay 100 ms */
// HAL_Delay(100);
//__nop();
GPIOA->BSRRL = GPIO_PIN_5;