#include "stm32f4xx_hal.h"
|
|
void delay_us(uint32_t nTimer)
|
{
|
uint32_t i=0;
|
for(i=0;i<nTimer;i++){
|
__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
|
__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
|
__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
|
__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
|
__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
|
__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();
|
__NOP();__NOP();__NOP();__NOP();
|
}
|
}
|
|
void delay_ms(uint32_t nTimer)
|
{
|
uint32_t i=1000*nTimer;
|
delay_us(i);
|
}
|
|
void URTRestart(void)
|
{
|
HAL_FLASH_Unlock();
|
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_12|GPIO_PIN_15, GPIO_PIN_RESET);
|
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_2, GPIO_PIN_RESET);
|
delay_ms(100);
|
Reboot(0);
|
}
|