The HTML code is as follows, to show just a little, is involved in not delay, not visible to the naked eye?
In addition, initialize the clock function is which one? __GPIOB_CLK_ENABLE (); ?
Int main (void)
{
HAL_Init ();
/* Configure the system clock to 120 MHz */
SystemClock_Config ();
/* the Add your application code here */
Infinite loop/* */
Led_Init_PB7 ();
}
Void Led_Init_PB7 (void)
{
GPIO_InitTypeDef My_GPIO_Init;
__GPIOB_CLK_ENABLE ();
My_GPIO_Init. Pin=GPIO_PIN_7;
My_GPIO_Init. Mode=GPIO_MODE_OUTPUT_PP;
My_GPIO_Init. Speed=GPIO_SPEED_FAST;
My_GPIO_Init. Pull=GPIO_PULLUP;
HAL_GPIO_Init (GPIOB, & amp; My_GPIO_Init);
HAL_GPIO_WritePin (GPIOB, GPIO_PIN_7, GPIO_PIN_SET);
//GPIO_Init (LED_GPIO_PORT, & amp; GPIO_InitStructure);
}
CodePudding user response:
Function to run to the outside bracket {} is returned, and general MCU application is not allowed in this return, so your main () function needs to contain an infinite loop, prevent it returns,CodePudding user response:
Your code framework inside tips you have to have an Infinite loop/* */, but you ignore it,,,,CodePudding user response:
Above two good, give opinions have tried, noCodePudding user response:
All posted?Seems to have enough, confirm the high level or low level light? If it is low level light requires low level will be bright,