diff --git a/apps/plugins/fft/fft.c b/apps/plugins/fft/fft.c index f57d2ab..e682e23 100644 --- a/apps/plugins/fft/fft.c +++ b/apps/plugins/fft/fft.c @@ -251,6 +251,11 @@ GREY_INFO_STRUCT #define FFT_ALLOC kiss_fftr_alloc #define FFT_FFT kiss_fftr #define FFT_CFG kiss_fftr_cfg +#ifdef ROCKBOX_STRICT_ALIGN +#define FFT_ALIGN(x) (typeof(x))(((intptr_t) x + 3) &~ 3) +#else +#define FFT_ALIGN(x) x +#endif #define __COEFF(type,size) type##_##size #define _COEFF(x, y) __COEFF(x,y) /* force the preprocessor to evaluate FFT_SIZE) */ @@ -1106,6 +1111,8 @@ enum plugin_status plugin_start(const void* parameter) rb->cpu_boost(true); #endif + rb->mutex_init(&input_mutex); + /* Defaults */ bool run = true; graph_settings.mode = 0; @@ -1121,7 +1128,7 @@ enum plugin_status plugin_start(const void* parameter) bool changed_window = false; size_t size = sizeof(buffer); - FFT_CFG state = FFT_ALLOC(FFT_SIZE, 0, buffer, &size); + FFT_CFG state = FFT_ALIGN(FFT_ALLOC(FFT_SIZE, 0, buffer, &size)); if (state == 0) {