h4yn0nnym0u5e
Well-known member
Just tinkering around with stuff, and found how to enable and read the CPU cycle counter on the Pico 2:
That should allow you, with judicious use of macros, to get an idea of the CPU load in the ported audio library, same as you can on Teensy. Probably just need to define ARM_DWT_CYCCNT ... haven't got that far yet.
Doesn't seem to need any extra
C++:
// To enable:
m33_hw->dwt_ctrl |= M33_DWT_CTRL_CYCCNTENA_BITS;
m33_hw->demcr |= M33_DEMCR_TRCENA_BITS;
// To read:
uint32_t now = m33_hw->dwt_cyccnt;
Doesn't seem to need any extra
#include
s, though I had to scrobble through the source to find the items that are actually relevant - there appears to be a lot of cruft for a BSP that's supposed to be Pi-Pico-specific!