> What should I evaluate first so as not to falsify the value in the event of an overflow?
I don't understand what you mean by "falsify the value". What value? The Capture Value? The relationship between two close interrupts? If you are capturing a timer value that overflows and need to know whether the capture was "just before" or "just after" the interrupt, then nothing is going to help you with that.
So I assume you mean "how do I handle one interrupt so as not to accidentally clear the other one?". If that isn't what you are asking, then you should consider it as it is a risk that needs to be dealt with.
Your code, as written, will miss and lose interrupts. But nothing in the sample code or the manuals will help you with that.
There has been a lot of old (30 years ago) modules where it wasn't possible to avoid accidentally clearing interrupts. They had "status" registers with different bits for different interrupts, and writing to those bits would set or clear them. Between reading the register (to find which interrupt had happened) and writing it to clear that interrupt, another one could be set and you would then accidentally clear it, losing that interrupt forever.
Motorola championed a standard way around this problem. When an interrupt bit was set, the only way to clear it is to write a ONE to that bit. This allows you to clear any interrupt at any time with no risk of accidentally clearing another one. This is called "W1C" in the manuals (160 instances). Most interrupt status registers in the IMXRT still work this way.
The MC68HC11, released in 1984 and documented in the 1991 68HC11K4 manual I have in front of me now worked that way. This is "the standard way it has been done" for at least 30 years.
But the Quad Timer doesn't follow this tradition.
Please read the post I made in this thread on "Jun 5, 2019 12:59 PM" (immediately below this post) where I detail this anomaly, and give the overly complicated code that you have to use to handle this properly.
How does the NXP Sample Code clear these interrupts? Does it get it right? Yet?
If that wasn't your question, please try again with more detail about what you are trying to do.
In case you want to use PWM or generate signals or interrupts at the frequency you expect, check the following:
i.MXRT Quad Timer (QTMR): Are There Any Working Code Examples?
> Add for ARM errata 838869, affects Cortex-M4
What CPU are you using? The IMXRT1021, 1050 and 1060 use Cortex-M7.
Tom