Replies: 8 comments 2 replies
-
Just some additional feedback here, almost all of the driver code for the physical hardware is already separate. Supporting additional watches in forks should be just re-writing the Driver classes to expose the same api's working with the different hardware. This is currently out of the scope of what JF002 has the bandwidth to support. However it would be cool to see it ported around :D |
Beta Was this translation helpful? Give feedback.
-
Hi @ildar and others, I'm a really newbie in C++ but I would be curious what will be the best way to create a driver concept. For example accelerometer is passed to the As I understand that this constructor passing is some kind of "dependency injection"? What will be the best C++ approach to pass some generic sensor and connect it to the watches? Some Inheritance, or virtual functions? I'm sure I'm really just curious since I'm not experienced in this high-level object stuff. And wan't to learn more. Thanks. |
Beta Was this translation helpful? Give feedback.
-
I'm not against supporting other hardware in InfiniTime, but I cannot maintain multiple ports by myself. Now that we have this github organization, we have the possibility to create teams and invite contributors that are willing to maintain ports for other hardware.
Yes, this is dependency injection. It makes more sense when the type passed in parameter is a virtual type : the class expects to receive an object implementing an interface and never know that actual type that it'll be given. The caller is the only one that knows the actual type.
I try to avoid inheritance and virtual calls, as they add overhead and make the code less likely to be optimized. In fact, the main reason to avoid inheritance is because it's actually not needed : When Infinitime runs on a specific HW, there's no reason to discover which driver should be instantiated for this hardware, it's fixed and it'll never change. We will probably not build a single version of InfiniTime that is able to run on multiple hardware, as it'll make the binary size bigger for now reason, and we won't be able to support multiple MCU/architectures that way. I also do not like I should be possible to use templates, constexpr c++20 concepts to ensure that the whole hardware and all the concrete types to be instantiated are known at build time. I'm still doing some experiment regarding this topics, so any suggestion is of course welcome! |
Beta Was this translation helpful? Give feedback.
-
This issue is easy, just moving to Zephyr, it could support multi-boards with same code, and with a driver framework, and config could be used with each board, and hope a new version of powerfull hardware. |
Beta Was this translation helpful? Give feedback.
-
:D The use of FreeRTOS is not really a significant hurdle on that path either IMO. |
Beta Was this translation helpful? Give feedback.
-
My initial suggestion was that @StarGate01 implemented in
StarGate01@87a1743
: having TARGET for different boards.
And believe me, there will be more to come.
|
Beta Was this translation helpful? Give feedback.
-
Are there any updates to this? Does infinitime support additional hardware? I love the software but the hardware is a little lacking in some regards. |
Beta Was this translation helpful? Give feedback.
-
nRF52 watches are numerous. Their essential parts are mostly similar:
Other peripherals (gyro, HR) are optional and can be added at later stages.
InfiniTime firmware has potential to work on many of the models. P8 port is already viable. Also pin abstraction patch already merged.
But to make InfiniTime truly open we need:
Beta Was this translation helpful? Give feedback.
All reactions