7 Replies Latest reply on Apr 9, 2020 10:31 PM by CaKu_4284131

    Hook ISR to Status Register interrupt

    CaKu_4284131

      I'm trying to use a Status Register to debounce a switch, which is wired to a GPIO. I'd like to get an interrupt when the status changes.

       

      Here is what I've tried:

       

      I made an ISR declared like this:

       

      void card_detect_ISR();

       

      and tried to hook it up like this:

       

      Cy_SysInt_Init(&Card_Detect_Interrupt_cfg, card_detect_ISR);

      NVIC_ClearPendingIRQ(Card_Detect_Interrupt_cfg->intrSrc);

      NVIC_EnableIRQ(Card_Detect_Interrupt_cfg->intrSrc);  

      Card_Detect_Status_InterruptEnable() ;

       

      but card_detect_ISR() doesn't get called.

       

      This was all a guess. How is this supposed to work? Is there a code sample somewhere that illustrates this?