InfiniTimeOrg / InfiniTimeOrg/InfiniTime
TwiMaster rework
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 3.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Verification
- I searched for similar issues and found none was relevant.
Introduce the issue
A single TwiMaster instance is created globally in main.cpp, passed to multiple drivers, and the drivers must call the functions with the correct address as an argument. Instantiating multiple TwiMaster will probably break everything.
Preferred solution
TwiMaster could be split into two classes. One handles interfacing with the hardware, and one is instantiated in each driver with the hardware class and address passed to the constructor.
Version
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading main.cpp and the TwiMaster implementation, then trace how the drivers receive and call the global instance. Map the hardware interface and address-dependent behavior before deciding how the two proposed classes should relate. Done means drivers can use an address-bound instance while hardware access remains shared and existing I2C behavior continues to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- embedded-iot
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100