How to generate code for a Function-Call block interrupt service routine which Simulink thinks is not called?
1 view (last 30 days)
I have interrupt service routine (ISR) code in a Function-call block, and I use coder.ceval within a Matlab Function block to attach an interrupt to this ISR function. However Simuink does not realize that the function is called whenever interrupts occur, and either objects that "Simulink Coder does not support models containing Simulink functions that are not called" or the ISR is generated but has no code within it.
The problem is similar to this one: https://www.mathworks.com/matlabcentral/answers/593251-why-is-a-function-definition-not-generated-for-simulink-functions-that-are-not-called-in-simulink?s_tid=ta_ans_results
I was hoping there might be a work-around, or some flag to tell Simulink not to remove the code - or some example/guidance on how to handle interrupts (ideally within the framework of Function-call blocks and Matlab Function blocks).