Liu, Baohong wrote:
get_cycles_per_usec(void); /* we can find better name:) */Senseless nitpick: this unit choice will hit precision issues.
Many/most PWM implementations in the wild work on clocks in the low
MHz, so this is only going to return a few bits of frequency
precision. I'd suggest cycles_per_sec() (works as long as the clock
isn't GHz scale) or cycle_time_ps() (starts to lose precision above a
few GHz, also not everyone knows what a picosecond is) or something