- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#if is conditional compilation. the statement checks if you are running a PSoC 4-M version (or BLE) is used.
Bob
PS: do not care for generated code, that is usually ok.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Bob,
what does M0S8PERI - Stand for in --> CapSense_IS_M0S8PERI_BLOCK.
Can I omit it form the code? What will be result of it?
Thanks & Regards-
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do not tamper generated code. Never.
Bob