Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/sam0_common: avoid bitfield usage #20747

Merged
merged 19 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
3c64901
cpu/sam0/periph: remove bitfield usage in ADC driver
dylad Jun 6, 2024
292111a
cpu/sam0/periph: remove bitfield usage in DAC driver
dylad Jun 6, 2024
9d29813
cpu/sam0/periph: remove bitfield usage in DMAC driver
dylad Jun 6, 2024
1140241
cpu/sam0/periph: remove bitfield usage in GMAC driver
dylad Jun 6, 2024
ae7ed46
cpu/sam0/periph: remove bitfield usage in flashpage driver
dylad Jun 10, 2024
1e7167d
cpu/sam0/periph: remove bitfield usage in gpio driver
dylad Jun 10, 2024
b2bbc4c
cpu/sam0/periph: remove bitfield usage in gpio_ll_irq driver
dylad Jun 10, 2024
8af7b3b
cpu/sam0/periph: remove bitfield usage in gpio_ll driver
dylad Jun 10, 2024
38c65b9
cpu/sam0/periph: remove bitfield usage in PWM driver
dylad Jun 10, 2024
37b03d8
cpu/sam0/periph: remove bitfield usage in trng driver
dylad Jun 10, 2024
a66eebb
cpu/sam0/periph: remove bitfield usage in I2C driver
dylad Jun 10, 2024
7c1e66b
cpu/sam0/periph: remove bitfield usage in RTC/RTT driver
dylad Jun 10, 2024
925e98b
cpu/sam0/periph: remove bitfield usage in SPI driver
dylad Jun 10, 2024
6ccaca1
cpu/sam0/periph: remove bitfield usage in timer driver
dylad Jun 11, 2024
f31ac8a
cpu/sam0/periph: remove bitfield usage in UART driver
dylad Jun 11, 2024
707fecb
cpu/sam0/periph: remove bitfield usage in usbdev driver
dylad Jun 11, 2024
25a04e6
cpu/sam0/periph: remove bitfield usage in watchdog driver
dylad Jun 11, 2024
04e4770
cpu/sam0: remove bitfield usage in headers
dylad Jun 11, 2024
ccc155e
cpu/sam0: remove bitfield usage in sdhc driver
dylad Jun 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions cpu/sam0_common/include/periph_cpu_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,13 @@ typedef enum {
static inline void sam0_set_voltage_regulator(sam0_supc_t src)
{
#ifdef REG_SUPC_VREG
SUPC->VREG.bit.SEL = src;
while (!SUPC->STATUS.bit.VREGRDY) {}
if (src == SAM0_VREG_BUCK) {
SUPC->VREG.reg |= (1 << SUPC_VREG_SEL_Pos);
}
else {
SUPC->VREG.reg &= ~(1 << SUPC_VREG_SEL_Pos);
}
while (!(SUPC->STATUS.reg & SUPC_STATUS_VREGRDY)) {}
#else
(void) src;
assert(0);
Expand Down Expand Up @@ -867,7 +872,7 @@ static inline void sercom_set_gen(void *sercom, uint8_t gclk)
static inline bool cpu_woke_from_backup(void)
{
#ifdef RSTC_RCAUSE_BACKUP
return RSTC->RCAUSE.bit.BACKUP;
return RSTC->RCAUSE.reg & RSTC_RCAUSE_BACKUP;
#else
return false;
#endif
Expand Down
13 changes: 10 additions & 3 deletions cpu/sam0_common/periph/adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,12 @@ static int _adc_configure(Adc *dev, adc_res_t res)
/* Set ADC resolution */
#ifdef ADC_CTRLC_RESSEL
/* Reset resolution bits in CTRLC */
dev->CTRLC.bit.RESSEL = res & 0x3;
uint32_t ctrlc = dev->CTRLC.reg;
dev->CTRLC.reg = ((ctrlc & ~ADC_CTRLC_RESSEL_Msk) | ADC_CTRLC_RESSEL(res));
#else
/* Reset resolution bits in CTRLB */
dev->CTRLB.bit.RESSEL = res & 0x3;
uint32_t ctrlb = dev->CTRLB.reg;
dev->CTRLB.reg = ((ctrlb & ~ADC_CTRLB_RESSEL_Msk) | ADC_CTRLB_RESSEL(res));
Comment on lines +193 to +198
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the function is called configure but does not configure all the bits (and nothing else in this file does) this seem to me like bad code translated well.

you might ignore this comment your translation mimics the old behavior

#endif

/* Set Voltage Reference */
Expand Down Expand Up @@ -317,7 +319,12 @@ static int32_t _sample(adc_t line)
| adc_channels[line].inputctrl
| (diffmode ? 0 : ADC_NEG_INPUT);
#ifdef ADC_CTRLB_DIFFMODE
dev->CTRLB.bit.DIFFMODE = diffmode;
if (diffmode) {
dev->CTRLB.reg |= ADC_CTRLB_DIFFMODE;
}
dylad marked this conversation as resolved.
Show resolved Hide resolved
else {
dev->CTRLB.reg &= ~ADC_CTRLB_DIFFMODE;
}
#endif
_wait_syncbusy(dev);

Expand Down
6 changes: 3 additions & 3 deletions cpu/sam0_common/periph/dac.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#ifdef DAC_SYNCBUSY_MASK
while (DAC->SYNCBUSY.reg) {}
#else
while (DAC->STATUS.bit.SYNCBUSY) {}
while (DAC->STATUS.reg & DAC_STATUS_SYNCBUSY) {}
#endif
}

Expand Down Expand Up @@ -110,7 +110,7 @@
_dac_init_clock(line);

/* Settings can only be changed when DAC is disabled */
DAC->CTRLA.bit.ENABLE = 0;
DAC->CTRLA.reg &= ~DAC_CTRLA_ENABLE;
_sync();

#ifdef DAC_DACCTRL_ENABLE
Expand All @@ -123,9 +123,9 @@
#ifdef DAC_CTRLB_EOEN
| DAC_CTRLB_EOEN
#endif
;

Check warning on line 126 in cpu/sam0_common/periph/dac.c

View workflow job for this annotation

GitHub Actions / static-tests

semicolon is isolated from other tokens

DAC->CTRLA.bit.ENABLE = 1;
DAC->CTRLA.reg |= DAC_CTRLA_ENABLE;
_sync();

#ifdef DAC_STATUS_READY
Expand Down
14 changes: 7 additions & 7 deletions cpu/sam0_common/periph/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void dma_init(void)
NVIC_EnableIRQ(DMAC_IRQn);
#endif

DMAC->CTRL.bit.DMAENABLE = 1;
DMAC->CTRL.reg |= DMAC_CTRL_DMAENABLE;
}

dma_t dma_acquire_channel(void)
Expand Down Expand Up @@ -255,11 +255,11 @@ void dma_start(dma_t dma)

#ifdef REG_DMAC_CHID
unsigned state = irq_disable();
DMAC->CHID.bit.ID = dma;
DMAC->CHID.reg = DMAC_CHID_ID(dma);
DMAC->CHCTRLA.reg = DMAC_CHCTRLA_ENABLE;
irq_restore(state);
#else
DMAC->Channel[dma].CHCTRLA.bit.ENABLE = 1;
DMAC->Channel[dma].CHCTRLA.reg |= DMAC_CHCTRLA_ENABLE;
#endif
}

