When transfering a single word of data from one thread to another you could just declare it as extern, without needing to use a pointer, log or anything else:
Code: Select all
// In stablizer.c:
uint32_t my_tick;
// in another file
extern uint32_t my_tick;
// From here, accessing my_tick does access the my_tick variable form stabilizer.c
If a variable is to be used only in one file, it should be declared as "static", otherwise it is shared with all the files. In your original message you would have a problem with the tick variable that is declared as non-static in two different files.
There is also a way to declare and access log variable from within the firmware, depending of what you are trying to achieve it might be overkill though, sharing a variable between two files is handled by C itself. An example of how to read a log variable from within the firmware can be found in the app examples:
https://github.com/bitcraze/crazyflie-f ... aram_api.c
As a last note, if you want to share more than a single 32bit variable between thread, you will need some kind of synchronization, either a mutex or a queue. There is a lot of code in the Crazyflie that you can look at that already uses FreeRTOS queues and semaphores/mutexes. The FreeRTOS doc is also a good place to look at to find more information.