Hackery on option parsing to make MS5611 comply

This commit is contained in:
Lorenz Meier 2014-10-10 13:29:25 +02:00
parent a77c9225df
commit 4c3ebee15b
1 changed files with 9 additions and 3 deletions

View File

@ -855,13 +855,13 @@ start(bool external_bus)
int fd; int fd;
prom_u prom_buf; 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 */ /* if already started, the still command succeeded */
errx(0, "ext already started"); errx(0, "ext already started");
} else if (!external_bus && (g_dev_int != nullptr)) {
if (g_dev_int != nullptr)
/* if already started, the still command succeeded */ /* if already started, the still command succeeded */
errx(0, "int already started"); errx(0, "int already started");
}
device::Device *interface = nullptr; device::Device *interface = nullptr;
@ -1157,6 +1157,12 @@ ms5611_main(int argc, char *argv[])
const char *verb = argv[optind]; const char *verb = argv[optind];
if (argc > optind+1) {
if (!strcmp(argv[optind+1], "-X")) {
external_bus = true;
}
}
/* /*
* Start/load the driver. * Start/load the driver.
*/ */