Replacing usleep with px4_usleep

This is a step towards isolating time from the system.
This commit is contained in:
Julian Oes
2018-10-04 06:51:04 +02:00
parent e485885344
commit 5b9dea5604
112 changed files with 339 additions and 305 deletions
+2 -2
View File
@@ -133,7 +133,7 @@ __EXPORT void board_peripheral_reset(int ms)
stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 1);
/* wait for the peripheral rail to reach GND */
usleep(ms * 1000);
px4_usleep(ms * 1000);
warnx("reset done, %d ms", ms);
/* re-enable power */
@@ -393,7 +393,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
#endif
/* Ensure the power is on 1 ms before we drive the GPIO pins */
usleep(1000);
px4_usleep(1000);
if (OK == determin_hw_version(&hw_version, & hw_revision)) {
switch (hw_version) {
+3 -2
View File
@@ -41,6 +41,7 @@
* Included Files
************************************************************************************/
#include <px4_time.h>
#include <px4_config.h>
#include <stdint.h>
@@ -420,7 +421,7 @@ __EXPORT void board_spi_reset(int ms)
stm32_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, 0);
/* wait for the sensor rail to reach GND */
usleep(ms * 1000);
px4_usleep(ms * 1000);
warnx("reset done, %d ms", ms);
/* re-enable power */
@@ -429,7 +430,7 @@ __EXPORT void board_spi_reset(int ms)
stm32_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, 1);
/* wait a bit before starting SPI, different times didn't influence results */
usleep(100);
px4_usleep(100);
/* reconfigure the SPI pins */
stm32_configgpio(GPIO_SPI1_SCK);