]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/hameg-hmo/protocol.c
hameg-hmo: Add missing 20/50V vdiv entries
[libsigrok.git] / src / hardware / hameg-hmo / protocol.c
index bcf68ebb7ce1dda9316c7a17271c553cea2e96c8..28d8412d950d739c9da5591ace10739f46d13fb9 100644 (file)
@@ -18,6 +18,8 @@
  */
 
 #include <config.h>
+#include <math.h>
+#include <stdlib.h>
 #include "scpi.h"
 #include "protocol.h"
 
@@ -168,6 +170,8 @@ static const uint64_t hmo_vdivs[][2] = {
        { 2, 1 },
        { 5, 1 },
        { 10, 1 },
+       { 20, 1 },
+       { 50, 1 },
 };
 
 static const char *scope_analog_channel_names[] = {
@@ -198,7 +202,9 @@ static const char *scope_digital_channel_names[] = {
 
 static const struct scope_config scope_models[] = {
        {
-               .name = {"HMO722", "HMO1022", "HMO1522", "HMO2022", NULL},
+               /* HMO2522/3032/3042/3052 support 16 digital channels but they're not supported yet. */
+               .name = {"HMO722", "HMO1022", "HMO1522", "HMO2022", "HMO2522",
+                               "HMO3032", "HMO3042", "HMO3052", NULL},
                .analog_channels = 2,
                .digital_channels = 8,
                .digital_pods = 1,
@@ -228,7 +234,9 @@ static const struct scope_config scope_models[] = {
                .scpi_dialect = &hameg_scpi_dialect,
        },
        {
-               .name = {"HMO724", "HMO1024", "HMO1524", "HMO2024", NULL},
+               /* HMO2524/3034/3044/3054 support 16 digital channels but they're not supported yet. */
+               .name = {"HMO724", "HMO1024", "HMO1524", "HMO2024", "HMO2524",
+                               "HMO3034", "HMO3044", "HMO3054", NULL},
                .analog_channels = 4,
                .digital_channels = 8,
                .digital_pods = 1,
@@ -345,7 +353,7 @@ static int scope_state_get_array_option(struct sr_scpi_dev_inst *scpi,
  * @return SR_ERR on any parsing error, SR_OK otherwise.
  */
 static int array_float_get(gchar *value, const uint64_t array[][2],
-               int array_len, int *result)
+               int array_len, unsigned int *result)
 {
        int i;
        uint64_t f;