J'essaye de cligner des leds sur ma découverte stm32f4. D'une manière ou d'une autre, il s'est bloqué sur la fonction de retard. J'ai changé la priorité d'interruption SysTick à 0 et ajouté les fonctions IncTick()
, GetTick()
. Qu'est-ce que je rate?Retard dans la bibliothèque HAL (HAL_Delay())
#include "stm32f4xx.h" // Device header
#include "stm32f4xx_hal.h" // Keil::Device:STM32Cube HAL:Common
int main(){
HAL_Init();
__HAL_RCC_GPIOD_CLK_ENABLE();
GPIO_InitTypeDef GPIO_InitStruct;
GPIO_InitStruct.Pin = GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15, GPIO_PIN_SET);
HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
HAL_IncTick();
HAL_GetTick();
HAL_Delay(100);
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15, GPIO_PIN_RESET);
}