FW-INTERRUPTS
Define safe interrupt design: short ISRs, deferred work, priority assignment, critical section management, and testing strategies.
Unsigned, install at your own risk
UnverifiedThis skill has no cryptographic signature attached. We can't verify the contents match what the publisher intended.
Install this skill
No account required. Pick your tool, or use the command that detects it for you.
Run in your terminal. It detects your AI tool.
npx @skills-hub-ai/cli install meddev-skills-fw-interruptsManual setup by platform
Claude Code
~/.claude/skills/meddev-skills-fw-interrupts/SKILL.md
Instructions
Interrupt Handling in Medical Devices
Purpose
Define safe interrupt design: short ISRs, deferred work, priority assignment, critical section management, and testing strategies.
When to Apply
- Any ISR or interrupt-driven feature; safety-relevant timing/response paths.
Requirements (testable)
- ISR Minimalism: ISRs do minimal, non-blocking work; defer processing to tasks; no dynamic allocation. Rationale: predictability and latency.
- Priority Scheme: Assign priorities to meet safety/timing; avoid unintentional preemption of critical tasks; document scheme. Rationale: correct responsiveness.
- Shared Data Protection: Use atomic ops or proper locks (or disable interrupts briefly) for shared data;
volatilefor flags shared with ISRs. Rationale: data consistency. - Critical Sections: Keep interrupt masking short and bounded; no masking around unbounded loops. Rationale: latency control.
- Reentrancy: ISR-invoked functions must be reentrant or protected; no non-reentrant libc calls in ISRs. Rationale: avoid corruption.
- Testing: Provide ISR unit/integration tests where feasible; measure latency and service time; fault injection for missed/rapid interrupts. Rationale: verification.
Recommended Practices
- Use double-buffering for ISR-produced data.
- Keep ISR code in fast memory if available; minimize branching.
- Provide statistics (count, overrun) for diagnostics.
- Avoid long chains of interrupt enabling/disabling; prefer fine-grained critical sections.
Patterns
Deferred work:
// REQ-INT-ISR-01; TEST-INT-03
volatile bool g_rx_ready = false;
void UART_IRQHandler(void) {
clear_uart_irq();
g_rx_ready = true; // defer to task
}
Atomic flag update:
// REQ-INT-SHARED-02; TEST-INT-05
void set_flag_from_isr(void) {
atomic_store_explicit(&g_flag, 1, memory_order_release);
}
Bounded critical section:
// REQ-INT-CRIT-03; TEST-INT-07
uint32_t read_counter_atomic(void) {
uint32_t primask = disable_irq();
uint32_t v = g_counter;
restore_irq(primask);
return v;
}
Anti-Patterns (risks)
- Heavy processing or blocking in ISR -> risk: latency, missed deadlines.
- Calling non-reentrant functions (e.g., printf) from ISR -> risk: corruption.
- Long interrupt masking -> risk: jitter and missed time-critical events.
- Shared data without synchronization -> risk: race conditions.
Verification Checklist
- ISRs minimal, non-blocking, no heap; defer work to tasks.
- Interrupt priorities assigned/documented; critical ISRs prioritized appropriately.
- Shared data protected; volatile flags/atomics used; no data races.
- Critical sections short and bounded; masking limited.
- ISR-invoked functions reentrant or protected.
- Latency/service time measured; tests/fault injection performed.
Traceability
- Use
REQ-INT-###; link to testsTEST-INT-###; keep timing measurements with artifacts.
References
- MCU vendor interrupt guidance; CMSIS recommendations.
- IEC 62304 timing and design expectations.
Changelog
- 1.0.0 (2026-01-04): Initial interrupt handling skill with ISR minimalism, priority, and testing guidance.
Audit History
- 2026-01-04: Audit performed. Verified:
- CMSIS recommendations accurately represented
- ISR patterns follow embedded best practices
- Atomic operations correctly used in examples
Security
Reviews (0)
Related skills
Browse all →More from Medical Device Skills
View source →More Build skills
Browse category →Frequently asked questions about FW-INTERRUPTS
What does the FW-INTERRUPTS skill do?
Define safe interrupt design: short ISRs, deferred work, priority assignment, critical section management, and testing strategies. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the FW-INTERRUPTS skill?
Run `npx @skills-hub-ai/cli install meddev-skills-fw-interrupts` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/meddev-skills-fw-interrupts/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does FW-INTERRUPTS work with?
FW-INTERRUPTS runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the FW-INTERRUPTS skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use FW-INTERRUPTS after installing it?
In Claude Code, type `/meddev-skills-fw-interrupts` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the FW-INTERRUPTS skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.