Page 1 of 1

Having trouble figuring this callback out

Posted: Fri Dec 04, 2020 10:17 pm
by noweare
Hello all,

In esp32-hal-cpu.h there is a line

typedef void (* apb_change_cb_t) (void * arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb);

I am having trouble understanding what this means. What I think I do understand is this is the way to change the apb rate.
and it returns a pointer to a call back type. So anytime you change the apb rate it will also execute a callback ?

Maybe some of you real programmers can help me out.

Thanks in advance

Re: Having trouble figuring this callback out

Posted: Fri Dec 04, 2020 10:38 pm
by lbernstone
I think it is for signalling hardware in the hal that need to know when the apb frequency changes. If you want to change the system frequency, use setCpuFrequencyMhz().

Re: Having trouble figuring this callback out

Posted: Fri Dec 04, 2020 11:18 pm
by noweare
Based on this declaration how would I call it from my program.