const struct sr_channel_group *cg)
{
struct dev_context *devc;
- size_t idx;
+ unsigned int idx;
(void)cg;
#define LWLA_WORD_3(val) GUINT16_TO_LE(((val) >> 32) & 0xFFFF)
/* Maximum number of 16-bit words sent at a time during acquisition.
- * Used for allocating the libusb transfer buffer.
+ * Used for allocating the libusb transfer buffer. Keep this even so that
+ * subsequent members are always 32-bit aligned.
*/
#define MAX_ACQ_SEND_LEN16 64 /* 43 for capture setup plus stuffing */
struct libusb_transfer *xfer_in; /* USB in transfer record */
struct libusb_transfer *xfer_out; /* USB out transfer record */
- size_t mem_addr_fill; /* capture memory fill level */
- size_t mem_addr_done; /* position up to which data was received */
- size_t mem_addr_next; /* start address for next async read */
- size_t mem_addr_stop; /* end of memory range to be read */
- size_t in_index; /* position in read transfer buffer */
- size_t out_index; /* position in logic packet buffer */
- enum rle_state rle; /* RLE decoding state */
+ unsigned int mem_addr_fill; /* capture memory fill level */
+ unsigned int mem_addr_done; /* next address to be processed */
+ unsigned int mem_addr_next; /* start address for next async read */
+ unsigned int mem_addr_stop; /* end of memory range to be read */
+ unsigned int in_index; /* position in read transfer buffer */
+ unsigned int out_index; /* position in logic packet buffer */
+ enum rle_state rle; /* RLE decoding state */
gboolean rle_enabled; /* capturing in timing-state mode */
gboolean clock_boost; /* switch to faster clock during capture */
static void read_response(struct acquisition_state *acq)
{
uint32_t *in_p, *out_p;
- size_t words_left, num_words;
- size_t max_samples, run_samples;
- size_t i;
+ unsigned int words_left, num_words;
+ unsigned int max_samples, run_samples;
+ unsigned int i;
words_left = MIN(acq->mem_addr_next, acq->mem_addr_stop)
- acq->mem_addr_done;
{
uint32_t *in_p;
uint16_t *out_p;
- size_t words_left;
- size_t max_samples, run_samples;
- size_t wi, ri;
+ unsigned int words_left;
+ unsigned int max_samples, run_samples;
+ unsigned int wi, ri;
uint32_t word;
uint16_t sample;
run_samples = MIN(max_samples, acq->run_len);
/* Expand run-length samples into session packet. */
- sample = acq->sample;
+ sample = GUINT16_TO_LE(acq->sample);
out_p = &((uint16_t *)acq->out_packet)[acq->out_index];
for (ri = 0; ri < run_samples; ri++)
- out_p[ri] = GUINT16_TO_LE(sample);
+ out_p[ri] = sample;
acq->run_len -= run_samples;
acq->out_index += run_samples;
{
struct dev_context *devc;
struct acquisition_state *acq;
- size_t count;
+ unsigned int count;
devc = sdi->priv;
acq = devc->acquisition;
/* Helper to fill in the long register bulk write command.
*/
static inline void bulk_long_set(struct acquisition_state *acq,
- size_t idx, uint64_t value)
+ unsigned int idx, uint64_t value)
{
acq->xfer_buf_out[4 * idx + 3] = LWLA_WORD_0(value);
acq->xfer_buf_out[4 * idx + 4] = LWLA_WORD_1(value);
/* Helper for dissecting the response to a long register bulk read.
*/
static inline uint64_t bulk_long_get(const struct acquisition_state *acq,
- size_t idx)
+ unsigned int idx)
{
uint64_t low, high;
uint64_t sample, high_nibbles, word;
uint32_t *slice;
uint8_t *out_p;
- size_t words_left;
- size_t max_samples, run_samples;
- size_t wi, ri, si;
+ unsigned int words_left;
+ unsigned int max_samples, run_samples;
+ unsigned int wi, ri, si;
/* Number of 36-bit words remaining in the transfer buffer. */
words_left = MIN(acq->mem_addr_next, acq->mem_addr_stop)
{
struct dev_context *devc;
struct acquisition_state *acq;
- size_t count;
+ unsigned int count;
devc = sdi->priv;
acq = devc->acquisition;
}
devc->state = STATE_STATUS_WAIT;
- sr_spew("Captured %zu words, %" PRIu64 " ms, status 0x%02X.",
+ sr_spew("Captured %u words, %" PRIu64 " ms, status 0x%02X.",
acq->mem_addr_fill, acq->duration_now, acq->status);
if ((~old_status & acq->status & STATUS_TRIGGERED) != 0)
submit_request(sdi, STATE_READ_FINISH);
return;
}
- sr_dbg("%zu words in capture buffer.",
+ sr_dbg("%u words in capture buffer.",
acq->mem_addr_stop - acq->mem_addr_next);
submit_request(sdi, STATE_READ_PREPARE);
struct acquisition_state *acq;
struct sr_datafeed_packet packet;
struct sr_datafeed_logic logic;
- size_t end_addr;
+ unsigned int end_addr;
devc = sdi->priv;
acq = devc->acquisition;