-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generic: usart: Introduce a type-parameter for orphan circumvention
Because HAL crates neither own the `UsartOps` trait nor the `USARTn` instance, they are not allowed to implement it for the type. However, the orphan rules allow us to deal with this by adding a generic parameter to `UsartOps` which is local to the HAL crate. The new `H` parameter serves exactly this purpose and nothing more. A HAL should define a type and use it for `H` in all HAL implementations. Ideally, it should also export type-aliases for all types from `avr-hal-generic` with the `H` parameter already substituted.
- Loading branch information
Showing
1 changed file
with
40 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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