From: Gerhard Sittig Date: Sat, 5 Nov 2016 15:19:58 +0000 (+0100) Subject: serial-dmm: sort the list of device drivers (part 1, bm25x) X-Git-Tag: libsigrok-0.5.0~187 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=c06785841cd217ad01e32be9201dca69b1f8818d;hp=6b7e644e5c5ca8fd501303a812293a00d830cd32 serial-dmm: sort the list of device drivers (part 1, bm25x) 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. --- diff --git a/src/hardware/serial-dmm/api.c b/src/hardware/serial-dmm/api.c index b3408bae..019bf209 100644 --- a/src/hardware/serial-dmm/api.c +++ b/src/hardware/serial-dmm/api.c @@ -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",