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) {
101101 return true ; // We're already at the right speed
102102 }
103103 if (_pacer < 0 ) {
104- return false ;
104+ _sampleRate = frequency;
105+ return true ;
105106 }
106107 uint16_t _pacer_D, _pacer_N;
107108 // 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() {
152153 if (_pacer < 0 ) {
153154 return false ;
154155 }
156+
155157 uint16_t _pacer_D = 0 ;
156158 uint16_t _pacer_N = 0 ;
157159 // 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