From f007db6661e99f8803d6c46e4068fde20cb08c3f Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Sat, 25 Jun 2022 15:42:11 +0300 Subject: [PATCH] fill samples - get samples --- armsrc/hfops.c | 10 ++++++++-- client/src/cmdhftexkom.c | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/armsrc/hfops.c b/armsrc/hfops.c index a1bc7b80d..8bf588369 100644 --- a/armsrc/hfops.c +++ b/armsrc/hfops.c @@ -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; } diff --git a/client/src/cmdhftexkom.c b/client/src/cmdhftexkom.c index e20be5af3..b015c7fb7 100644 --- a/client/src/cmdhftexkom.c +++ b/client/src/cmdhftexkom.c @@ -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; }