Description
A lower numeric candidate preempts the last active priority; increase depth only when it would preempt and subtract from depthLimit for depthMargin.
Interrupt preemption depends on priority interpretation and current state. Lower numeric values can mean higher urgency, but grouping, masks, and exception rules add further constraints.
A lower numeric candidate preempts the last active priority; increase depth only when it would preempt and subtract from depthLimit for depthMargin.
When to use this tool
Use Interrupt Nesting Depth Margin when you need a simplified explicit priority or nesting calculation.
How to use the tool and how it works
- Enter activePriorities, candidatePriority, depthLimit. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read wouldPreempt, resultingDepth, depthMargin. Inspect wouldPreempt before interpreting the associated values.
Require activePriorities to be nonnegative and strictly decreasing. A lower numeric candidate preempts the last active priority; increase depth only when it would preempt and subtract from depthLimit for depthMargin.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| activePriorities | Active Priorities | Required. Array of safe integer; maximum items 256. |
| candidatePriority | Candidate Priority | Required. Safe integer; minimum 0. |
| depthLimit | Depth Limit | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| wouldPreempt | Would Preempt | Required. Boolean. |
| resultingDepth | Resulting Depth | Required. Safe integer. |
| depthMargin | Depth Margin | Required. Safe integer. |
{
"input": {
"activePriorities": [
5,
3
],
"candidatePriority": 1,
"depthLimit": 4
},
"output": {
"wouldPreempt": true,
"resultingDepth": 3,
"depthMargin": 1
}
} Limitations and assumptions
- This simplified numeric-priority model does not include grouping, global masks, exceptions, or actual stack consumption.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Review the interrupt controller's complete priority, masking, and exception model and measure stack requirements.
References
Similar or alternative tools
- Interrupt Priority Preemption Bit Split
Split priority into preemption and subpriority using implementedBits - preemptionBits low bits for the latter.
- NVIC Priority Field Left Shift
Left-align a logical priority with implementedBits in an eight-bit field by multiplying it by 2^(8 - implementedBits).