Expand All @@ -274,15 +274,15 @@ void dma_cancel(dma_t dma)
DEBUG("[DMA]: Cancelling active transfer: %u\n", dma);
#ifdef REG_DMAC_CHID
unsigned state = irq_disable();
DMAC->CHID.bit.ID = dma;
DMAC->CHID.reg = DMAC_CHID_ID(dma);
/* Write zero to the enable bit */
DMAC->CHCTRLA.reg = 0;
/* Wait until the active beat is finished */
while (DMAC->CHCTRLA.bit.ENABLE) {}
while (DMAC->CHCTRLA.reg & DMAC_CHCTRLA_ENABLE) {}
irq_restore(state);
#else
DMAC->Channel[dma].CHCTRLA.bit.ENABLE = 0;
while (DMAC->Channel[dma].CHCTRLA.bit.ENABLE) {}
DMAC->Channel[dma].CHCTRLA.reg &= ~DMAC_CHCTRLA_ENABLE;
while (DMAC->Channel[dma].CHCTRLA.reg & DMAC_CHCTRLA_ENABLE) {}
#endif
}

Expand Down
4 changes: 2 additions & 2 deletions cpu/sam0_common/periph/eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
/* GMAC buffer descriptors */
#define GMAC_DESC_ALIGNMENT 8
#define GMAC_BUF_ALIGNMENT 32
static struct eth_buf_desc rx_desc[ETH_RX_BUFFER_COUNT] __attribute__((aligned(GMAC_DESC_ALIGNMENT)));

