summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Shawcroft <scott.shawcroft@gmail.com>2018-02-16 10:05:28 -0800
committerScott Shawcroft <scott.shawcroft@gmail.com>2018-02-16 10:05:28 -0800
commita2b18b75d4bc68aa93edf67509185cb6e18f596b (patch)
treef2185818ac8470bc4d097d883e01c389471928c3
parenteb2b41810a8679fffd4a6e149ec84565fea09e95 (diff)
Fix loops and comma style.
-rw-r--r--ports/atmel-samd/common-hal/pulseio/PWMOut.c2
-rw-r--r--ports/atmel-samd/common-hal/pulseio/PulseOut.c2
-rw-r--r--ports/atmel-samd/timers.c20
3 files changed, 12 insertions, 12 deletions
diff --git a/ports/atmel-samd/common-hal/pulseio/PWMOut.c b/ports/atmel-samd/common-hal/pulseio/PWMOut.c
index cbcdeb03c..c68ea6985 100644
--- a/ports/atmel-samd/common-hal/pulseio/PWMOut.c
+++ b/ports/atmel-samd/common-hal/pulseio/PWMOut.c
@@ -156,7 +156,7 @@ void common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
direction = 1;
start = 0;
}
- for (uint8_t i = start; i >= 0 && i < NUM_TIMERS_PER_PIN && timer == NULL; i += direction) {
+ for (int8_t i = start; i >= 0 && i < NUM_TIMERS_PER_PIN && timer == NULL; i += direction) {
const pin_timer_t* t = &pin->timer[i];
if ((!t->is_tc && t->index >= TCC_INST_NUM) ||
(t->is_tc && t->index >= TC_INST_NUM)) {
diff --git a/ports/atmel-samd/common-hal/pulseio/PulseOut.c b/ports/atmel-samd/common-hal/pulseio/PulseOut.c
index d0cf8e666..95b0bbee0 100644
--- a/ports/atmel-samd/common-hal/pulseio/PulseOut.c
+++ b/ports/atmel-samd/common-hal/pulseio/PulseOut.c
@@ -98,7 +98,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self,
if (refcount == 0) {
// Find a spare timer.
Tc *tc = NULL;
- uint8_t index = TC_INST_NUM - 1;
+ int8_t index = TC_INST_NUM - 1;
for (; index >= 0; index--) {
if (tc_insts[index]->COUNT16.CTRLA.bit.ENABLE == 0) {
tc = tc_insts[index];
diff --git a/ports/atmel-samd/timers.c b/ports/atmel-samd/timers.c
index 7b85c5b26..7b5d06cb0 100644
--- a/ports/atmel-samd/timers.c
+++ b/ports/atmel-samd/timers.c
@@ -46,10 +46,10 @@ const uint8_t tc_gclk_ids[TC_INST_NUM] = {TC3_GCLK_ID,
TC4_GCLK_ID,
TC5_GCLK_ID,
#ifdef TC6_GCLK_ID
- , TC6_GCLK_ID
+ TC6_GCLK_ID,
#endif
#ifdef TC7_GCLK_ID
- , TC7_GCLK_ID
+ TC7_GCLK_ID,
#endif
};
const uint8_t tcc_gclk_ids[3] = {TCC0_GCLK_ID, TCC1_GCLK_ID, TCC2_GCLK_ID};
@@ -59,18 +59,18 @@ const uint8_t tcc_cc_num[5] = {6, 4, 3, 2, 2};
const uint8_t tc_gclk_ids[TC_INST_NUM] = {TC0_GCLK_ID,
TC1_GCLK_ID,
TC2_GCLK_ID,
- TC3_GCLK_ID
+ TC3_GCLK_ID,
#ifdef TC4_GCLK_ID
- , TC4_GCLK_ID
+ TC4_GCLK_ID,
#endif
#ifdef TC5_GCLK_ID
- , TC5_GCLK_ID
+ TC5_GCLK_ID,
#endif
#ifdef TC6_GCLK_ID
- , TC6_GCLK_ID
+ TC6_GCLK_ID,
#endif
#ifdef TC7_GCLK_ID
- , TC7_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,
@@ -91,12 +91,12 @@ IRQn_Type const tc_irq[TC_INST_NUM] = {
#endif
TC3_IRQn,
TC4_IRQn,
- TC5_IRQn
+ TC5_IRQn,
#ifdef TC6
- , TC6_IRQn
+ TC6_IRQn,
#endif
#ifdef TC7
- , TC7_IRQn
+ TC7_IRQn,
#endif
};