From cbf34109d1f5f6e5ba845edb20963607b42204ea Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Sat, 3 Apr 2021 13:49:21 -0600 Subject: [PATCH] paw3902: Default to using SENS_FLOW_ROT rotation This restores the behavior to what it was previous to #16338 (74083d6). Signed-off-by: Alex Mikhalev --- src/drivers/optical_flow/paw3902/paw3902_main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/drivers/optical_flow/paw3902/paw3902_main.cpp b/src/drivers/optical_flow/paw3902/paw3902_main.cpp index 65d01defa3..2500435624 100644 --- a/src/drivers/optical_flow/paw3902/paw3902_main.cpp +++ b/src/drivers/optical_flow/paw3902/paw3902_main.cpp @@ -46,8 +46,14 @@ void PAW3902::print_usage() I2CSPIDriverBase *PAW3902::instantiate(const BusCLIArguments &cli, const BusInstanceIterator &iterator, int runtime_instance) { + float yaw_rotation_degrees = NAN; + + if (cli.custom1 >= 0) { + yaw_rotation_degrees = cli.custom1; + } + PAW3902 *instance = new PAW3902(iterator.configuredBusOption(), iterator.bus(), iterator.devid(), cli.bus_frequency, - cli.spi_mode, iterator.DRDYGPIO(), cli.custom1); + cli.spi_mode, iterator.DRDYGPIO(), yaw_rotation_degrees); if (!instance) { PX4_ERR("alloc failed"); @@ -67,6 +73,7 @@ extern "C" __EXPORT int paw3902_main(int argc, char *argv[]) int ch = 0; using ThisDriver = PAW3902; BusCLIArguments cli{false, true}; + cli.custom1 = -1; cli.spi_mode = SPIDEV_MODE0; cli.default_spi_frequency = SPI_SPEED;