Having trouble figuring this callback out

noweare
Posts: 74
Joined: Tue Jul 02, 2019 11:35 am

Having trouble figuring this callback out

Postby noweare » Fri Dec 04, 2020 10:17 pm

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

lbernstone
Posts: 828
Joined: Mon Jul 22, 2019 3:20 pm

Re: Having trouble figuring this callback out

Postby lbernstone » Fri Dec 04, 2020 10:38 pm

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().

noweare
Posts: 74
Joined: Tue Jul 02, 2019 11:35 am

Re: Having trouble figuring this callback out

Postby noweare » Fri Dec 04, 2020 11:18 pm

Based on this declaration how would I call it from my program.

Who is online

Users browsing this forum: No registered users and 67 guests