Bigger graph buffer

1280000 samples -> 10.24s for 125kHz 8bit sampling

Allocate graph related memory on heap
This commit is contained in:
wh201906 committed 2023-11-14 10:05:13 +08:00
1 parent 42ab3ee1e6
commit 8b6a274e28
8 files changed
+42 -20

No files matched your search

+3 -1
View File
@@ -433,7 +433,7 @@ int CmdFlexdemod(const char *Cmd) {
#endif
int i, j, start, bit, sum;
int data[g_GraphTraceLen];
int *data = malloc(g_GraphTraceLen * sizeof(int));
memcpy(data, g_GraphBuffer, g_GraphTraceLen);
size_t size = g_GraphTraceLen;
@@ -454,6 +454,7 @@ int CmdFlexdemod(const char *Cmd) {
if (start == size - LONG_WAIT) {
PrintAndLogEx(WARNING, "nothing to wait for");
free(data);
return PM3_ENODATA;
}
@@ -497,6 +498,7 @@ int CmdFlexdemod(const char *Cmd) {
}
}
RepaintGraphWindow();
free(data);
return PM3_SUCCESS;
}