diff --git a/src/avr/timer.c b/src/avr/timer.c index 0b248552..8cc3d550 100644 --- a/src/avr/timer.c +++ b/src/avr/timer.c @@ -69,7 +69,10 @@ static uint32_t timer_last; static __always_inline uint32_t calc_time(uint32_t last, uint16_t cur) { - union u32_u16_u calc; + union u32_u16_u { + struct { uint16_t lo, hi; }; + uint32_t val; + } calc; calc.val = last; if (cur < calc.lo) calc.hi++; diff --git a/src/compiler.h b/src/compiler.h index ba4b83d5..7085f864 100644 --- a/src/compiler.h +++ b/src/compiler.h @@ -39,11 +39,6 @@ (((x) + ((__divisor) / 2)) / (__divisor)); \ }) -union u32_u16_u { - struct { uint16_t lo, hi; }; - uint32_t val; -}; - static inline void writel(void *addr, uint32_t val) { *(volatile uint32_t *)addr = val; }