Hi,
In order to prevent flash corruption, I have been taking extra precautions to minimize flash writes. But when it's time for firmware upgrades (OTA), then there is nothing I can do. However I have a power management IC and a super cap which can let me know about a second before power completely dies. I also have an output from management chip going to ESP32 GPIO.
What would be the best approach for using this pin as an interrupt input to safely and quickly shutdown all flash operations before things get corrupted?