risc-v/esp32-c3:free cpu in case it was preallocated in wdt driver

This commit is contained in:
Sara Souza 2021-03-03 12:10:21 -03:00 committed by Abdelatif Guettouche
parent 938b1daf02
commit d00e97cbca

View File

@ -681,6 +681,12 @@ static int32_t esp32c3_wdt_setisr(struct esp32c3_wdt_dev_s *dev,
/* Disable the provided CPU interrupt to configure it. */
up_disable_irq(wdt->cpuint);
/* Free CPU interrupt that is attached to this peripheral
* because we will get another from esp32c3_request_irq()
*/
esp32c3_free_cpuint(wdt->periph);
}
wdt->cpuint = esp32c3_request_irq(wdt->periph,