From 4c3ebee15b2d3626b328d313b1356634e70ab6d8 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 10 Oct 2014 13:29:25 +0200 Subject: [PATCH] Hackery on option parsing to make MS5611 comply --- src/drivers/ms5611/ms5611.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/drivers/ms5611/ms5611.cpp b/src/drivers/ms5611/ms5611.cpp index beca29d6dc..aed72de01f 100644 --- a/src/drivers/ms5611/ms5611.cpp +++ b/src/drivers/ms5611/ms5611.cpp @@ -855,13 +855,13 @@ start(bool external_bus) int fd; prom_u prom_buf; - if (external_bus && (g_dev_ext != nullptr)) + if (external_bus && (g_dev_ext != nullptr)) { /* if already started, the still command succeeded */ errx(0, "ext already started"); - - if (g_dev_int != nullptr) + } else if (!external_bus && (g_dev_int != nullptr)) { /* if already started, the still command succeeded */ errx(0, "int already started"); + } device::Device *interface = nullptr; @@ -1157,6 +1157,12 @@ ms5611_main(int argc, char *argv[]) const char *verb = argv[optind]; + if (argc > optind+1) { + if (!strcmp(argv[optind+1], "-X")) { + external_bus = true; + } + } + /* * Start/load the driver. */