Skip to content

Commit

Permalink
Merge pull request #3 from jbeaurivage/tremoneck_updatePAC
Browse files Browse the repository at this point in the history
Remove "critical-section" feature of PAC libs
  • Loading branch information
Tremoneck authored Oct 26, 2023
2 parents 932f2e9 + 094fd0a commit 8a199c2
Show file tree
Hide file tree
Showing 21 changed files with 8 additions and 23 deletions.
3 changes: 1 addition & 2 deletions boards/wio_terminal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ chip = "ATSAMD51P19A"

[dependencies]
bitfield = "0.13"
cortex-m = { version = "0.7.3", features = ["critical-section-single-core"] }
cortex-m = "0.7.3"
cortex-m-rt = { version = "0.7", optional = true }
display-interface-spi = "0.4"
heapless = "0.5"
Expand All @@ -46,7 +46,6 @@ seeed-erpc = { version = "0.1.1", optional = true }
[dependencies.atsamd-hal]
version = "0.16.0"
default-features = false
features= ["critical-section"]

[dev-dependencies]
usbd-serial = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion boards/wio_terminal/src/sensors.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use atsamd_hal::adc::Adc;
use atsamd_hal::clock::GenericClockController;
use atsamd_hal::pac::gclk::pchctrl::GENSELECT_A::GCLK11;
use atsamd_hal::pac::gclk::pchctrl::GEN_A::GCLK11;
use atsamd_hal::pac::{ADC1, MCLK, SERCOM4};
use atsamd_hal::prelude::*;
use atsamd_hal::sercom::{i2c, IoSet3, Sercom4};
Expand Down
6 changes: 3 additions & 3 deletions boards/wio_terminal/src/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use atsamd_hal::time::Hertz;
#[cfg(feature = "usb")]
use atsamd_hal::usb::{usb_device::bus::UsbBusAllocator, UsbBus};
#[cfg(feature = "usb")]
use pac::gclk::{genctrl::SRCSELECT_A, pchctrl::GENSELECT_A};
use pac::gclk::{genctrl::SRC_A, pchctrl::GEN_A};

use super::pins::aliases::*;

