I see a note in PE-generated code for a UART interrupt handler (InterruptTX). A comment indicates "This routine is inlined" but I can't see how this is done. What makes the function InterruptTX inlined?
I'm asking because I would like to temporarily disable inlining so I can set a breakpoint.
This is using:
KDS 3.2.0
MCU: K22F
Here are the exact lines of code I was referring to, which are contained in the function ASerialLdd_Interrupt():
if (StatReg & UART_S1_TDRE_MASK) { /* Is the transmitter empty? */
InterruptTx(DeviceDataPrv); /* If yes, then invoke the internal service routine. This routine is inlined. */
}
Hello Alexander,
- The function of " InterruptTx(DeviceDataPrv)" is in the file "AS1.c":
- You can find the "DeviceDataPrv" refer to the below path:
INT_LPUART0__DEFAULT_RTOS_ISRPARAM is a global variable , it is initialize in the function of "AS1_Init()" :
Hope it helps
Have a great day,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks Alice. I think I might have been unclear with my question: I do understand where the InterruptTX code is located in my project. My question is specifically regarding inlining.
My understanding is that inlining should require a special annotation for the compiler to pick up, but I can't see anything to indicate inlining for InterruptTX other than the comment.
Based on my experience debugging the code, it does seem that InterruptTX actually is inlined. So it seems a bit magical, like something is causing this one function to be inlined without any compiler directive. See what I mean?
Hello Alexander,
PE team expert said :
"
The note "This routine is inlined" means that the routine is defined as inline (it is inlined by the compiler). But it may not be a valid comment for all compilers and settings. The functional can be inlined in some use cases and configurations only (for better performance of the code).
"
Hope it helps
Have a great day,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Alexander,
I think there maybe some other meaning about the "inlined" annotation .
While I will ask the PE team to confirm it .
Thanks for your sharing .
BR
Alice