Skip to content

Commit

Permalink
cpu/sam0: remove bitfield usage in headers
Browse files Browse the repository at this point in the history
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
  • Loading branch information
dylad committed Jun 25, 2024
1 parent 25a04e6 commit 04e4770
Showing 1 changed file with 8 additions and 3 deletions.
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

0 comments on commit 04e4770

Please sign in to comment.