#include "cy_project.h" #include "cy_device_headers.h" #include "../common/ota_protocol.h" #include "ota_enter_bootloader.h" void Ota_EnterBootloader(void) { __disable_irq(); BACKUP->unBREG[0].u32Register = OTA_BOOT_REQUEST_MAGIC; BACKUP->unBREG[1].u32Register = OTA_BOOT_REQUEST_MAGIC_INVERSE; __DSB(); NVIC_SystemReset(); for(;;) { /* Reset must not return. */ } }