X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fconrad-digi-35-cpu%2Fapi.c;h=e820e253b8dda0511fdf6c8be523884038b4ad95;hb=aed4ad0beaf64062752039a13f9a95326aa1df87;hp=59ea9c380b7d3fd1a363b94cd506514fb7809c25;hpb=f254bc4bba68d2cade0c8f7993d8fa8d3d9b556a;p=libsigrok.git diff --git a/src/hardware/conrad-digi-35-cpu/api.c b/src/hardware/conrad-digi-35-cpu/api.c index 59ea9c38..e820e253 100644 --- a/src/hardware/conrad-digi-35-cpu/api.c +++ b/src/hardware/conrad-digi-35-cpu/api.c @@ -26,17 +26,16 @@ #define SERIALCOMM "9600/8n1" -static const uint32_t hwopts[] = { +static const uint32_t scanopts[] = { SR_CONF_CONN, SR_CONF_SERIALCOMM, }; static const uint32_t devopts[] = { SR_CONF_POWER_SUPPLY, - SR_CONF_OUTPUT_VOLTAGE, - SR_CONF_OUTPUT_CURRENT, - /* There's no SR_CONF_OUTPUT_ENABLED; can't know/set status remotely. */ - SR_CONF_OVER_CURRENT_PROTECTION_ENABLED, + SR_CONF_OUTPUT_VOLTAGE | SR_CONF_SET, + SR_CONF_OUTPUT_CURRENT | SR_CONF_SET, + SR_CONF_OVER_CURRENT_PROTECTION_ENABLED | SR_CONF_SET, }; SR_PRIV struct sr_dev_driver conrad_digi_35_cpu_driver_info; @@ -87,7 +86,7 @@ static GSList *scan(GSList *options) if (!(serial = sr_serial_dev_inst_new(conn, serialcomm))) return NULL; - if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK) + if (serial_open(serial, SERIAL_RDWR) != SR_OK) return NULL; serial_flush(serial); @@ -95,7 +94,7 @@ static GSList *scan(GSList *options) sr_spew("Conrad DIGI 35 CPU assumed at %s.", conn); - if (!(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, "Conrad", "DIGI 35 CPU", NULL))) + if (!(sdi = sr_dev_inst_new(SR_ST_ACTIVE, "Conrad", "DIGI 35 CPU", NULL))) return NULL; sdi->conn = serial; @@ -150,7 +149,6 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd } ret = send_msg1(sdi, 'C', (int) (dblval * 100 + 0.5)); break; - /* No SR_CONF_OUTPUT_ENABLED :-( . */ case SR_CONF_OVER_CURRENT_PROTECTION_ENABLED: if (g_variant_get_boolean(data)) ret = send_msg1(sdi, 'V', 900); @@ -176,7 +174,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * switch (key) { case SR_CONF_SCAN_OPTIONS: *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, - hwopts, ARRAY_SIZE(hwopts), sizeof(uint32_t)); + scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t)); break; case SR_CONF_DEVICE_OPTIONS: *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,