This commit is contained in:
Triss 2021-06-26 01:38:22 +02:00
parent 2a815b8a5f
commit 192cb0d897
2 changed files with 16 additions and 3 deletions

View File

@ -267,6 +267,9 @@ static int dev_close(struct sr_dev_inst *sdi)
return SR_OK;
}
/* FIXME: "Exception: invalid argument" when launching pulseview?
* maybe because of something in the config stuff?*/
static int config_get(uint32_t key, GVariant **data,
const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
{
@ -294,6 +297,7 @@ static int config_get(uint32_t key, GVariant **data,
*data = g_variant_new_uint64(dc->capture_ratio);
break;
default:
sr_err("%s no conf key %u", __func__, key);
rv = SR_ERR_NA;
break;
}
@ -328,6 +332,7 @@ static int config_set(uint32_t key, GVariant *data,
dc->capture_ratio = g_variant_get_uint64(data);
break;
default:
sr_err("%s no conf key %u", __func__, key);
rv = SR_ERR_NA;
break;
}
@ -348,6 +353,7 @@ static int config_list(uint32_t key, GVariant **data,
*data = std_gvar_samplerates(ARRAY_AND_SIZE(samplerates));
break;
default:
sr_err("%s no conf key %u", __func__, key);
rv = SR_ERR_NA;
break;
}
@ -383,7 +389,8 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
if (!dc || !dc->ft) return SR_ERR_BUG;
rv = scanaquad_acquisition_stop(sdi, dc);
CHECK_SQ_RETVAL(rv, "Failed to stop acquisition");
/* FIXME */
/*CHECK_SQ_RETVAL(rv, "Failed to stop acquisition");*/
sr_session_source_remove(sdi->session, -1);
std_session_send_df_end(sdi);

View File

@ -84,7 +84,7 @@ SR_PRIV void sq_destroy(struct dev_context *dc)
do { \
__rv = ftdi_read_data(ft, (uint8_t *)(data)+__i, (s)-__i); \
CHECK_FTDI_RETVAL(FALSE, ft, __rv, (s)-__i, FALSE); \
sr_spew("read_blocking: read %d\n", __rv); \
/*sr_spew("read_blocking: read %d\n", __rv);*/ \
__i += __rv; \
} while (__i < s); \
__rv;}) \
@ -268,6 +268,7 @@ SR_PRIV int sq_app_get_capture_result(struct dev_context *dc, struct ftdi_transf
if (!dc || !tc) return SR_ERR;
/* FIXME: don't block here! */
//if (!tc->completed) return SR_ERR_ARG;
rv = ftdi_transfer_data_done(tc);
CHECK_FTDI_RETVAL(FALSE, dc->ft, rv, (size_t)4);
@ -696,6 +697,11 @@ static void scanaquad_unpack_samples(uint8_t *rdata, size_t totalunpackbytes)
rdata[i*2-1] = (rdata[i-1] & 0xf0) >> 4;
rdata[i*2-2] = (rdata[i-1] & 0x0f) >> 0;
}
/*for (i = 0; i < totalunpackbytes; ++i) {
printf("%01x ", rdata[i]);
if ((i & 15) == 15) printf("\n");
}*/
}
SR_PRIV int scanaquad_acquisition_finish(struct sr_dev_inst *sdi, struct dev_context *dc)
@ -786,7 +792,7 @@ SR_PRIV int scanaquad_acquisition_finish(struct sr_dev_inst *sdi, struct dev_con
packet3.type = SR_DF_LOGIC;
packet3.payload = &logic3;
sr_spew("data sendoff!");
sr_spew("data sendoff! 2nb=%zu l1=%zu l3=%zu", nbytes*2, logic1.length, logic3.length);
sr_session_send(sdi, &packet1);
sr_session_send(sdi, &packet2);