Check warning on line 81 in cpu/sam0_common/periph/eth.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
static struct eth_buf_desc tx_desc[ETH_TX_BUFFER_COUNT] __attribute__((aligned(GMAC_DESC_ALIGNMENT)));

Check warning on line 82 in cpu/sam0_common/periph/eth.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters

static struct eth_buf_desc *rx_curr;
static struct eth_buf_desc *tx_curr;
Expand All @@ -89,8 +89,8 @@
static uint8_t tx_idx;
static uint8_t rx_idx;

static uint8_t rx_buf[ETH_RX_BUFFER_COUNT][ETH_RX_BUFFER_SIZE] __attribute__((aligned(GMAC_BUF_ALIGNMENT)));

Check warning on line 92 in cpu/sam0_common/periph/eth.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
static uint8_t tx_buf[ETH_TX_BUFFER_COUNT][ETH_TX_BUFFER_SIZE] __attribute__((aligned(GMAC_BUF_ALIGNMENT)));

Check warning on line 93 in cpu/sam0_common/periph/eth.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
extern sam0_eth_netdev_t _sam0_eth_dev;

static bool _is_sleeping;
Expand Down Expand Up @@ -132,7 +132,7 @@
| GMAC_MAN_OP(PHY_READ_OP);

/* Wait for operation completion */
while (!GMAC->NSR.bit.IDLE) {}
while (!(GMAC->NSR.reg & GMAC_NSR_IDLE)) {}
/* return content of shift register */
return (GMAC->MAN.reg & GMAC_MAN_DATA_Msk);
}
Expand All @@ -148,7 +148,7 @@
| GMAC_MAN_CLTTO | GMAC_MAN_DATA(data);

/* Wait for operation completion */
while (!GMAC->NSR.bit.IDLE) {}
while (!(GMAC->NSR.reg & GMAC_NSR_IDLE)) {}
}

void sam0_eth_poweron(void)
Expand Down
6 changes: 3 additions & 3 deletions cpu/sam0_common/periph/flashpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
static inline void wait_nvm_is_ready(void)
{
#ifdef NVMCTRL_STATUS_READY
while (!_NVMCTRL->STATUS.bit.READY) {}
while (!(_NVMCTRL->STATUS.reg & NVMCTRL_STATUS_READY)) {}
#else
while (!_NVMCTRL->INTFLAG.bit.READY) {}
while (!(_NVMCTRL->INTFLAG.reg & NVMCTRL_INTFLAG_READY)) {}
#endif
}

Expand Down Expand Up @@ -89,7 +89,7 @@ static void _lock(unsigned state)

/* cached flash contents may have changed - invalidate cache */
#ifdef CMCC
CMCC->MAINT0.bit.INVALL = 1;
CMCC->MAINT0.reg |= CMCC_MAINT0_INVALL;
#endif

