How to replace the brownout interrupt service routine

Zingemneire
Posts: 68
Joined: Tue Apr 17, 2018 7:35 am

How to replace the brownout interrupt service routine

Postby Zingemneire » Wed Oct 17, 2018 8:30 am

@ESP_igrr

Hi,

I have seen your answer in this reply: viewtopic.php?t=6855#p29440.
In it you say it is simple to replace the standard brownout ISR via menuconfig, can you supply some more details on how to do that exactly ?
I have located the standard code, both on GITHUB and in the current ESP-IDF but I could not find anything in menuconfig to make it execute a different piece of code, all I found via menuconfig was how to set the brownout level ,nothing else. So I guess I must be overlooking it.

Any help much appreciated.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: How to replace the brownout interrupt service routine

Postby WiFive » Wed Oct 17, 2018 8:57 am

It suggests to turn brownout off in menuconfig and do the rest in code. In the other topic you can see the function brownout_init posted by maldus

Zingemneire
Posts: 68
Joined: Tue Apr 17, 2018 7:35 am

Re: How to replace the brownout interrupt service routine

Postby Zingemneire » Wed Oct 17, 2018 9:11 am

Hi,

I have figured it out: the exact entry in menuconfig is "Hardware brownout detect & reset" under "ESP-32-specific" under "component-config". Setting that to blank eliminates the call to "esp_brownout_init();" in "cpu_start.c". After that it is simple: duplicate the functionality of "esp_brownout_init();" and reroute the ISR to your own code.

Hope this is useful for someone.

Who is online

Users browsing this forum: Bing [Bot] and 114 guests