GrepitAB / mcan

Unofficial MCAN Hardware Abstraction Layer
Apache License 2.0
24 stars 4 forks source link

Refine the interrupt system #39

Closed glaeqen closed 1 year ago

glaeqen commented 1 year ago

Instead of storing disabled interrupts in an OwnedInterruptSet (OIS) embedded in an InterruptConfiguration, OIS instance is provided as part of the initial, deconstructible Can struct. It could be split into multiple OISes which therefore can be used as tokens that one can pass to InterruptConfiguration::{enable*, disable} methods and get a new OIS instance back.

OIS anticipates an operation in typed-stated fashion, as well as in the dynamic way where type level details are erased.

OIS::split_flagged is a new helper method that splits out new OIS containing flagged interrupts.

DynInterruptConfiguration and DynOwnedInterruptSet were removed in order to simplify the change.

This PR is a breaking change.

glaeqen commented 1 year ago

TODO: Tests has to be fixed