File tree Expand file tree Collapse file tree 3 files changed +7
-13
lines changed Expand file tree Collapse file tree 3 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -322,11 +322,9 @@ SRC_C += \
322
322
reset.c \
323
323
timer_handler.c \
324
324
325
- ifeq ($(CIRCUITPY_PWMIO ) ,1)
326
- SRC_C += shared_timers.c
327
- endif
328
-
329
- ifeq ($(CIRCUITPY_AUDIOIO ) ,1)
325
+ # This is an OR because it filters to any 1s and then checks to see if it is not
326
+ # empty.
327
+ ifneq (,$(filter 1,$(CIRCUITPY_PWMIO ) $(CIRCUITPY_AUDIOIO ) $(CIRCUITPY_RGBMATRIX ) ) )
330
328
SRC_C += shared_timers.c
331
329
endif
332
330
Original file line number Diff line number Diff line change 31
31
#include "common-hal/pwmio/PWMOut.h"
32
32
#include "shared-bindings/pwmio/PWMOut.h"
33
33
#include "shared-bindings/microcontroller/Processor.h"
34
+ #include "shared_timers.h"
34
35
#include "timer_handler.h"
35
36
36
37
#include "atmel_start_pins.h"
37
38
#include "hal/utils/include/utils_repeat_macro.h"
39
+ #include "samd/pins.h"
38
40
#include "samd/timers.h"
39
41
#include "supervisor/shared/translate.h"
40
42
41
- #include "samd/pins.h"
42
-
43
43
#undef ENABLE
44
44
45
45
#define _TCC_SIZE (unused , n ) TCC##n##_SIZE,
@@ -77,16 +77,11 @@ void pwmout_reset(void) {
77
77
target_tcc_frequencies [i ] = 0 ;
78
78
tcc_refcount [i ] = 0 ;
79
79
}
80
- Tcc * tccs [TCC_INST_NUM ] = TCC_INSTS ;
81
80
for (int i = 0 ; i < TCC_INST_NUM ; i ++ ) {
82
81
if (!timer_ok_to_reset (i , false)) {
83
82
continue ;
84
83
}
85
- uint8_t mask = 0xff ;
86
- for (uint8_t j = 0 ; j < tcc_cc_num [i ]; j ++ ) {
87
- mask <<= 1 ;
88
- }
89
- tcc_channels [i ] = mask ;
84
+ tcc_channels [i ] = 0xff << tcc_cc_num [i ];
90
85
}
91
86
}
92
87
Original file line number Diff line number Diff line change 29
29
#include "common-hal/rgbmatrix/RGBMatrix.h"
30
30
31
31
#include "samd/timers.h"
32
+ #include "shared_timers.h"
32
33
#include "timer_handler.h"
33
34
34
35
void * common_hal_rgbmatrix_timer_allocate (rgbmatrix_rgbmatrix_obj_t * self ) {
You can’t perform that action at this time.
0 commit comments