mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2024-12-23 20:51:31 +11:00
Merge pull request #502 from jannic/remove-critical-section-0.2
Remove support for deprecated version 0.2 of critical-section
This commit is contained in:
commit
6fca82f810
|
@ -32,6 +32,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Add a method to allow setting the PIO's clock divisor without floats - @ithinuel
|
- Add a method to allow setting the PIO's clock divisor without floats - @ithinuel
|
||||||
- Use TimerInstant in Timer::GetCounter & add Alarm::schedule_at - @ithinuel
|
- Use TimerInstant in Timer::GetCounter & add Alarm::schedule_at - @ithinuel
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- Removed support for critical-section 0.2 (was already deprecated) - @jannic
|
||||||
|
|
||||||
## [0.6.0] - 2022-08-26
|
## [0.6.0] - 2022-08-26
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -29,9 +29,6 @@ usb-device = "0.2.9"
|
||||||
vcell = "0.1"
|
vcell = "0.1"
|
||||||
void = { version = "1.0.2", default-features = false }
|
void = { version = "1.0.2", default-features = false }
|
||||||
rand_core = "0.6.3"
|
rand_core = "0.6.3"
|
||||||
# Always set the custom-impl feature of legacy critical-section, even if we don't provide our own,
|
|
||||||
# as the default implementation should no longer be used.
|
|
||||||
critical-section_0_2 = { package = "critical-section", version = "0.2.4", features = ["custom-impl"] }
|
|
||||||
critical-section = { version = "1.0.0" }
|
critical-section = { version = "1.0.0" }
|
||||||
|
|
||||||
chrono = { version = "0.4", default-features = false, optional = true }
|
chrono = { version = "0.4", default-features = false, optional = true }
|
||||||
|
|
|
@ -105,11 +105,6 @@ at the same time.
|
||||||
The new blocking [SPI traits](https://docs.rs/embedded-hal/1.0.0-alpha.8/embedded_hal/spi/blocking/index.html)
|
The new blocking [SPI traits](https://docs.rs/embedded-hal/1.0.0-alpha.8/embedded_hal/spi/blocking/index.html)
|
||||||
are not yet implemented.
|
are not yet implemented.
|
||||||
|
|
||||||
### Support for critical-section 0.2
|
|
||||||
|
|
||||||
While `rp2040-hal` uses critical-section 1.0, it still provides support for version 0.2.
|
|
||||||
That version is deprecated, and support will be removed in a future release. Please upgrade.
|
|
||||||
|
|
||||||
<!-- CONTRIBUTING -->
|
<!-- CONTRIBUTING -->
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use core::sync::atomic::{AtomicU8, Ordering};
|
use core::sync::atomic::{AtomicU8, Ordering};
|
||||||
|
|
||||||
struct RpSpinlockCs;
|
struct RpSpinlockCs;
|
||||||
critical_section_0_2::custom_impl!(RpSpinlockCs);
|
|
||||||
critical_section::set_impl!(RpSpinlockCs);
|
critical_section::set_impl!(RpSpinlockCs);
|
||||||
|
|
||||||
/// Marker value to indicate no-one has the lock.
|
/// Marker value to indicate no-one has the lock.
|
||||||
|
@ -22,16 +21,6 @@ static LOCK_OWNER: AtomicU8 = AtomicU8::new(LOCK_UNOWNED);
|
||||||
/// The value 2 indicates that we aren't the outermost call, and should not release the spinlock or re-enable interrupts in `release`
|
/// The value 2 indicates that we aren't the outermost call, and should not release the spinlock or re-enable interrupts in `release`
|
||||||
const LOCK_ALREADY_OWNED: u8 = 2;
|
const LOCK_ALREADY_OWNED: u8 = 2;
|
||||||
|
|
||||||
unsafe impl critical_section_0_2::Impl for RpSpinlockCs {
|
|
||||||
unsafe fn acquire() -> u8 {
|
|
||||||
RpSpinlockCs::acquire()
|
|
||||||
}
|
|
||||||
|
|
||||||
unsafe fn release(token: u8) {
|
|
||||||
RpSpinlockCs::release(token);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unsafe impl critical_section::Impl for RpSpinlockCs {
|
unsafe impl critical_section::Impl for RpSpinlockCs {
|
||||||
unsafe fn acquire() -> u8 {
|
unsafe fn acquire() -> u8 {
|
||||||
RpSpinlockCs::acquire()
|
RpSpinlockCs::acquire()
|
||||||
|
|
Loading…
Reference in a new issue