sr: backend/zeroplus: Improve debug output.

This commit is contained in:
Uwe Hermann 2012-06-19 23:33:50 +02:00
parent d27e406e13
commit c13536fa9c
3 changed files with 11 additions and 2 deletions

View File

@ -232,7 +232,8 @@ static gpointer new_chunk(struct sr_datastore **ds)
chunk = g_try_malloc0(DATASTORE_CHUNKSIZE * (*ds)->ds_unitsize);
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? */
}

View File

@ -32,6 +32,7 @@
#include <assert.h>
#include "analyzer.h"
#include "gl_usb.h"
#include "sigrok-internal.h"
enum {
HARD_DATA_CHECK_SUM = 0x00,
@ -241,6 +242,11 @@ static int __analyzer_set_freq(libusb_device_handle *devh, int freq, int scale)
reg2 = 64;
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)
return -1; /* Divisor maybe? */

View File

@ -217,7 +217,9 @@ static int sr_session_run_poll(void)
/* Construct g_poll()'s array. */
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;
}
for (i = 0; i < num_sources; i++) {