Expand Down Expand Up @@ -69,8 +69,8 @@ impl Usb {
clocks: &mut GenericClockController,
mclk: &mut MCLK,
) -> UsbBusAllocator<UsbBus> {
clocks.configure_gclk_divider_and_source(GENSELECT_A::GCLK2, 1, SRCSELECT_A::DFLL, false);
let usb_gclk = clocks.get_gclk(GENSELECT_A::GCLK2).unwrap();
clocks.configure_gclk_divider_and_source(GEN_A::GCLK2, 1, SRC_A::DFLL, false);
let usb_gclk = clocks.get_gclk(GEN_A::GCLK2).unwrap();
let usb_clock = &clocks.usb(&usb_gclk).unwrap();

UsbBusAllocator::new(UsbBus::new(usb_clock, mclk, self.dm, self.dp, usb))
Expand Down
2 changes: 1 addition & 1 deletion boards/wio_terminal/src/sound.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use atsamd_hal::adc::Adc;
use atsamd_hal::clock::GenericClockController;
use atsamd_hal::pac::gclk::pchctrl::GENSELECT_A::GCLK11;
use atsamd_hal::pac::gclk::pchctrl::GEN_A::GCLK11;
use atsamd_hal::pac::{ADC1, MCLK, TCC0};
use atsamd_hal::prelude::*;
use atsamd_hal::pwm::{TCC0Pinout, Tcc0Pwm};
Expand Down
1 change: 0 additions & 1 deletion pac/atsamd11c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,6 @@ pub struct Peripherals {
}
impl Peripherals {
#[doc = r" Returns all the peripherals *once*."]
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
Expand Down
1 change: 0 additions & 1 deletion pac/atsamd11d/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,6 @@ pub struct Peripherals {
}
impl Peripherals {
#[doc = r" Returns all the peripherals *once*."]
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
Expand Down
1 change: 0 additions & 1 deletion pac/atsamd21e/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1699,7 +1699,6 @@ pub struct Peripherals {
}
impl Peripherals {
#[doc = r" Returns all the peripherals *once*."]
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
Expand Down
1 change: 0 additions & 1 deletion pac/atsamd21g/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1801,7 +1801,6 @@ pub struct Peripherals {
}
impl Peripherals {
#[doc = r" Returns all the peripherals *once*."]
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
Expand Down
1 change: 0 additions & 1 deletion pac/atsamd21j/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1903,7 +1903,6 @@ pub struct Peripherals {
}
impl Peripherals {
#[doc = r" Returns all the peripherals *once*."]
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
Expand Down
1 change: 0 additions & 1 deletion pac/atsamd51g/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3118,7 +3118,6 @@ pub struct Peripherals {
}
impl Peripherals {
#[doc = r" Returns all the peripherals *once*."]
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
Expand Down
1 change: 0 additions & 1 deletion pac/atsamd51j/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3389,7 +3389,6 @@ pub struct Peripherals {
}
impl Peripherals {
#[doc = r" Returns all the peripherals *once*."]
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
Expand Down
1 change: 0 additions & 1 deletion pac/atsamd51n/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3679,7 +3679,6 @@ pub struct Peripherals {
}
impl Peripherals {
#[doc = r" Returns all the peripherals *once*."]
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
Expand Down
1 change: 0 additions & 1 deletion pac/atsamd51p/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3679,7 +3679,6 @@ pub struct Peripherals {
}
impl Peripherals {
#[doc = r" Returns all the peripherals *once*."]
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
Expand Down
1 change: 0 additions & 1 deletion pac/atsame51g/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3169,7 +3169,6 @@ pub struct Peripherals {
}
impl Peripherals {
#[doc = r" Returns all the peripherals *once*."]
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
Expand Down
1 change: 0 additions & 1 deletion pac/atsame51j/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3491,7 +3491,6 @@ pub struct Peripherals {
}
impl Peripherals {
#[doc = r" Returns all the peripherals *once*."]
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
Expand Down
1 change: 0 additions & 1 deletion pac/atsame51n/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3729,7 +3729,6 @@ pub struct Peripherals {
}
impl Peripherals {
#[doc = r" Returns all the peripherals *once*."]
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
Expand Down
1 change: 0 additions & 1 deletion pac/atsame53j/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3440,7 +3440,6 @@ pub struct Peripherals {
}
impl Peripherals {
#[doc = r" Returns all the peripherals *once*."]
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
Expand Down
1 change: 0 additions & 1 deletion pac/atsame53n/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3730,7 +3730,6 @@ pub struct Peripherals {
}
impl Peripherals {
#[doc = r" Returns all the peripherals *once*."]
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
Expand Down
1 change: 0 additions & 1 deletion pac/atsame54n/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3832,7 +3832,6 @@ pub struct Peripherals {
}
impl Peripherals {
#[doc = r" Returns all the peripherals *once*."]
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
Expand Down
1 change: 0 additions & 1 deletion pac/atsame54p/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3832,7 +3832,6 @@ pub struct Peripherals {
}
impl Peripherals {
#[doc = r" Returns all the peripherals *once*."]
#[cfg(feature = "critical-section")]
#[inline]
pub fn take() -> Option<Self> {
critical_section::with(|_| {
Expand Down
2 changes: 2 additions & 0 deletions update-pacs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,7 @@ for xsl in svd/devices/*\.xsl; do
# ignore all clippy warnings/errors in auto-generated code
${SED} -i "s/#\!\[no_std\]/#\!\[allow\(clippy::all\)\]\n#\!\[no_std\]/g" src/lib.rs

${SED} -ri '/#\[cfg\(feature = "critical-section"\)\]/d' src/lib.rs

popd
done

0 comments on commit 8a199c2

Please sign in to comment.