File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,8 @@ bool PWMAudio::setFrequency(int frequency) {
101
101
return true ; // We're already at the right speed
102
102
}
103
103
if (_pacer < 0 ) {
104
- return false ;
104
+ _sampleRate = frequency;
105
+ return true ;
105
106
}
106
107
uint16_t _pacer_D, _pacer_N;
107
108
// Flip fraction(N for D, D for N) because we are using it as sys_clk * fraction(mechanic of dma_timer_set_fraction) for smaller than sys_clk values
@@ -152,6 +153,7 @@ bool PWMAudio::begin() {
152
153
if (_pacer < 0 ) {
153
154
return false ;
154
155
}
156
+
155
157
uint16_t _pacer_D = 0 ;
156
158
uint16_t _pacer_N = 0 ;
157
159
// Flip fraction(N for D, D for N) because we are using it as sys_clk * fraction(mechanic of dma_timer_set_fraction) for smaller than sys_clk values
You can’t perform that action at this time.
0 commit comments