Closed nicolaerosia closed 5 years ago
I was wondering if there is interest in refactoring sensors so they take the adapter type (SPI/I2C/whatever) and path to the actual adapter at start time.
Example: https://github.com/PX4/DriverFramework/blob/master/framework/include/BaroSensor.hpp#L43 Could actually have a DevObj *m_adapter, instantiated in ctor depending on parameters.
This could all go to relevant configs: https://github.com/PX4/DriverFramework/blob/master/framework/include/ImuSensor.hpp#L45-L70
Yes, both are desirable, but I'm not sure if it's worth the effort to do the necessary refactoring for dynamic SPI/I2C at the moment.
I was wondering if there is interest in refactoring sensors so they take the adapter type (SPI/I2C/whatever) and path to the actual adapter at start time.
Example: https://github.com/PX4/DriverFramework/blob/master/framework/include/BaroSensor.hpp#L43 Could actually have a DevObj *m_adapter, instantiated in ctor depending on parameters.
This could all go to relevant configs: https://github.com/PX4/DriverFramework/blob/master/framework/include/ImuSensor.hpp#L45-L70