]> sigrok.org Git - libsigrok.git/commitdiff
Add support for fs and ps to sr_parse_period.
authorPetteri Aimonen <redacted>
Tue, 20 Nov 2012 19:02:14 +0000 (21:02 +0200)
committerPetteri Aimonen <redacted>
Tue, 20 Nov 2012 19:02:14 +0000 (21:02 +0200)
These time units are used in VCD files.

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;