1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c
index 405b710..954369e 100644
--- a/firmware/target/arm/as3525/debug-as3525.c
+++ b/firmware/target/arm/as3525/debug-as3525.c
@@ -347,6 +347,7 @@ bool __dbg_ports(void)
     lcd_clear_display();
     lcd_setfont(FONT_SYSFIXED);

+#if 0
     while(1)
     {
         line = 0;
@@ -367,6 +368,46 @@ bool __dbg_ports(void)
         if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
             break;
     }
+#else
+    static int i_test[512] IBSS_ATTR;
+    static int d_test[512];
+    int x,y;
+    int ir_start,ir_stop,iw_start,iw_stop;
+    int dr_start,dr_stop,dw_start,dw_stop;
+
+#define max (1<<25)
+
+    iw_start = current_tick;
+    for(x = 0; x < max ; x++)
+        i_test[x%512] = x;
+    iw_stop = current_tick;
+
+    dw_start = current_tick;
+    for(x = 0; x < max ; x++)
+        d_test[x%512] = x;
+    dw_stop = current_tick;
+
+    ir_start = current_tick;
+    for(x = 0; x < max ; x++)
+        y = i_test[x%512];
+    ir_stop = current_tick;
+
+    dr_start = current_tick;
+    for(x = 0; x < max ; x++)
+        y = d_test[x%512];
+    dr_stop = current_tick;
+
+    line = 0;
+    _DEBUG_PRINTF("IRAM R %d ticks", ir_stop - ir_start);
+    _DEBUG_PRINTF("IRAM W %d ticks", iw_stop - iw_start);
+    _DEBUG_PRINTF("DRAM R %d ticks", dr_stop - dr_start);
+    _DEBUG_PRINTF("DRAM W %d ticks", dw_stop - dw_start);
+    lcd_update();
+
+
+    while(button_get_w_tmo(HZ/10) != (DEBUG_CANCEL|BUTTON_REL)) ;
+
+#endif
     lcd_setfont(FONT_UI);
     return false;
 }