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

+5 -2
View File
@@ -66,10 +66,11 @@ static int CmdIOProxWatch(const char *Cmd) {
int demodIOProx(bool verbose) {
(void) verbose; // unused so far
int idx = 0, retval = PM3_SUCCESS;
uint8_t bits[MAX_GRAPH_TRACE_LEN] = {0};
uint8_t *bits = calloc(MAX_GRAPH_TRACE_LEN, sizeof(uint8_t));
size_t size = getFromGraphBuf(bits);
if (size < 65) {
PrintAndLogEx(DEBUG, "DEBUG: Error - IO prox not enough samples in GraphBuffer");
free(bits);
return PM3_ESOFT;
}
//get binary from fsk wave
@@ -93,6 +94,7 @@ int demodIOProx(bool verbose) {
PrintAndLogEx(DEBUG, "DEBUG: Error - IO prox error demoding fsk %d", idx);
}
}
free(bits);
return PM3_ESOFT;
}
setDemodBuff(bits, size, idx);
@@ -103,6 +105,7 @@ int demodIOProx(bool verbose) {
PrintAndLogEx(DEBUG, "DEBUG: Error - IO prox data not found - FSK Bits: %zu", size);
if (size > 92) PrintAndLogEx(DEBUG, "%s", sprint_bytebits_bin_break(bits, 92, 16));
}
free(bits);
return PM3_ESOFT;
}
@@ -156,6 +159,7 @@ int demodIOProx(bool verbose) {
printDemodBuff(0, false, false, true);
printDemodBuff(0, false, false, false);
}
free(bits);
return retval;
}
@@ -441,4 +445,3 @@ int getIOProxBits(uint8_t version, uint8_t fc, uint16_t cn, uint8_t *bits) {
PrintAndLogEx(SUCCESS, "IO raw bits:\n %s \n", sprint_bytebits_bin(bits, 64));
return PM3_SUCCESS;
}