]> sigrok.org Git - libsigrok.git/blobdiff - strutil.c
drivers: rename and reorganize config get/set
[libsigrok.git] / strutil.c
index c5e7dce81ffeefc1e503955b8169d4cfc900041a..a073a75800b2b26e7ad8e537fe8589bf827bff39 100644 (file)
--- a/strutil.c
+++ b/strutil.c
@@ -230,7 +230,7 @@ SR_API char **sr_parse_triggerstring(const struct sr_dev_inst *sdi,
                return NULL;
        }
 
-       if (sdi->driver->info_get(SR_DI_TRIGGER_TYPES,
+       if (sdi->driver->config_get(SR_DI_TRIGGER_TYPES,
                        (const void **)&trigger_types, sdi) != SR_OK) {
                sr_err("%s: Device doesn't support any triggers.", __func__);
                return NULL;
@@ -403,8 +403,12 @@ SR_API int sr_parse_period(const char *periodstr, struct sr_rational *r)
        if (s && *s) {
                while (*s == ' ')
                        s++;
-               if (!strcmp(s, "ns"))
-                       r->q = 1000000000L;
+               if (!strcmp(s, "fs"))
+                       r->q = 1000000000000000ULL;
+               else if (!strcmp(s, "ps"))
+                       r->q = 1000000000000ULL;
+               else if (!strcmp(s, "ns"))
+                       r->q = 1000000000ULL;
                else if (!strcmp(s, "us"))
                        r->q = 1000000;
                else if (!strcmp(s, "ms"))