Can you clarify that how you change the hardware layer?
If you don't process "isr_switch_Interrupt", I think the code you said will not be changed.
In addition, whether you can reproduce this problem in a high probability, please attached your test project here and tell us which version of the creator you use.
If your isr.c is in the generated code directory, my experience is that it is unreliable about preserving it. IF you are very careful and don't mess up the comment blocks, it usually works, but not always. It also means you are committing allot of generated files to version control which is messy. A better practice is to define the variable and function by the same name. So instead of inserting between the comments, you would, in your own file:
int cmp = 0;
cmp = PWM_ReadCompare();
if (cmp == 100)
else if (cmp == 150)
else if (cmp == 200)
You can do " #define isr_switch_INTERRUPT_INTERRUPT_CALLBACK" in the project Header Files ->cyapicallback.h
And in the main.c, call "isr_switch_start();" to start the interrupt.
In addition to: You can use the "void Isr_TC_StartEx(cyisraddress address);" to refine the interrupt handle API.
// /* Clear the TC Interrupt */
// /* Decrement the PWM Compare value to increase the LED brightness */
// PWM_WriteCompare(PWM_ReadCompare() - BRIGHTNESS_CHANGE);