Skip to content
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

Hardware initialization, abstraction and controllers. #1583

Open
1 task done
Riksu9000 opened this issue Feb 12, 2023 · 1 comment
Open
1 task done

Hardware initialization, abstraction and controllers. #1583

Riksu9000 opened this issue Feb 12, 2023 · 1 comment
Labels
maintenance Background work

Comments

@Riksu9000
Copy link
Contributor

Riksu9000 commented Feb 12, 2023

Verification

  • I searched for similar issues and found none was relevant.

Introduce the issue

The hardware is initialized in many places, controller classes, drivers, systemtask, displayapp. Keeping track of the hardware state can be difficult. What has been initialized and when. We need to define how and where the hardware should be initialized, and how info about the hardware, such as pins, is passed to the controller classes.

Relates to #1387 #1050 #1468

Preferred solution

For example, we could have a port init function, that initializes all hardware. The already configured pins could be passed to the controller classes. We could apply a discipline to only include hardware specific files in certain places.

Version

No response

@JF002
Copy link
Collaborator

JF002 commented Feb 27, 2023

This is indeed something I tried to do in #1387 : implement all the hardware specific code at a single place, and ensure that all hardware specific code is correctly encapsulated so that all the application code in InfiniTime do not have to worry about the hardware details.

I tried to do all of this at once in #1387, but this is a big task. As you suggested, we could start by adding those port init functions to support various PineTime variants (such as the P8) could be a good start.
So in the project, there would be a 'ports' folder that contains all the init code for the supported hardware, and the specific port file would be selected by CMake during the project generation.

@FintasticMan FintasticMan added the maintenance Background work label Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Background work
Projects
None yet
Development

No branches or pull requests

3 participants