Skip to content

Commit

Permalink
Fixed issue with low PWM frequencies causing excessive CPU utilisation
Browse files Browse the repository at this point in the history
  • Loading branch information
dc42 committed Apr 21, 2021
1 parent d58d49d commit bc6dd38
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/SAME5x_C21/AnalogOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ namespace AnalogOut
else
{
// Just update the compare register
// Don't call hri_tccount16_write_CCBUF_CCBUF_bf here! It loops for up to one TC period waiting for sync.
const uint16_t cc = ConvertRange(val, tcTop[device]);
hri_tccount16_write_CCBUF_CCBUF_bf(tcdev, output, cc);
tcdev->COUNT16.CCBUF[output].bit.CCBUF = cc;
}

SetPinFunction(pin, peri);
Expand Down

0 comments on commit bc6dd38

Please sign in to comment.