diff --git a/armsrc/lfsampling.c b/armsrc/lfsampling.c index 88787b4e1..b8eaf2b44 100644 --- a/armsrc/lfsampling.c +++ b/armsrc/lfsampling.c @@ -134,10 +134,11 @@ void initSampleBuffer(uint32_t *sample_size) { } void initSampleBufferEx(uint32_t *sample_size, bool use_malloc) { + if (sample_size == NULL) { - Dbprintf("initSampleBufferEx, param NULL"); return; } + BigBuf_free_keep_EM(); // We can't erase the buffer now, it would drastically delay the acquisition @@ -181,14 +182,26 @@ void logSampleSimple(uint8_t sample) { void logSample(uint8_t sample, uint8_t decimation, uint8_t bits_per_sample, bool avg) { - if (!data.buffer) return; + if (!data.buffer) { + return; + } // keep track of total gather samples regardless how many was discarded. - if (samples.counter-- == 0) return; + if (samples.counter-- == 0) { + return; + } - if (bits_per_sample == 0) bits_per_sample = 1; - if (bits_per_sample > 8) bits_per_sample = 8; - if (decimation == 0) decimation = 1; + if (bits_per_sample == 0) { + bits_per_sample = 1; + } + + if (bits_per_sample > 8) { + bits_per_sample = 8; + } + + if (decimation == 0) { + decimation = 1; + } if (avg) { samples.sum += sample; @@ -198,7 +211,9 @@ void logSample(uint8_t sample, uint8_t decimation, uint8_t bits_per_sample, bool if (decimation > 1) { samples.dec_counter++; - if (samples.dec_counter < decimation) return; + if (samples.dec_counter < decimation) { + return; + } samples.dec_counter = 0; } @@ -542,7 +557,6 @@ out: LED_D_OFF(); // DoAcquisition() end - StopTicks(); FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF); return return_value; diff --git a/client/src/cmddata.c b/client/src/cmddata.c index 1ce0aadef..2a5b2474a 100644 --- a/client/src/cmddata.c +++ b/client/src/cmddata.c @@ -2769,7 +2769,7 @@ static int CmdAsn1Decoder(const char *Cmd) { void *argtable[] = { arg_param_begin, arg_str0("d", NULL, "", "ASN1 encoded byte array"), - arg_lit0("t", "test", "perform self test"), + arg_lit0(NULL, "test", "perform self tests"), arg_param_end }; CLIExecWithReturn(ctx, Cmd, argtable, false);