refactor(hal): Deprecate DevBoards class and bring HardwareSerial class up to the Sketch Layer#71
Merged
ZZ-Cat merged 15 commits intoMain-Trunkfrom Jan 21, 2024
Merged
refactor(hal): Deprecate DevBoards class and bring HardwareSerial class up to the Sketch Layer#71ZZ-Cat merged 15 commits intoMain-Trunkfrom
DevBoards class and bring HardwareSerial class up to the Sketch Layer#71ZZ-Cat merged 15 commits intoMain-Trunkfrom
Conversation
The original name of this class was not fit for purpose, because it dominantly caters to managing the underlying hardware UART.
…Serial1` for _all_ targets.
… be defined by the user
Why have a dog and bark too, right? No point in reinventing the wheel here.
hw_uart API and bring HardwareSerial class up to the Sketch Layer
hw_uart API and bring HardwareSerial class up to the Sketch LayerDevBoards API and bring HardwareSerial class up to the Sketch Layer
DevBoards API and bring HardwareSerial class up to the Sketch LayerDevBoards class and bring HardwareSerial class up to the Sketch Layer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This Pull Request deprecates the original
DevBoardsHardware Abstraction Layer class and is replaced by Arduino'sHardwareSerialclassDetails
After a couple of failed attempts at trying to implement a system where you could pick your UART pins vicariously through simply picking which port you wanted, I have decided to bring the
HardwareSerialclass up to the Sketch Layer.Here, this gives you more freedom to feed in your own hardware-specific UART port that you want CRSF for Arduino to use.
API Change
This introduces a change to CRSF for Arduino's API - Specifically to do with the constructor.
Instead of passing in the pins your receiver is connected to, you are passing in your chosen
HardwareSerialclass.The old way
You would create an instance of CRSF for Arduino in the following ways:
The new way
Now, you create an instance of CRSF for Arduino in the following ways: