summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/atmel-samd/timers.c18
-rw-r--r--ports/atmel-samd/timers.h2
2 files changed, 17 insertions, 3 deletions
diff --git a/ports/atmel-samd/timers.c b/ports/atmel-samd/timers.c
index 7b5d06cb0..2e8541f24 100644
--- a/ports/atmel-samd/timers.c
+++ b/ports/atmel-samd/timers.c
@@ -73,8 +73,16 @@ const uint8_t tc_gclk_ids[TC_INST_NUM] = {TC0_GCLK_ID,
TC7_GCLK_ID,
#endif
};
-const uint8_t tcc_gclk_ids[5] = {TCC0_GCLK_ID, TCC1_GCLK_ID, TCC2_GCLK_ID, TCC3_GCLK_ID,
- TCC4_GCLK_ID};
+const uint8_t tcc_gclk_ids[TCC_INST_NUM] = {TCC0_GCLK_ID,
+ TCC1_GCLK_ID,
+ TCC2_GCLK_ID,
+#ifdef TCC3_GCLK_ID
+ TCC3_GCLK_ID,
+#endif
+#ifdef TCC4_GCLK_ID
+ TCC4_GCLK_ID
+#endif
+ };
#endif
Tc* const tc_insts[TC_INST_NUM] = TC_INSTS;
Tcc* const tcc_insts[TCC_INST_NUM] = TCC_INSTS;
@@ -89,9 +97,15 @@ IRQn_Type const tc_irq[TC_INST_NUM] = {
#ifdef TC2
TC2_IRQn,
#endif
+#ifdef TC3
TC3_IRQn,
+#endif
+#ifdef TC4
TC4_IRQn,
+#endif
+#ifdef TC5
TC5_IRQn,
+#endif
#ifdef TC6
TC6_IRQn,
#endif
diff --git a/ports/atmel-samd/timers.h b/ports/atmel-samd/timers.h
index a22ec7484..bb3ab5ee7 100644
--- a/ports/atmel-samd/timers.h
+++ b/ports/atmel-samd/timers.h
@@ -36,7 +36,7 @@ const uint8_t tcc_gclk_ids[3];
#ifdef SAMD51
const uint8_t tcc_cc_num[5];
const uint8_t tc_gclk_ids[TC_INST_NUM];
-const uint8_t tcc_gclk_ids[5];
+const uint8_t tcc_gclk_ids[TCC_INST_NUM];
#endif
Tc* const tc_insts[TC_INST_NUM];
Tcc* const tcc_insts[TCC_INST_NUM];