static int configure_channels(const struct sr_dev_inst *sdi)
{
struct dev_context *devc;
+ GSList *l;
+ struct sr_channel *ch;
devc = sdi->priv;
+
devc->cur_channels = 0;
- for (GSList *l = sdi->channels; l; l = l->next) {
- struct sr_channel *ch = (struct sr_channel*)l->data;
- if (ch->enabled == FALSE)
+ for (l = sdi->channels; l; l = l->next) {
+ ch = l->data;
+ if (!ch->enabled)
continue;
- devc->cur_channels |= 1 << ch->index;
+ devc->cur_channels |= 1UL << ch->index;
}
return SR_OK;
{
struct dev_context *devc;
int ret;
-
- devc = sdi->priv;
-
uint16_t duty_R79, duty_R56;
uint8_t buf[2 * sizeof(uint16_t)];
uint8_t *wrptr;
+ devc = sdi->priv;
+
/* Clamp threshold setting to valid range for LA2016. */
if (voltage > 4.0) {
voltage = 4.0;