Created
May 3, 2017 01:56
-
-
Save anonymous/503edbd8572ffb58db963e6bb531c1da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// disable interrupt | |
uint8_t i; | |
for(i=0; i<42; i++) | |
{ | |
HAL_NVIC_DisableIRQ((IRQn_Type)i); | |
} | |
__HAL_UART_DISABLE_IT(&huart3, UART_IT_RXNE); | |
__HAL_UART_DISABLE_IT(&huart1, UART_IT_RXNE); | |
HAL_UART_DeInit(&huart1); | |
HAL_UART_DeInit(&huart3); | |
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_8); | |
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11); | |
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_13); | |
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_14); | |
__HAL_RCC_GPIOC_CLK_DISABLE(); | |
__HAL_RCC_GPIOD_CLK_DISABLE(); | |
__HAL_RCC_GPIOB_CLK_DISABLE(); | |
__HAL_RCC_GPIOA_CLK_DISABLE(); | |
HAL_RCC_DeInit(); | |
HAL_DeInit(); | |
typedef void (*pFunction)(void); | |
volatile uint32_t my_appaddr ; | |
void (*my_app)(void) = NULL; | |
SCB->VTOR = 0x08000000 | (0x2C00 & (uint32_t)0x1FFFFF80); | |
my_appaddr = *(__IO uint32_t*) (0x08002C00 + 4); | |
my_app = (pFunction) my_appaddr ; | |
__set_MSP(*(__IO uint32_t*) 0x08002C00); | |
my_app(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment