Pull up sources

I am programming a teensy with teensytimertools. I would like to know in a source, if for example I have myTimer.start(), what are the detail of the lines used to execute this line? Of course I have the sources of teensytimertools, but it's quite complicated to pull up the thread.


Many text editors have a feature to search across multiple files. In your case a search for "start" should turn up a .h file with something like:
void start() {
or a .cpp with something like:
void ClassName::start() {

If you are generally interested in drilling into source files I recommend to switch to a more capable IDE like PlatformIO or (Teensy only) VisualTeensy. The new Arduino 2 IDE also provides this feature but doesn't support Teensies yet. In the vsCode based IDEs you typically click on the symbol you are interested and press F12. This brings you to the declaration/definition of the symbol. This is very convenient and super fast.

If you are interested in the structure of the TeensyTimerTool you probably will get stuck at the higher level interface layers. But the interesting code is easy to find: The folder TeensyTimerTool/src/Teensy contains a subfolder for each supported Timer. In the folders you find at least two *.h files, one for the module (handling the interrupts and general setup) and one for the actual timer channels of this module. If you look for e.g. how the GPT timer implements the start function you find the relevant code here: gptchannel.h


Hope that helps

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.