Hi Dominik,
Settings for LVD interrupt seems fine. But you cannot check LVD flag in your code because LVD flag is checked and cleared in Cpu.c code:
PE_ISR(Cpu_INT_LVD_LVWInterrupt)
{
uint8_t Reason = 0x00U; /* Defines the source of Low voltage interrupt */
if ((PMC_LVDSC1 & PMC_LVDSC1_LVDF_MASK) != 0x00U) {
PMC_LVDSC1 |= PMC_LVDSC1_LVDACK_MASK;
Reason |= LVDSRC_LVD;
}
if ((PMC_LVDSC2 & PMC_LVDSC2_LVWF_MASK) != 0x00U) {
PMC_LVDSC2 |= PMC_LVDSC2_LVWACK_MASK;
Reason |= LVDSRC_LVW;
}
Cpu_OnLowVoltageINT(Reason);
}
So you can only check the Reason valuein Cpu_OnLowVoltageINT(uint8_t Reason) function. Reason value may acquire 0x00U or one of these two values.
#define LVDSRC_LVD 0x01U /*!< Low voltage detect */
#define LVDSRC_LVW 0x02U /*!< Low-voltage warning */
Best regards
Michal