aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-06-01 09:52:02 -0400
committerKevin O'Connor <kevin@koconnor.net>2016-06-01 09:54:13 -0400
commit45ba03efa3596dc12989ddc47cdd3c242a1869f2 (patch)
tree237b9c0a562240a4e26269eda57ffdb3081995bc
parentf582a36e4df16d5709943f7df17a900c8bcc12ab (diff)
downloadkutter-45ba03efa3596dc12989ddc47cdd3c242a1869f2.tar.gz
kutter-45ba03efa3596dc12989ddc47cdd3c242a1869f2.tar.xz
kutter-45ba03efa3596dc12989ddc47cdd3c242a1869f2.zip
timer: Move union u32_u16_u from compiler.h to avr/timer.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--src/avr/timer.c5
-rw-r--r--src/compiler.h5
2 files changed, 4 insertions, 6 deletions
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;
}