irq_restore(state);
Expand Down
12 changes: 6 additions & 6 deletions cpu/sam0_common/periph/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,12 @@
#ifdef MODULE_PERIPH_GPIO_IRQ

#ifdef CPU_COMMON_SAMD21
#define EIC_SYNC() while (_EIC->STATUS.bit.SYNCBUSY)
#define EIC_SYNC() while (_EIC->STATUS.reg & EIC_STATUS_SYNCBUSY)
#else
#define EIC_SYNC() while (_EIC->SYNCBUSY.bit.ENABLE)
#define EIC_SYNC() while (_EIC->SYNCBUSY.reg & EIC_SYNCBUSY_ENABLE)

Check warning on line 247 in cpu/sam0_common/periph/gpio.c

View workflow job for this annotation

GitHub Actions / static-tests

full block {} expected in the control structure
#endif

static int _exti(gpio_t pin)

Check warning on line 250 in cpu/sam0_common/periph/gpio.c

View workflow job for this annotation

GitHub Actions / static-tests

full block {} expected in the control structure
{
unsigned port_num = ((pin >> 7) & 0x03);

Expand Down Expand Up @@ -349,7 +349,7 @@
GCLK->CLKCTRL.reg = EIC_GCLK_ID
| GCLK_CLKCTRL_CLKEN
| GCLK_CLKCTRL_GEN(CONFIG_SAM0_GCLK_GPIO);
while (GCLK->STATUS.bit.SYNCBUSY) {}
while (GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY) {}
#else /* CPU_COMMON_SAML21 */
/* enable clocks for the EIC module */
MCLK->APBAMASK.reg |= MCLK_APBAMASK_EIC;
Expand Down Expand Up @@ -403,7 +403,7 @@
| GCLK_CLKCTRL_CLKEN
| GCLK_CLKCTRL_GEN(CONFIG_SAM0_GCLK_GPIO);
}
while (GCLK->STATUS.bit.SYNCBUSY) {}
while (GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY) {}
#else
uint32_t ctrla_reg = EIC_CTRLA_ENABLE;

Expand All @@ -423,7 +423,7 @@
{
#if defined(PM_SLEEPCFG_SLEEPMODE_STANDBY)
(void) deep;
unsigned mode = PM->SLEEPCFG.bit.SLEEPMODE;
unsigned mode = PM->SLEEPCFG.reg & PM_SLEEPCFG_SLEEPMODE_Msk;

if (mode == PM_SLEEPCFG_SLEEPMODE_STANDBY) {
DEBUG_PUTS("gpio: switching EIC to slow clock");
Expand All @@ -447,7 +447,7 @@
#if defined(PM_SLEEPCFG_SLEEPMODE_STANDBY)
(void) deep;

if (PM->SLEEPCFG.bit.SLEEPMODE == PM_SLEEPCFG_SLEEPMODE_STANDBY) {
if ((PM->SLEEPCFG.reg & PM_SLEEPCFG_SLEEPMODE_Msk) == PM_SLEEPCFG_SLEEPMODE_STANDBY) {
DEBUG_PUTS("gpio: switching EIC to fast clock");
reenable_eic(_EIC_CLOCK_FAST);
}
Expand Down
4 changes: 2 additions & 2 deletions cpu/sam0_common/periph/gpio_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ void gpio_ll_mux(gpio_port_t port, uint8_t pin, gpio_mux_t mux)

unsigned irq_state = irq_disable();
if (mux == GPIO_MUX_DISABLED) {
apb->PINCFG[pin].bit.PMUXEN = 0;
apb->PINCFG[pin].reg &= ~PORT_PINCFG_PMUXEN;
}
else {
unsigned pmux_reg = pin >> 1;
unsigned pmux_pos = (pin & 0x01) << 2;
apb->PINCFG[pin].bit.PMUXEN = 1;
apb->PINCFG[pin].reg |= PORT_PINCFG_PMUXEN;
unsigned pmux = apb->PMUX[pmux_reg].reg;
pmux &= ~(PORT_PMUX_PMUXE_Msk << pmux_pos);
pmux |= (unsigned)mux << pmux_pos;
Expand Down
6 changes: 3 additions & 3 deletions cpu/sam0_common/periph/gpio_ll_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ static void disable_trigger(unsigned exti_num)
static void eic_sync(void)
{
#ifdef EIC_STATUS_SYNCBUSY
while (EIC_SEC->STATUS.bit.SYNCBUSY) { }
while (EIC_SEC->STATUS.reg & EIC_STATUS_SYNCBUSY) {}
#endif
#ifdef EIC_SYNCBUSY_ENABLE
while (EIC_SEC->SYNCBUSY.bit.ENABLE) { }
while (EIC_SEC->SYNCBUSY.reg & EIC_SYNCBUSY_ENABLE) {}
#endif
}

Expand All @@ -136,7 +136,7 @@ static void eic_enable_clock(void)
GCLK->CLKCTRL.reg = EIC_GCLK_ID
| GCLK_CLKCTRL_CLKEN
| GCLK_CLKCTRL_GEN(CONFIG_SAM0_GCLK_GPIO);
while (GCLK->STATUS.bit.SYNCBUSY) {}
while (GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY) {}
#endif
#ifdef MCLK_APBAMASK_EIC
MCLK->APBAMASK.reg |= MCLK_APBAMASK_EIC;
Expand Down
7 changes: 4 additions & 3 deletions cpu/sam0_common/periph/hwrng.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@
void hwrng_init(void)
{
/* Enable the MCLK */
MCLK->APBCMASK.bit.TRNG_ = 1;
MCLK->APBCMASK.reg |= MCLK_APBCMASK_TRNG;

/* Enable the TRNG */
TRNG->CTRLA.bit.ENABLE = 1;
TRNG->CTRLA.reg |= TRNG_CTRLA_ENABLE;

}

uint32_t hwrand(void)
{
while (!TRNG->INTFLAG.bit.DATARDY) {}
while (!(TRNG->INTFLAG.reg & TRNG_INTFLAG_DATARDY)) {}
return TRNG->DATA.reg;
}

Expand Down
10 changes: 5 additions & 5 deletions cpu/sam0_common/periph/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
static void _syncbusy(SercomI2cm *dev)
{
#ifdef SERCOM_I2CM_STATUS_SYNCBUSY
while (dev->STATUS.bit.SYNCBUSY) {}
while (dev->STATUS.reg & SERCOM_I2CM_STATUS_SYNCBUSY) {}
#else
while (dev->SYNCBUSY.reg) {}
#endif
Expand All @@ -88,9 +88,9 @@
while (dev->CTRLA.reg & SERCOM_SPI_CTRLA_SWRST) {}

#ifdef SERCOM_I2CM_STATUS_SYNCBUSY
while (dev->STATUS.bit.SYNCBUSY) {}
while (dev->STATUS.reg & SERCOM_I2CM_STATUS_SYNCBUSY) {}
#else
while (dev->SYNCBUSY.bit.SWRST) {}
while (dev->SYNCBUSY.reg & SERCOM_I2CM_SYNCBUSY_SWRST) {}
#endif
}

Expand Down Expand Up @@ -311,7 +311,7 @@
if (bus(dev) == NULL) {
return;
}
bus(dev)->CTRLA.bit.ENABLE = 1;
bus(dev)->CTRLA.reg |= SERCOM_I2CM_CTRLA_ENABLE;
_syncbusy(bus(dev));
}

Expand All @@ -322,7 +322,7 @@
if (bus(dev) == NULL) {
return;
}
bus(dev)->CTRLA.bit.ENABLE = 0;
bus(dev)->CTRLA.reg &= ~SERCOM_I2CM_CTRLA_ENABLE;
_syncbusy(bus(dev));
}

Expand All @@ -344,11 +344,11 @@
/* Some devices (e.g. SHT2x) can hold the bus while
preparing the reply */
if (_wait_for_response(dev, 100 * SAMD21_I2C_TIMEOUT) < 0)
return -ETIMEDOUT;

Check warning on line 347 in cpu/sam0_common/periph/i2c.c

View workflow job for this annotation

GitHub Actions / static-tests

full block {} expected in the control structure
}
else {
if (_wait_for_response(dev, SAMD21_I2C_TIMEOUT) < 0)
return -ETIMEDOUT;

Check warning on line 351 in cpu/sam0_common/periph/i2c.c

View workflow job for this annotation

GitHub Actions / static-tests

full block {} expected in the control structure
}

/* Check for address response error unless previous error is detected. */
Expand Down Expand Up @@ -447,7 +447,7 @@
/* Wait for response on bus. */
if (length > 0) {
if (_wait_for_response(dev, SAMD21_I2C_TIMEOUT) < 0)
return -ETIMEDOUT;

Check warning on line 450 in cpu/sam0_common/periph/i2c.c

View workflow job for this annotation

GitHub Actions / static-tests

full block {} expected in the control structure
}
count++;
}
Expand Down
11 changes: 6 additions & 5 deletions cpu/sam0_common/periph/pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
typedef TcCount8 Tcc;
#define TCC_CTRLA_ENABLE TC_CTRLA_ENABLE
#define TCC_SYNCBUSY_CC0 TC_SYNCBUSY_CC0
#define TCC_STATUS_SYNCBUSY TC_STATUS_SYNCBUSY
#ifdef TC_SYNCBUSY_MASK
#define TCC_SYNCBUSY_MASK TC_SYNCBUSY_MASK
#endif
Expand Down Expand Up @@ -216,8 +217,8 @@ static void poweroff(pwm_t dev)
static void _tc_init(Tc *tc, pwm_mode_t mode, uint8_t prescaler, uint8_t res)
{
/* reset TC module */
tc->COUNT8.CTRLA.bit.SWRST = 1;
while (tc->COUNT8.CTRLA.bit.SWRST) {}
tc->COUNT8.CTRLA.reg |= TC_CTRLA_SWRST;
while (tc->COUNT8.CTRLA.reg & TC_CTRLA_SWRST) {}

/* set PWM mode */
switch (mode) {
Expand Down Expand Up @@ -250,7 +251,7 @@ static void _tc_init(Tc *tc, pwm_mode_t mode, uint8_t prescaler, uint8_t res)
tc->COUNT8.PER.reg = (res - 1);

#ifdef TC_STATUS_SYNCBUSY
while (tc->COUNT8.STATUS.bit.SYNCBUSY) {}
while (tc->COUNT8.STATUS.reg & TC_STATUS_SYNCBUSY) {}
#else
while (tc->COUNT8.SYNCBUSY.reg) {}
#endif
Expand Down Expand Up @@ -361,7 +362,7 @@ static void _tc_set(Tc *tc, uint8_t chan, uint16_t value)
tc->COUNT8.CC[chan].reg = value;

#ifdef TC_STATUS_SYNCBUSY
while (tc->COUNT8.STATUS.bit.SYNCBUSY) {}
while (tc->COUNT8.STATUS.reg & TC_STATUS_SYNCBUSY) {}
#else
while (tc->COUNT8.SYNCBUSY.reg & (TC_SYNCBUSY_CC0 << chan)) {}
#endif
Expand All @@ -375,7 +376,7 @@ static void _tcc_set(Tcc *tcc, uint8_t chan, uint16_t value)
#ifdef TCC_SYNCBUSY_MASK
while (tcc->SYNCBUSY.reg & (TCC_SYNCBUSY_CC0 << chan)) {}
#else
while (tcc->STATUS.bit.SYNCBUSY) {}
while (tcc->STATUS.reg & TCC_STATUS_SYNCBUSY) {}
#endif
}

Expand Down
Loading
Loading