/* Function for disabling all interrupts before jumping from bootloader to application.  */
static void interrupts_disable(void)
/* Function for disabling all interrupts before jumping from bootloader to application.  */
static void interrupts_disable(void)
{
    uint32_t interrupt_setting_mask;
    uint32_t irq;
    interrupt_setting_mask = NVIC->ISER[0];
    for (irq = 0; irq < MAX_NUMBER_INTERRUPTS; irq++)
    {
        if (interrupt_setting_mask & (IRQ_ENABLED << irq))
        {
            NVIC_DisableIRQ((IRQn_Type)irq);
        }
    }
}