Hi ruicui,
Couple of things you should consider:
1: Due to a limitation in the SDK version release with MBDT v.3.0.0 the ISR functionality can't be used in the same time with Read/Write GPI functionality.
2: To have the GPI ISR working on a pin, you first have to initialize the pin (e.g. using a GPI read block that has a higher Simulink Priority than GPI ISR) and then use only GPI ISR block to read from the associated pin using a data variable to hold the states.
3: Please use interrupt on edge transition rather than level since you might overrun the CPU with interrupts. The alternative would be to use the enable/disable interrupt once you are o a level.
Here is an example of how you should tackle the problem.
In this example i'm going to initialize the PTC13 as input and read it's value in RED_LED_STATUS
Then, i'm going to initialize the GPI ISR on either edges of PTC13 and use the subsystem to negate the value of the RED_LED_STATUS each time a ISR is triggered.
Ultimately the status of another GPO is set based on the actual value of the RED_LED_STATUS. This is done on the standard Simulink step function.
The Freemaster block is optional but it is a good option to check the values of the RED_LED_STATUS and how it changes when the ISR is generated as a press of button.
Hope this helps!
Daniel