forked from Archive/PX4-Autopilot
Minor fixes to bus reset
This commit is contained in:
parent
acc3cc087f
commit
012adc9e33
|
@ -420,8 +420,11 @@ MS5611::ioctl(struct file *filp, int cmd, unsigned long arg)
|
||||||
return _reports->size();
|
return _reports->size();
|
||||||
|
|
||||||
case SENSORIOCRESET:
|
case SENSORIOCRESET:
|
||||||
/* XXX implement this */
|
/*
|
||||||
return -EINVAL;
|
* Since we are initialized, we do not need to do anything, since the
|
||||||
|
* PROM is correctly read and the part does not need to be configured.
|
||||||
|
*/
|
||||||
|
return OK;
|
||||||
|
|
||||||
case BAROIOCSMSLPRESSURE:
|
case BAROIOCSMSLPRESSURE:
|
||||||
|
|
||||||
|
|
|
@ -1151,7 +1151,8 @@ PX4FMU::sensor_reset(int ms)
|
||||||
stm32_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, 0);
|
stm32_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, 0);
|
||||||
|
|
||||||
/* wait for the sensor rail to reach GND */
|
/* wait for the sensor rail to reach GND */
|
||||||
usleep(ms * 000);
|
usleep(ms * 1000);
|
||||||
|
warnx("reset done, %d ms", ms);
|
||||||
|
|
||||||
/* re-enable power */
|
/* re-enable power */
|
||||||
|
|
||||||
|
@ -1289,7 +1290,7 @@ PX4FMU::gpio_ioctl(struct file *filp, int cmd, unsigned long arg)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GPIO_SENSOR_RAIL_RESET:
|
case GPIO_SENSOR_RAIL_RESET:
|
||||||
sensor_reset(20);
|
sensor_reset(arg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GPIO_SET_OUTPUT:
|
case GPIO_SET_OUTPUT:
|
||||||
|
@ -1655,13 +1656,18 @@ fmu_main(int argc, char *argv[])
|
||||||
if (!strcmp(verb, "fake"))
|
if (!strcmp(verb, "fake"))
|
||||||
fake(argc - 1, argv + 1);
|
fake(argc - 1, argv + 1);
|
||||||
|
|
||||||
if (!strcmp(verb, "sensor_reset"))
|
if (!strcmp(verb, "sensor_reset")) {
|
||||||
if (argc > 2) {
|
if (argc > 2) {
|
||||||
sensor_reset(strtol(argv[2], 0, 0));
|
int reset_time = strtol(argv[2], 0, 0);
|
||||||
|
sensor_reset(reset_time);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
sensor_reset(0);
|
sensor_reset(0);
|
||||||
|
warnx("resettet default time");
|
||||||
}
|
}
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fprintf(stderr, "FMU: unrecognised command, try:\n");
|
fprintf(stderr, "FMU: unrecognised command, try:\n");
|
||||||
#if defined(CONFIG_ARCH_BOARD_PX4FMU_V1)
|
#if defined(CONFIG_ARCH_BOARD_PX4FMU_V1)
|
||||||
|
|
Loading…
Reference in New Issue