summaryrefslogtreecommitdiffstats
path: root/firmware/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/buffer.c')
-rw-r--r--firmware/buffer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/firmware/buffer.c b/firmware/buffer.c
index d89d30b6ba..1eaff33de1 100644
--- a/firmware/buffer.c
+++ b/firmware/buffer.c
@@ -31,7 +31,8 @@ unsigned char *audiobuf;
void buffer_init(void)
{
- audiobuf = audiobuffer;
+ /* 32-bit aligned */
+ audiobuf = (void *)(((unsigned long)audiobuffer + 3) & ~3);
}
void *buffer_alloc(size_t size)
@@ -39,5 +40,7 @@ void *buffer_alloc(size_t size)
void *retval = audiobuf;
audiobuf += size;
+ /* 32-bit aligned */;
+ audiobuf = (void *)(((unsigned long)audiobuf + 3) & ~3);
return retval;
}