timer: Move union u32_u16_u from compiler.h to avr/timer.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
f582a36e4d
commit
45ba03efa3
|
@ -69,7 +69,10 @@ static uint32_t timer_last;
|
||||||
static __always_inline uint32_t
|
static __always_inline uint32_t
|
||||||
calc_time(uint32_t last, uint16_t cur)
|
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;
|
calc.val = last;
|
||||||
if (cur < calc.lo)
|
if (cur < calc.lo)
|
||||||
calc.hi++;
|
calc.hi++;
|
||||||
|
|
|
@ -39,11 +39,6 @@
|
||||||
(((x) + ((__divisor) / 2)) / (__divisor)); \
|
(((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) {
|
static inline void writel(void *addr, uint32_t val) {
|
||||||
*(volatile uint32_t *)addr = val;
|
*(volatile uint32_t *)addr = val;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue