3 Replies Latest reply on Jan 16, 2016 7:09 AM by user_1377889

    Help understand

    user_420283366

      Hello all, Please have a look at this function in a Proximity Sensing regards:

         

       

         

      /***** Function Name: Output_Init  *********

         

      * Summary:                 *  Output_Init() performs following functions:

         

      *  1: Starts PRSm        * Parameters:   *  None.               * Return:             *  None***/

         

      void Output_Init(void)

         

      {       

         

                /* Set up WDT to generate the wakeup/timing ISR */

         

                /* Update the match register for generating a periodic WDT ISR. */

         

                /*Note: In order to do a periodic ISR using WDT, Match value needs to be

         

                                updated every WDT ISR with the desired time value added on top of the

         

                                existing match value */

         

                #if ((0u != CapSense_IS_M0S8PERI_BLOCK) && (0u == (CY_PSOC4_4100BL || CY_PSOC4_4200BL || CY_PSOC4_4100M || CY_PSOC4_4200M)))

         

                    CySysWdtWriteMatch(WATCHDOG_TIMER_COUNT);

         

                #else

         

                                CySysWdtWriteMatch(0, WATCHDOG_TIMER_COUNT);

         

                #endif /* (0u != CapSense_IS_M0S8PERI_BLOCK) */

         

               

         

                #if ((0u != CapSense_IS_M0S8PERI_BLOCK) && (0u == (CY_PSOC4_4100BL || CY_PSOC4_4200BL || CY_PSOC4_4100M || CY_PSOC4_4200M)))

         

                                /* Enable the WDT interrupt in SRSS INTR mask register */

         

                                CySysWdtUnmaskInterrupt();

         

                #else

         

                                CySysWdtClearInterrupt(0);

         

                #endif /* (0u != CapSense_IS_M0S8PERI_BLOCK) */

         

       

         

                /* Map the WatchDog_ISR vector to the WDT_ISR */

         

                WDT_ISR_StartEx(WatchDog_ISR);

         

               

         

                /* Start PRSm block */

         

                PRSm_Init();

         

       

         

              PRSm_WriteCounter(LED_OFF_DUTY);

         

               

         

                PRSm_Enable();

         

               

         

      }

         

       

         

      Please explain the meaning of following lines:

         

      #if ((0u != CapSense_IS_M0S8PERI_BLOCK) && (0u == (CY_PSOC4_4100BL || CY_PSOC4_4200BL || CY_PSOC4_4100M || CY_PSOC4_4200M)))

         

      Thanks & Regards-

         

      Amit