Documentation
Onboarding
Getting Started
Power & Battery
Hardware & Components
Build & Assembly
Radio & RF Design
Frequencies & Regulations
Firmware & Software
USB & Connectivity
GPS & Navigation
Morse & Communication
Modes & Operation
Field Operations & Rescue
Building Effectively
Build Variants
Project & Reference
Docs Firmware & Software ESP32 Interrupts Guide

ESP32 Interrupts Guide

Edit on GitHub

How the firmware uses interrupts: the button edges, the radio's DIO line, and the rules that keep interrupts honest.

ESP32 Interrupts Guide

Interrupts are how the ESP32 notices the world without polling it: a button press, a radio event. The firmware uses them sparingly, and this page is why.

The interrupts in use

SourcePinWhat it signals
Button edgesButton GPIOsPress events for the state machine (see Firmware Buttons)
Radio DIO1A GPIOPacket received or transmitted (see Radio Library and SX1262)
RTC (sleep)InternalThe wake timer (see ESP32 RTC Notes)

The interrupt rules

  1. Keep handlers tiny: set a flag, wake the task. The radio and display work happen in the main loop, never inside an ISR.
  2. No I2C/SPI in ISRs: the display and the radio are touched from the loop, not from the interrupt.
  3. Debounce in software: the button ISR sets a pending flag; the loop debounces it (see Button Troubleshooting).

The radio interrupt

The SX1262 raises DIO1 when a packet completes. The handler sets a flag and the loop reads the packet. Missing this interrupt (wrong pin, unconfigured mask) produces the classic symptom: the radio receives but the firmware never notices. See SX1262 Registers for the IRQ mask commands.

Interrupt vs polling

Why not poll everything? The button polling would add no real cost, but the radio must be serviced within its timing windows, and polling risks missing an RX window. Interrupts for the radio, polling for the buttons: that split is deliberate (see Firmware Main Loop).