Thank you for this excellent library! I am enjoying using it in my projects. I am new to the SAMD hardware, so I am reading through libraries such as this to gain some understanding of the lower-level peripheral management. I was a little confused by the macro definition CPU_HZ=48000000, because the feature description for the M4 Express says it runs at 120MHz. Running the example creates a 5Hz signal as promised, so I knew the code was correct.
After doing some research I think I understand the clock handling that is in effect for this code, and this pull request is just a humble suggestion for some comment changes that might help other newcomers like myself.
1) Fix typo in comment; GCLK 1 is used; not GCLK 0.
2) Change macro name (CPU_HZ -> GCLK1_HZ) to better match what it refers to.
3) Add some comments to explain assumptions about device vendor clock setup.
Thank you for this excellent library! I am enjoying using it in my projects. I am new to the SAMD hardware, so I am reading through libraries such as this to gain some understanding of the lower-level peripheral management. I was a little confused by the macro definition CPU_HZ=48000000, because the feature description for the M4 Express says it runs at 120MHz. Running the example creates a 5Hz signal as promised, so I knew the code was correct.
After doing some research I think I understand the clock handling that is in effect for this code, and this pull request is just a humble suggestion for some comment changes that might help other newcomers like myself.
1) Fix typo in comment; GCLK 1 is used; not GCLK 0. 2) Change macro name (CPU_HZ -> GCLK1_HZ) to better match what it refers to. 3) Add some comments to explain assumptions about device vendor clock setup.