/** * @brief Main program * @param None * @retval None */ int main(void) { /*!< At this stage the microcontroller clock setting is already configured, this is done through SystemInit() function which is called from startup file (startup_stm32f4xx.s) before to branch to application main. To reconfigure the default setting of SystemInit() function, refer to system_stm32f4xx.c file */ /* Initialize LEDs on STM324xG-EVAL board */ STM_EVAL_LEDInit(LED1); STM_EVAL_LEDInit(LED2); /* Configure the PVD */ PVD_Config(); while (1) { /* Toggle The LED2 */ STM_EVAL_LEDToggle(LED2); /* Inserted Delay */ for(i = 0; i < 0x5FFFF; i++); } }
/** * @brief Main program * @param None * @retval None */ int main(void) { /* STM32F3xx HAL library initialization: - Configure the Flash prefetch - Systick timer is configured by default as source of time base, but user can eventually implement his proper time base source (a general purpose timer for example or other time source), keeping in mind that Time base duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and handled in milliseconds basis. - Set NVIC Group Priority to 4 - Low Level Initialization */ HAL_Init(); /* Configure LED_GREEN */ BSP_LED_Init(LED_GREEN); /* Configure the system clock to 64 Mhz */ SystemClock_Config(); /* Configure the PVD */ PVD_Config(); /* Infinite loop */ while (1) { /* LED_GREEN toggles when voltage is above the target threshold */ if (uwToggleOn) { BSP_LED_Toggle(LED_GREEN); HAL_Delay(100); } } }
/** * @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 LED1, LED2 and LED3 */ BSP_LED_Init(LED1); BSP_LED_Init(LED2); BSP_LED_Init(LED3); /* Configure the system clock to 168 Mhz */ SystemClock_Config(); /* Configure the PVD */ PVD_Config(); while (1) { /* Toggle The LED2 */ BSP_LED_Toggle(LED2); /* Insert 100 ms delay */ HAL_Delay(100); } }