Merge pull request #131 from mciantyre/take-once

Mark peripherals as taken
This commit is contained in:
Dario Nieuwenhuis 2021-04-02 00:07:42 +02:00 committed by GitHub
commit 208da57a15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,6 +55,7 @@ macro_rules! peripherals {
if unsafe { _EMBASSY_DEVICE_PERIPHERALS } { if unsafe { _EMBASSY_DEVICE_PERIPHERALS } {
None None
} else { } else {
unsafe { _EMBASSY_DEVICE_PERIPHERALS = true };
Some(unsafe { <Self as embassy::util::Steal>::steal() }) Some(unsafe { <Self as embassy::util::Steal>::steal() })
} }
}) })