summaryrefslogtreecommitdiff
path: root/apps/plugins/xworld/mixer.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/xworld/mixer.c')
-rw-r--r--apps/plugins/xworld/mixer.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/plugins/xworld/mixer.c b/apps/plugins/xworld/mixer.c
index de7536cd36..6035045239 100644
--- a/apps/plugins/xworld/mixer.c
+++ b/apps/plugins/xworld/mixer.c
@@ -24,7 +24,7 @@
24#include "serializer.h" 24#include "serializer.h"
25#include "sys.h" 25#include "sys.h"
26 26
27static int8_t ICODE_ATTR addclamp(int a, int b) { 27static int8_t addclamp(int a, int b) {
28 int add = a + b; 28 int add = a + b;
29 if (add < -128) { 29 if (add < -128) {
30 add = -128; 30 add = -128;
@@ -121,11 +121,11 @@ void mixer_stopAll(struct Mixer* mx) {
121/* Since there is no way to know when SDL will ask for a buffer fill, we need */ 121/* Since there is no way to know when SDL will ask for a buffer fill, we need */
122/* to synchronize with a mutex so the channels remain stable during the execution */ 122/* to synchronize with a mutex so the channels remain stable during the execution */
123/* of this method. */ 123/* of this method. */
124static void ICODE_ATTR mixer_mix(struct Mixer* mx, int8_t *buf, int len) { 124static void mixer_mix(struct Mixer* mx, int8_t *buf, int len) {
125 int8_t *pBuf; 125 int8_t *pBuf;
126 126
127 struct MutexStack_t ms; 127 /* disabled because this will be called in IRQ */
128 MutexStack(&ms, mx->sys, mx->_mutex); 128 /*sys_lockMutex(mx->sys, mx->_mutex);*/
129 129
130 /* Clear the buffer since nothing guarantees we are receiving clean memory. */ 130 /* Clear the buffer since nothing guarantees we are receiving clean memory. */
131 rb->memset(buf, 0, len); 131 rb->memset(buf, 0, len);
@@ -170,11 +170,10 @@ static void ICODE_ATTR mixer_mix(struct Mixer* mx, int8_t *buf, int len) {
170 170
171 } 171 }
172 172
173 MutexStack_destroy(&ms); 173 /*sys_unlockMutex(mx->sys, mx->_mutex);*/
174} 174}
175 175
176static void ICODE_ATTR mixer_mixCallback(void *param, uint8_t *buf, int len) { 176static void mixer_mixCallback(void *param, uint8_t *buf, int len) {
177 debug(DBG_SND, "mixer_mixCallback");
178 mixer_mix((struct Mixer*)param, (int8_t *)buf, len); 177 mixer_mix((struct Mixer*)param, (int8_t *)buf, len);
179} 178}
180 179