summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2019-05-31 10:40:20 +0200
committerMarcin Bukat <marcin.bukat@gmail.com>2019-05-31 10:42:40 +0200
commit2de2636d6bfc4fac94eee87696b8c2375d14648b (patch)
treeba63fd755811c7a1da81f4475e9095ba149cfef5 /apps
parent38cceb95638657c58844a67f5a5cc52e745c8fc1 (diff)
downloadrockbox-2de2636d6bfc4fac94eee87696b8c2375d14648b.tar.gz
rockbox-2de2636d6bfc4fac94eee87696b8c2375d14648b.zip
Fix IRAM overflow introduced in 7a8c9daf7ef
There is no easy way to determine iram available for test_mem plugin and PLUGIN_BUFFER_SIZE is definitely wrong. Restore previous IRAM buffer sizing Change-Id: Ia563efd46497438c111efc8d7d2bf65904ca9847
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/test_mem.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/plugins/test_mem.c b/apps/plugins/test_mem.c
index 0b623fd5c8..66d6248dcc 100644
--- a/apps/plugins/test_mem.c
+++ b/apps/plugins/test_mem.c
@@ -21,8 +21,6 @@
#include "plugin.h"
-
-
#if PLUGIN_BUFFER_SIZE <= 0x8000
#define BUF_SIZE (1<<12) /* 16 KB = (1<<12)*sizeof(int) */
#elif PLUGIN_BUFFER_SIZE <= 0x10000
@@ -39,10 +37,17 @@ static int loop_repeat_dram = LOOP_REPEAT_DRAM;
static volatile int buf_dram[BUF_SIZE] MEM_ALIGN_ATTR;
#if defined(PLUGIN_USE_IRAM)
+
+#if PLUGIN_BUFFER_SIZE <= 0x8000
+#define IBUF_SIZE (1<<12) /* 16 KB = (1<<12)*sizeof(int) */
+#else
+#define IBUF_SIZE (1<<13) /* 32 KB = (1<<13)*sizeof(int) */
+#endif
+
#define LOOP_REPEAT_IRAM 256
#define MAX_REPEAT_IRAM 512
static int loop_repeat_iram = LOOP_REPEAT_DRAM;
-static volatile int buf_iram[BUF_SIZE] IBSS_ATTR MEM_ALIGN_ATTR;
+static volatile int buf_iram[IBUF_SIZE] IBSS_ATTR MEM_ALIGN_ATTR;
#endif
/* (Byte per loop * loops)>>20 * ticks per s * 10 / ticks = dMB per s */