]> sigrok.org Git - libsigrok.git/blobdiff - strutil.c
Add support for fs and ps to sr_parse_period.
[libsigrok.git] / strutil.c
index c5e7dce81ffeefc1e503955b8169d4cfc900041a..2c4d5c814e9503012a5a42d7ecddb66e4772c72a 100644 (file)
--- a/strutil.c
+++ b/strutil.c
@@ -403,7 +403,11 @@ SR_API int sr_parse_period(const char *periodstr, struct sr_rational *r)
        if (s && *s) {
                while (*s == ' ')
                        s++;
-               if (!strcmp(s, "ns"))
+               if (!strcmp(s, "fs"))
+                       r->q = 1000000000000000L;
+               else if (!strcmp(s, "ps"))
+                       r->q = 1000000000000L;
+               else if (!strcmp(s, "ns"))
                        r->q = 1000000000L;
                else if (!strcmp(s, "us"))
                        r->q = 1000000;