`register_periodic_callback` not working

Hi, I need to run a periodic call to read data from a register.
I tried to use register_periodic_callback but it doesn’t run the code, even though no error shows up.

Here I put my code with a test function:

https://github.com/IDaniele/ardupilot/blob/Copter-3.5/libraries/AP_TDoA/AP_TDoA.cpp#L107

Can you tell why it doesn’t work?
Thank you.

Are you saying it doesn’t work because you never see hello world printed? I’m not sure that printf will work well since it is run in another thread, not in the main thread. Try a different way: make a new boolean variable in the class and only make it true in the dummy method, then on the loop print the value of the variable.