File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
ports/raspberrypi/common-hal/rgbmatrix Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 33
33
#include "shared-module/rgbmatrix/RGBMatrix.h"
34
34
35
35
#include "src/rp2_common/hardware_pwm/include/hardware/pwm.h"
36
+ #include "src/rp2_common/hardware_irq/include/hardware/irq.h"
36
37
37
38
void * common_hal_rgbmatrix_timer_allocate (rgbmatrix_rgbmatrix_obj_t * self ) {
38
39
// Choose a PWM channel based on the first RGB pin
@@ -58,13 +59,17 @@ void common_hal_rgbmatrix_timer_enable(void *ptr) {
58
59
void common_hal_rgbmatrix_timer_disable (void * ptr ) {
59
60
int8_t slice = ((intptr_t )ptr ) & 0xff ;
60
61
pwm_set_enabled (slice , false);
62
+ irq_set_enabled (PWM_IRQ_WRAP , false);
63
+ pwm_clear_irq (slice );
61
64
}
62
65
63
66
void common_hal_rgbmatrix_timer_free (void * ptr ) {
64
67
intptr_t value = (intptr_t )ptr ;
65
68
uint8_t slice = value & 0xff ;
66
69
uint8_t channel = value >> 8 ;
67
70
pwm_set_enabled (slice , false);
71
+ irq_set_enabled (PWM_IRQ_WRAP , false);
72
+ pwm_clear_irq (slice );
68
73
pwmout_free (slice , channel );
69
74
return ;
70
75
}
You can’t perform that action at this time.
0 commit comments