modm API documentation
|
Classes | |
class | modm::CycleCounter |
lbuild module: modm:driver:cycle_counter
Allows you to measure time with cycle accuracy on AVR and ARM devices. This module wraps common functionality around different timers:
modm:platform:systick
module to provide modm::Clock
, which limits the maximum measurable time to just 1ms! The systick may also be run with a /8 prescaler, which this class compensates for but this still reduces sampling resolution to 8 cycles!In case these limitations are not acceptable, you may force initialize the SysTick, which will break modm::Clock
functionality in favor of accurate measurements. You may of course reinitialize the SysTick after your measurement to regain modm::Clock
functionality! However, the software timers of the modm:processing:timer
module may not work correctly anymore and may need to be reinitialized.
~~~{.cpp} Always initializes the SysTick for modm::Clock
Board::initialize();
but we need an accurate cycle counter counter.initialize(/*force=