]> sigrok.org Git - libsigrok.git/commitdiff
serial-dmm: sort the list of device drivers (part 1, bm25x)
authorGerhard Sittig <redacted>
Sat, 5 Nov 2016 15:19:58 +0000 (16:19 +0100)
committerUwe Hermann <redacted>
Sun, 6 Nov 2016 13:43:25 +0000 (14:43 +0100)
The previous implementation seems to have added drivers in their "order
of appearance". Start sorting the rather long list, to simplify several
tasks: Add new entries as more drivers get written, find existing items
during research, identify and compare similar models during maintenance.
As a byproduct, there will be no doubt about where to put things during
future work :) and duplicates will be spotted immediately.

This commit puts 'bm25x' meters into one group. And comments on the sort
order and motivation for sorting the table.

src/hardware/serial-dmm/api.c

index b3408bae9c9b5890586fd053c3884e533fca5207..019bf2096695bda5c8f94021d4dabb5ef434775d 100644 (file)
@@ -220,6 +220,28 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        }).di
 
 SR_REGISTER_DEV_DRIVER_LIST(serial_dmm_drivers,
+       /*
+        * The items are sorted by chipset first and then model name.
+        *
+        * This reflects the developer's perspective and is preferrable
+        * during maintenance, as a vendor/product based sort order does
+        * not work well for rebranded models, and from a support point
+        * of view it's more important to identify similarities between
+        * models and compatible devices.
+        *
+        * Fold marks {{{ }}} with matching braces were added, to further
+        * speed up navigation in the long list.
+        */
+       /* bm25x based meters {{{ */
+       DMM(
+               "brymen-bm25x", bm25x,
+               "Brymen", "BM25x", "9600/8n1/rts=1/dtr=1",
+               9600, BRYMEN_BM25X_PACKET_SIZE, 0, 0, NULL,
+               sr_brymen_bm25x_packet_valid, sr_brymen_bm25x_parse,
+               NULL
+       ),
+       /* }}} */
+       /* meters based on other chips (to get sorted) */
        DMM(
                "bbcgm-2010", metex14,
                "BBC Goertz Metrawatt", "M2110", "1200/7n2", 1200,
@@ -535,13 +557,6 @@ SR_REGISTER_DEV_DRIVER_LIST(serial_dmm_drivers,
                sr_es519xx_19200_11b_packet_valid, sr_es519xx_19200_11b_parse,
                NULL
        ),
-       DMM(
-               "brymen-bm25x", bm25x,
-               "Brymen", "BM25x", "9600/8n1/rts=1/dtr=1",
-               9600, BRYMEN_BM25X_PACKET_SIZE, 0, 0, NULL,
-               sr_brymen_bm25x_packet_valid, sr_brymen_bm25x_parse,
-               NULL
-       ),
        DMM(
                "velleman-dvm4100", dtm0660,
                "Velleman", "DVM4100", "2400/8n1/rts=0/dtr=1",