How do you debounce a button used for interrupts

I am using a standard pushbutton with an interrupt using

attachInterrupt(35, function, RISING);

And am getting a "Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0)" error on my ESP32. I have confirmed that there is no issue with the circuit by simply having the ESP32 print out the state of the pin (digitalRead) and that works fine.

My theory is that the button is rapidly bouncing between high and low, causing the interrupt wdt timeout error by constantly calling the interrupt before it even finishes its task.

Is there anyway to debounce the button in software? I would prefer to not do it in hardware as I already have a PCB made.

electricviolin:
Is there anyway to debounce the button in software? I would prefer to not do it in hardware as I already have a PCB made.

It's done all the time. Find one approach in IDE -> file/examples/digital.

One approach would be to disabuse yourself of the fallacy that you need to use interrupts to monitor a human-pressed push button. After that you can either roll your own debounce function based on the many examples available or try the Bounce2 library. Don't know if it's supported on ESP32, but if not the source code is available and you can adapt it.

electricviolin:
I am using a standard pushbutton with an interrupt using

attachInterrupt(35, function, RISING);

And am getting a "Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0)" error on my ESP32.

How about showing your code and the Guru error.

electricviolin:
I am using a standard pushbutton with an interrupt using

attachInterrupt(35, function, RISING);

And am getting a "Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0)" error on my ESP32. I have confirmed that there is no issue with the circuit by simply having the ESP32 print out the state of the pin (digitalRead) and that works fine.

My theory is that the button is rapidly bouncing between high and low, causing the interrupt wdt timeout error by constantly calling the interrupt before it even finishes its task.

Is there anyway to debounce the button in software? I would prefer to not do it in hardware as I already have a PCB made.

How about this?

In the Lambda anonymous function: { function code } ...that is passed to the callback of attachInterrupt.
We are using a blink without delay timer to limit the interrupt events. the Time will automatically be passed on the very first interrupt. With any subsequent interrupts, the blink without delay timer will be false until the delay time has passed. If the delay time is too short "ButtonPressed" will increment until it is cleared once the button press is acknowledged. You will be able to capture the true state in your loop at your convenience.

volatile unsigned long DebounceTimer;
volatile int ButtonPressed;
volatile unsigned int delayTime = 100;
#define pin 3
void setup() {
  pinMode(pin, INPUT_PULLUP);
  Serial.begin(115200);
  Serial.println(F("Start: Light Weight depounce blink without delay code"));
  attachInterrupt(digitalPinToInterrupt(pin), [] {if (ButtonPressed+= (millis() - DebounceTimer) >= (delayTime )) DebounceTimer = millis();}, RISING);
  //attachInterrupt(digitalPinToInterrupt(pin), []{ButtonPressed++;}, RISING); // No Debounce
}
void loop() {
  if (ButtonPressed> 0) Serial.println(Pressed ); 
  ButtonPressed = 0; // Must clear
}

Z