I'm creating a project for a FRDM-KE02Z40M board and need to replace the default IRQ handler for FTM2 with my own. When I add FTM2 device in the Components tab of the Peripherals perspective it brings in files named fsl_adapter_ftm.c and .h in the component folder. fsl_adapter_ftm.c contains a function declartion named FTM2_IRQHandler and that conflicts with my declaration of a function with the same name. (build error: multiple definition of `FTM2_IRQHandler'). I can get it to build by deleting the declaration in fsl_adapter_ftm.c but I think there should be a way to do this without modifying a SDK file.
I tried selecting a custom handler name in the component config but that didn't help even though my code at that point didn't include any reference to the original handler name (the name does show up in a declare generated during "Update Code" in the Peripherals perspective.
The handler in fsl_adapter_ftm.c appears to utilize a callback function but I couldn't figure out how to use that either and in any case I'd prefer to eliminate the generated handler completely and write my own. What do I need to change to make this work without modifying the SDK generated files?
The attached zip file contains the entire project.
Thank you for your interest in NXP Semiconductor products and the opportunity to serve you, I will gladly help you with this.
I checked your project and it seems that only fsl_adapter_ftm.c does not fsl_adapter_ftm.h.
I think fsl_adapter_timer.h is fsl_adapter_ftm.h in your project. If so, try modifying your code in the following ways.
Wish it helps you.
BR
Xu Zhang