sr: backend/zeroplus: Improve debug output.
This commit is contained in:
parent
d27e406e13
commit
c13536fa9c
|
@ -232,7 +232,8 @@ static gpointer new_chunk(struct sr_datastore **ds)
|
||||||
|
|
||||||
chunk = g_try_malloc0(DATASTORE_CHUNKSIZE * (*ds)->ds_unitsize);
|
chunk = g_try_malloc0(DATASTORE_CHUNKSIZE * (*ds)->ds_unitsize);
|
||||||
if (!chunk) {
|
if (!chunk) {
|
||||||
sr_err("ds: %s: chunk malloc failed", __func__);
|
sr_err("ds: %s: chunk malloc failed (ds_unitsize was %u)",
|
||||||
|
__func__, (*ds)->ds_unitsize);
|
||||||
return NULL; /* TODO: SR_ERR_MALLOC later? */
|
return NULL; /* TODO: SR_ERR_MALLOC later? */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "analyzer.h"
|
#include "analyzer.h"
|
||||||
#include "gl_usb.h"
|
#include "gl_usb.h"
|
||||||
|
#include "sigrok-internal.h"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
HARD_DATA_CHECK_SUM = 0x00,
|
HARD_DATA_CHECK_SUM = 0x00,
|
||||||
|
@ -241,6 +242,11 @@ static int __analyzer_set_freq(libusb_device_handle *devh, int freq, int scale)
|
||||||
reg2 = 64;
|
reg2 = 64;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sr_dbg("zp: Setting samplerate regs (freq=%d, scale=%d): "
|
||||||
|
"reg0: %d, reg1: %d, reg2: %d, reg3: %d.",
|
||||||
|
freq, scale, divisor, reg0, 0x02, reg2);
|
||||||
|
|
||||||
if (gl_reg_write(devh, FREQUENCY_REG0, divisor) < 0)
|
if (gl_reg_write(devh, FREQUENCY_REG0, divisor) < 0)
|
||||||
return -1; /* Divisor maybe? */
|
return -1; /* Divisor maybe? */
|
||||||
|
|
||||||
|
|
|
@ -217,7 +217,9 @@ static int sr_session_run_poll(void)
|
||||||
|
|
||||||
/* Construct g_poll()'s array. */
|
/* Construct g_poll()'s array. */
|
||||||
if (!(fds = g_try_malloc(sizeof(GPollFD) * num_sources))) {
|
if (!(fds = g_try_malloc(sizeof(GPollFD) * num_sources))) {
|
||||||
sr_err("session: %s: fds malloc failed", __func__);
|
/* Not enough memory, or num_sources was 0. */
|
||||||
|
sr_err("session: %s: fds malloc failed "
|
||||||
|
"(num_sources was %d).", __func__, num_sources);
|
||||||
return SR_ERR_MALLOC;
|
return SR_ERR_MALLOC;
|
||||||
}
|
}
|
||||||
for (i = 0; i < num_sources; i++) {
|
for (i = 0; i < num_sources; i++) {
|
||||||
|
|
Loading…
Reference in New Issue