Fix build with filter to do OR

This commit is contained in:
Scott Shawcroft 2021-08-11 12:10:51 -07:00
parent 67c6932ca2
commit 7f016ae11e
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
3 changed files with 7 additions and 13 deletions

View File

@ -322,11 +322,9 @@ SRC_C += \
reset.c \
timer_handler.c \
ifeq ($(CIRCUITPY_PWMIO),1)
SRC_C += shared_timers.c
endif
ifeq ($(CIRCUITPY_AUDIOIO),1)
# This is an OR because it filters to any 1s and then checks to see if it is not
# empty.
ifneq (,$(filter 1,$(CIRCUITPY_PWMIO) $(CIRCUITPY_AUDIOIO) $(CIRCUITPY_RGBMATRIX)))
SRC_C += shared_timers.c
endif

View File

@ -31,15 +31,15 @@
#include "common-hal/pwmio/PWMOut.h"
#include "shared-bindings/pwmio/PWMOut.h"
#include "shared-bindings/microcontroller/Processor.h"
#include "shared_timers.h"
#include "timer_handler.h"
#include "atmel_start_pins.h"
#include "hal/utils/include/utils_repeat_macro.h"
#include "samd/pins.h"
#include "samd/timers.h"
#include "supervisor/shared/translate.h"
#include "samd/pins.h"
#undef ENABLE
#define _TCC_SIZE(unused, n) TCC##n##_SIZE,
@ -77,16 +77,11 @@ void pwmout_reset(void) {
target_tcc_frequencies[i] = 0;
tcc_refcount[i] = 0;
}
Tcc *tccs[TCC_INST_NUM] = TCC_INSTS;
for (int i = 0; i < TCC_INST_NUM; i++) {
if (!timer_ok_to_reset(i, false)) {
continue;
}
uint8_t mask = 0xff;
for (uint8_t j = 0; j < tcc_cc_num[i]; j++) {
mask <<= 1;
}
tcc_channels[i] = mask;
tcc_channels[i] = 0xff << tcc_cc_num[i];
}
}

View File

@ -29,6 +29,7 @@
#include "common-hal/rgbmatrix/RGBMatrix.h"
#include "samd/timers.h"
#include "shared_timers.h"
#include "timer_handler.h"
void *common_hal_rgbmatrix_timer_allocate(rgbmatrix_rgbmatrix_obj_t *self) {