parent
387a8a46b3
commit
b1a3ccb36c
@ -33,6 +33,7 @@
|
||||
#include "shared-module/rgbmatrix/RGBMatrix.h"
|
||||
|
||||
#include "src/rp2_common/hardware_pwm/include/hardware/pwm.h"
|
||||
#include "src/rp2_common/hardware_irq/include/hardware/irq.h"
|
||||
|
||||
void *common_hal_rgbmatrix_timer_allocate(rgbmatrix_rgbmatrix_obj_t *self) {
|
||||
// Choose a PWM channel based on the first RGB pin
|
||||
@ -65,6 +66,8 @@ void common_hal_rgbmatrix_timer_free(void *ptr) {
|
||||
uint8_t slice = value & 0xff;
|
||||
uint8_t channel = value >> 8;
|
||||
pwm_set_enabled(slice, false);
|
||||
irq_set_enabled(PWM_IRQ_WRAP, false);
|
||||
pwm_clear_irq(slice);
|
||||
pwmout_free(slice, channel);
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user