fill samples - get samples

This commit is contained in:
merlokk committed 2022-06-25 15:42:11 +03:00
1 parent 0392cfaa9b
commit f007db6661
2 files changed
+11 -2

No files matched your search

+8 -2
View File
@@ -26,6 +26,7 @@
#include "dbprint.h"
#include "util.h"
#include "commonutil.h"
#include "lfsampling.h"
int HfReadADC(uint32_t samplesCount, bool ledcontrol) {
@@ -58,6 +59,9 @@ int HfReadADC(uint32_t samplesCount, bool ledcontrol) {
//uint32_t dma_start_time = 0;
uint16_t *upTo = dma->buf;
uint32_t sbs = samplesCount;
initSampleBuffer(&sbs);
for (;;) {
if (BUTTON_PRESS()) {
break;
@@ -95,8 +99,10 @@ int HfReadADC(uint32_t samplesCount, bool ledcontrol) {
}
logSample(50, 1, 8, false);
if (getSampleCounter() >= samplesCount)
break;
}
FpgaDisableSscDma();
@@ -109,7 +115,7 @@ int HfReadADC(uint32_t samplesCount, bool ledcontrol) {
reply_ng(CMD_HF_ACQ_RAW_ADC, PM3_SUCCESS, NULL, 0);
if (ledcontrol) LEDsoff();
DbpString("HfReadADC " _GREEN_("success"));
Dbprintf("-- samples: %d", getSampleCounter());
return 0;
}
+3
View File
@@ -26,6 +26,7 @@
#include "comms.h"
#include "ui.h"
#include "cmdhf14a.h"
#include "cmddata.h"
static int CmdHFTexkomReader(const char *Cmd) {
CLIParserContext *ctx;
@@ -50,6 +51,8 @@ static int CmdHFTexkomReader(const char *Cmd) {
return PM3_ETIMEOUT;
}
getSamples(samplesCount, true);
return PM3_SUCCESS;
}