-
-
Notifications
You must be signed in to change notification settings - Fork 968
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support of other hardware #726
Comments
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 |
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. |
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! |
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. |
:D The use of FreeRTOS is not really a significant hurdle on that path either IMO. |
My initial suggestion was that @StarGate01 implemented in
StarGate01@87a1743
: having TARGET for different boards.
And believe me, there will be more to come.
|
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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:
The text was updated successfully, but these errors were encountered: