diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10b9f39..5b13285 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - id: boards run: echo "::set-output name=board_matrix::$(ls ./boards --indicator-style=none | jq -ncR '[inputs]')" - id: features - run: echo "::set-output name=feature_matrix::[\"reconfigurable-system-pins\",\"usart-spi-host-without-select\"]" + run: echo "::set-output name=feature_matrix::[\"reconfigurable-system-pins\",\"usart-spi-host-without-select\",\"rt\"]" outputs: pac_matrix: ${{ steps.pacs.outputs.pac_matrix }} board_matrix: ${{ steps.boards.outputs.board_matrix }} @@ -111,7 +111,7 @@ jobs: - name: Install Clippy run: rustup component add clippy - name: Lint HAL - run: cargo clippy --package atsamx7x-hal --no-deps --features samv71q21b,unproven,reconfigurable-system-pins -- --deny warnings + run: cargo clippy --package atsamx7x-hal --no-deps --features samv71q21b,unproven,reconfigurable-system-pins,rt -- --deny warnings clippy-examples: if: github.event.pull_request.head.repo.full_name != github.repository @@ -146,8 +146,6 @@ jobs: - name: Install Rust (thumbv7em) run: rustup target add thumbv7em-none-eabihf - name: Build HAL documentation - run: cargo doc --package atsamx7x-hal --no-deps --features samv71q21b,unproven,reconfigurable-system-pins + run: cargo doc --package atsamx7x-hal --no-deps --features samv71q21b,unproven,reconfigurable-system-pins,rt - name: Build HAL doc tests - run: cargo test --package atsamx7x-hal --doc --features samv71q21b,unproven --target x86_64-unknown-linux-gnu - - + run: cargo test --package atsamx7x-hal --doc --features samv71q21b,unproven,rt --target x86_64-unknown-linux-gnu diff --git a/Cargo.toml b/Cargo.toml index 21f7aaf..2baf7a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,3 +9,37 @@ exclude = [ "pac/templates" ] +[patch.crates-io] +atsame70j19b = { path = "../atsamx7x-pac/pac/atsame70j19b" } +atsame70j20b = { path = "../atsamx7x-pac/pac/atsame70j20b" } +atsame70j21b = { path = "../atsamx7x-pac/pac/atsame70j21b" } +atsame70n19b = { path = "../atsamx7x-pac/pac/atsame70n19b" } +atsame70n20b = { path = "../atsamx7x-pac/pac/atsame70n20b" } +atsame70n21b = { path = "../atsamx7x-pac/pac/atsame70n21b" } +atsame70q19b = { path = "../atsamx7x-pac/pac/atsame70q19b" } +atsame70q20b = { path = "../atsamx7x-pac/pac/atsame70q20b" } +atsame70q21b = { path = "../atsamx7x-pac/pac/atsame70q21b" } +atsams70j19b = { path = "../atsamx7x-pac/pac/atsams70j19b" } +atsams70j20b = { path = "../atsamx7x-pac/pac/atsams70j20b" } +atsams70j21b = { path = "../atsamx7x-pac/pac/atsams70j21b" } +atsams70n19b = { path = "../atsamx7x-pac/pac/atsams70n19b" } +atsams70n20b = { path = "../atsamx7x-pac/pac/atsams70n20b" } +atsams70n21b = { path = "../atsamx7x-pac/pac/atsams70n21b" } +atsams70q19b = { path = "../atsamx7x-pac/pac/atsams70q19b" } +atsams70q20b = { path = "../atsamx7x-pac/pac/atsams70q20b" } +atsams70q21b = { path = "../atsamx7x-pac/pac/atsams70q21b" } +atsamv70j19b = { path = "../atsamx7x-pac/pac/atsamv70j19b" } +atsamv70j20b = { path = "../atsamx7x-pac/pac/atsamv70j20b" } +atsamv70n19b = { path = "../atsamx7x-pac/pac/atsamv70n19b" } +atsamv70n20b = { path = "../atsamx7x-pac/pac/atsamv70n20b" } +atsamv70q19b = { path = "../atsamx7x-pac/pac/atsamv70q19b" } +atsamv70q20b = { path = "../atsamx7x-pac/pac/atsamv70q20b" } +atsamv71j19b = { path = "../atsamx7x-pac/pac/atsamv71j19b" } +atsamv71j20b = { path = "../atsamx7x-pac/pac/atsamv71j20b" } +atsamv71j21b = { path = "../atsamx7x-pac/pac/atsamv71j21b" } +atsamv71n19b = { path = "../atsamx7x-pac/pac/atsamv71n19b" } +atsamv71n20b = { path = "../atsamx7x-pac/pac/atsamv71n20b" } +atsamv71n21b = { path = "../atsamx7x-pac/pac/atsamv71n21b" } +atsamv71q19b = { path = "../atsamx7x-pac/pac/atsamv71q19b" } +atsamv71q20b = { path = "../atsamx7x-pac/pac/atsamv71q20b" } +atsamv71q21b = { path = "../atsamx7x-pac/pac/atsamv71q21b" } diff --git a/hal/Cargo.toml b/hal/Cargo.toml index a6af242..06810a5 100644 --- a/hal/Cargo.toml +++ b/hal/Cargo.toml @@ -28,7 +28,7 @@ edition = "2021" rust-version = "1.70" [dependencies] -cortex-m = "0.7" +cortex-m = { version = "0.7" } embedded-hal = { version = "0.2.7" } nb = "1" fugit = "0.3.6" @@ -40,39 +40,39 @@ void = { version = "1", default-features = false } strum = { version = "0.24.1", default-features = false, features = ["derive"]} cfg-if = "1" mcan-core = { version = "0.2", optional = true } -atsame70j19b = { version = "0.29.0-alpha1", optional = true } -atsame70j20b = { version = "0.29.0-alpha1", optional = true } -atsame70j21b = { version = "0.29.0-alpha1", optional = true } -atsame70n19b = { version = "0.29.0-alpha1", optional = true } -atsame70n20b = { version = "0.29.0-alpha1", optional = true } -atsame70n21b = { version = "0.29.0-alpha1", optional = true } -atsame70q19b = { version = "0.29.0-alpha1", optional = true } -atsame70q20b = { version = "0.29.0-alpha1", optional = true } -atsame70q21b = { version = "0.29.0-alpha1", optional = true } -atsams70j19b = { version = "0.29.0-alpha1", optional = true } -atsams70j20b = { version = "0.29.0-alpha1", optional = true } -atsams70j21b = { version = "0.29.0-alpha1", optional = true } -atsams70n19b = { version = "0.29.0-alpha1", optional = true } -atsams70n20b = { version = "0.29.0-alpha1", optional = true } -atsams70n21b = { version = "0.29.0-alpha1", optional = true } -atsams70q19b = { version = "0.29.0-alpha1", optional = true } -atsams70q20b = { version = "0.29.0-alpha1", optional = true } -atsams70q21b = { version = "0.29.0-alpha1", optional = true } -atsamv70j19b = { version = "0.29.0-alpha1", optional = true } -atsamv70j20b = { version = "0.29.0-alpha1", optional = true } -atsamv70n19b = { version = "0.29.0-alpha1", optional = true } -atsamv70n20b = { version = "0.29.0-alpha1", optional = true } -atsamv70q19b = { version = "0.29.0-alpha1", optional = true } -atsamv70q20b = { version = "0.29.0-alpha1", optional = true } -atsamv71j19b = { version = "0.29.0-alpha1", optional = true } -atsamv71j20b = { version = "0.29.0-alpha1", optional = true } -atsamv71j21b = { version = "0.29.0-alpha1", optional = true } -atsamv71n19b = { version = "0.29.0-alpha1", optional = true } -atsamv71n20b = { version = "0.29.0-alpha1", optional = true } -atsamv71n21b = { version = "0.29.0-alpha1", optional = true } -atsamv71q19b = { version = "0.29.0-alpha1", optional = true } -atsamv71q20b = { version = "0.29.0-alpha1", optional = true } -atsamv71q21b = { version = "0.29.0-alpha1", optional = true } +atsame70j19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsame70j20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsame70j21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsame70n19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsame70n20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsame70n21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsame70q19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsame70q20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsame70q21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsams70j19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsams70j20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsams70j21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsams70n19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsams70n20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsams70n21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsams70q19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsams70q20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsams70q21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsamv70j19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsamv70j20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsamv70n19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsamv70n20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsamv70q19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsamv70q20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsamv71j19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsamv71j20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsamv71j21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsamv71n19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsamv71n20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsamv71n21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsamv71q19b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsamv71q20b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} +atsamv71q21b = { version = "0.29.0-alpha3", optional = true, features = ["critical-section"]} [patch.crates-io] atsame70j19b = { path = "../../atsamx7x-pac/pac/atsame70j19b" } @@ -113,97 +113,77 @@ atsamv71q21b = { path = "../../atsamx7x-pac/pac/atsamv71q21b" } # Internal-only feature flags; do not set directly. # Refer to §2 in the data sheet. ## Refer to §2. -v71 = ["can"] -v70 = ["can"] -e70 = ["can"] -s70 = [] -pins-64 = [] # J variants -pins-100 = [] # N variants -pins-144 = [] # Q variants -flash-2M = [] # "21"-suffix -flash-1M = [] # "20"-suffix -flash-512K = [] # "19"-suffix -can = ["mcan-core"] - -device-selected = [] +__v71 = ["can"] +__v70 = ["can"] +__e70 = ["can"] +__s70 = [] +__pins-64 = [] # J variants +__pins-100 = [] # N variants +__pins-144 = [] # Q variants +__flash-2M = [] # "21"-suffix +__flash-1M = [] # "20"-suffix +__flash-512K = [] # "19"-suffix +__device-selected = [] +# External feature flags; part of the interface. +can = ["mcan-core"] unproven = ["embedded-hal/unproven"] usart-spi-host-without-select = [] reconfigurable-system-pins = [] -same70j19b = ["atsame70j19b", "e70", "pins-64", "flash-512K", "device-selected"] -same70j19b-rt = ["same70j19b", "atsame70j19b/rt"] -same70j20b = ["atsame70j20b", "e70", "pins-64", "flash-1M", "device-selected"] -same70j20b-rt = ["same70j20b", "atsame70j20b/rt"] -same70j21b = ["atsame70j21b", "e70", "pins-64", "flash-2M", "device-selected"] -same70j21b-rt = ["same70j21b", "atsame70j21b/rt"] -same70n19b = ["atsame70n19b", "e70", "pins-100", "flash-512K", "device-selected"] -same70n19b-rt = ["same70n19b", "atsame70n19b/rt"] -same70n20b = ["atsame70n20b", "e70", "pins-100", "flash-1M", "device-selected"] -same70n20b-rt = ["same70n20b", "atsame70n20b/rt"] -same70n21b = ["atsame70n21b", "e70", "pins-100", "flash-2M", "device-selected"] -same70n21b-rt = ["same70n21b", "atsame70n21b/rt"] -same70q19b = ["atsame70q19b", "e70", "pins-144", "flash-512K", "device-selected"] -same70q19b-rt = ["same70q19b", "atsame70q19b/rt"] -same70q20b = ["atsame70q20b", "e70", "pins-144", "flash-1M", "device-selected"] -same70q20b-rt = ["same70q20b", "atsame70q20b/rt"] -same70q21b = ["atsame70q21b", "e70", "pins-144", "flash-2M", "device-selected"] -same70q21b-rt = ["same70q21b", "atsame70q21b/rt"] +same70j19b = ["atsame70j19b", "__e70", "__pins-64", "__flash-512K", "__device-selected"] +same70j20b = ["atsame70j20b", "__e70", "__pins-64", "__flash-1M", "__device-selected"] +same70j21b = ["atsame70j21b", "__e70", "__pins-64", "__flash-2M", "__device-selected"] +same70n19b = ["atsame70n19b", "__e70", "__pins-100", "__flash-512K", "__device-selected"] +same70n20b = ["atsame70n20b", "__e70", "__pins-100", "__flash-1M", "__device-selected"] +same70n21b = ["atsame70n21b", "__e70", "__pins-100", "__flash-2M", "__device-selected"] +same70q19b = ["atsame70q19b", "__e70", "__pins-144", "__flash-512K", "__device-selected"] +same70q20b = ["atsame70q20b", "__e70", "__pins-144", "__flash-1M", "__device-selected"] +same70q21b = ["atsame70q21b", "__e70", "__pins-144", "__flash-2M", "__device-selected"] + +sams70j19b = ["atsams70j19b", "__s70", "__pins-64", "__flash-512K", "__device-selected"] +sams70j20b = ["atsams70j20b", "__s70", "__pins-64", "__flash-1M", "__device-selected"] +sams70j21b = ["atsams70j21b", "__s70", "__pins-64", "__flash-2M", "__device-selected"] +sams70n19b = ["atsams70n19b", "__s70", "__pins-100", "__flash-512K", "__device-selected"] +sams70n20b = ["atsams70n20b", "__s70", "__pins-100", "__flash-1M", "__device-selected"] +sams70n21b = ["atsams70n21b", "__s70", "__pins-100", "__flash-2M", "__device-selected"] +sams70q19b = ["atsams70q19b", "__s70", "__pins-144", "__flash-512K", "__device-selected"] +sams70q20b = ["atsams70q20b", "__s70", "__pins-144", "__flash-1M", "__device-selected"] +sams70q21b = ["atsams70q21b", "__s70", "__pins-144", "__flash-2M", "__device-selected"] + +samv70j19b = ["atsamv70j19b", "__v70", "__pins-64", "__flash-512K", "__device-selected"] +samv70j20b = ["atsamv70j20b", "__v70", "__pins-64", "__flash-1M", "__device-selected"] +samv70n19b = ["atsamv70n19b", "__v70", "__pins-100", "__flash-512K", "__device-selected"] +samv70n20b = ["atsamv70n20b", "__v70", "__pins-100", "__flash-1M", "__device-selected"] +samv70q19b = ["atsamv70q19b", "__v70", "__pins-144", "__flash-512K", "__device-selected"] +samv70q20b = ["atsamv70q20b", "__v70", "__pins-144", "__flash-1M", "__device-selected"] -sams70j19b = ["atsams70j19b", "s70", "pins-64", "flash-512K", "device-selected"] -sams70j19b-rt = ["sams70j19b", "atsams70j19b/rt"] -sams70j20b = ["atsams70j20b", "s70", "pins-64", "flash-1M", "device-selected"] -sams70j20b-rt = ["sams70j20b", "atsams70j20b/rt"] -sams70j21b = ["atsams70j21b", "s70", "pins-64", "flash-2M", "device-selected"] -sams70j21b-rt = ["sams70j21b", "atsams70j21b/rt"] -sams70n19b = ["atsams70n19b", "s70", "pins-100", "flash-512K", "device-selected"] -sams70n19b-rt = ["sams70n19b", "atsams70n19b/rt"] -sams70n20b = ["atsams70n20b", "s70", "pins-100", "flash-1M", "device-selected"] -sams70n20b-rt = ["sams70n20b", "atsams70n20b/rt"] -sams70n21b = ["atsams70n21b", "s70", "pins-100", "flash-2M", "device-selected"] -sams70n21b-rt = ["sams70n21b", "atsams70n21b/rt"] -sams70q19b = ["atsams70q19b", "s70", "pins-144", "flash-512K", "device-selected"] -sams70q19b-rt = ["sams70q19b", "atsams70q19b/rt"] -sams70q20b = ["atsams70q20b", "s70", "pins-144", "flash-1M", "device-selected"] -sams70q20b-rt = ["sams70q20b", "atsams70q20b/rt"] -sams70q21b = ["atsams70q21b", "s70", "pins-144", "flash-2M", "device-selected"] -sams70q21b-rt = ["sams70q21b", "atsams70q21b/rt"] +samv71j19b = ["atsamv71j19b", "__v71", "__pins-64", "__flash-512K", "__device-selected"] +samv71j20b = ["atsamv71j20b", "__v71", "__pins-64", "__flash-1M", "__device-selected"] +samv71j21b = ["atsamv71j21b", "__v71", "__pins-64", "__flash-2M", "__device-selected"] +samv71n19b = ["atsamv71n19b", "__v71", "__pins-100", "__flash-512K", "__device-selected"] +samv71n20b = ["atsamv71n20b", "__v71", "__pins-100", "__flash-1M", "__device-selected"] +samv71n21b = ["atsamv71n21b", "__v71", "__pins-100", "__flash-2M", "__device-selected"] +samv71q19b = ["atsamv71q19b", "__v71", "__pins-144", "__flash-512K", "__device-selected"] +samv71q20b = ["atsamv71q20b", "__v71", "__pins-144", "__flash-1M", "__device-selected"] +samv71q21b = ["atsamv71q21b", "__v71", "__pins-144", "__flash-2M", "__device-selected"] -samv70j19b = ["atsamv70j19b", "v70", "pins-64", "flash-512K", "device-selected"] -samv70j19b-rt = ["samv70j19b", "atsamv70j19b/rt"] -samv70j20b = ["atsamv70j20b", "v70", "pins-64", "flash-1M", "device-selected"] -samv70j20b-rt = ["samv70j20b", "atsamv70j20b/rt"] -samv70n19b = ["atsamv70n19b", "v70", "pins-100", "flash-512K", "device-selected"] -samv70n19b-rt = ["samv70n19b", "atsamv70n19b/rt"] -samv70n20b = ["atsamv70n20b", "v70", "pins-100", "flash-1M", "device-selected"] -samv70n20b-rt = ["samv70n20b", "atsamv70n20b/rt"] -samv70q19b = ["atsamv70q19b", "v70", "pins-144", "flash-512K", "device-selected"] -samv70q19b-rt = ["samv70q19b", "atsamv70q19b/rt"] -samv70q20b = ["atsamv70q20b", "v70", "pins-144", "flash-1M", "device-selected"] -samv70q20b-rt = ["samv70q20b", "atsamv70q20b/rt"] +rt = ["atsame70j19b?/rt", "atsame70j20b?/rt", "atsame70j21b?/rt", + "atsame70n19b?/rt", "atsame70n20b?/rt", "atsame70n21b?/rt", + "atsame70q19b?/rt", "atsame70q20b?/rt", "atsame70q21b?/rt", + "atsams70j19b?/rt", "atsams70j20b?/rt", "atsams70j21b?/rt", + "atsams70n19b?/rt", "atsams70n20b?/rt", "atsams70n21b?/rt", + "atsams70q19b?/rt", "atsams70q20b?/rt", "atsams70q21b?/rt", + "atsamv70j19b?/rt", "atsamv70j20b?/rt", "atsamv70n19b?/rt", + "atsamv70n20b?/rt", "atsamv70q19b?/rt", "atsamv70q20b?/rt", + "atsamv71j19b?/rt", "atsamv71j20b?/rt", "atsamv71j21b?/rt", + "atsamv71n19b?/rt", "atsamv71n20b?/rt", "atsamv71n21b?/rt", + "atsamv71q19b?/rt", "atsamv71q20b?/rt", "atsamv71q21b?/rt"] -samv71j19b = ["atsamv71j19b", "v71", "pins-64", "flash-512K", "device-selected"] -samv71j19b-rt = ["samv71j19b", "atsamv71j19b/rt"] -samv71j20b = ["atsamv71j20b", "v71", "pins-64", "flash-1M", "device-selected"] -samv71j20b-rt = ["samv71j20b", "atsamv71j20b/rt"] -samv71j21b = ["atsamv71j21b", "v71", "pins-64", "flash-2M", "device-selected"] -samv71j21b-rt = ["samv71j21b", "atsamv71j21b/rt"] -samv71n19b = ["atsamv71n19b", "v71", "pins-100", "flash-512K", "device-selected"] -samv71n19b-rt = ["samv71n19b", "atsamv71n19b/rt"] -samv71n20b = ["atsamv71n20b", "v71", "pins-100", "flash-1M", "device-selected"] -samv71n20b-rt = ["samv71n20b", "atsamv71n20b/rt"] -samv71n21b = ["atsamv71n21b", "v71", "pins-100", "flash-2M", "device-selected"] -samv71n21b-rt = ["samv71n21b", "atsamv71n21b/rt"] -samv71q19b = ["atsamv71q19b", "v71", "pins-144", "flash-512K", "device-selected"] -samv71q19b-rt = ["samv71q19b", "atsamv71q19b/rt"] -samv71q20b = ["atsamv71q20b", "v71", "pins-144", "flash-1M", "device-selected"] -samv71q20b-rt = ["samv71q20b", "atsamv71q20b/rt"] -samv71q21b = ["atsamv71q21b", "v71", "pins-144", "flash-2M", "device-selected"] -samv71q21b-rt = ["samv71q21b", "atsamv71q21b/rt"] [package.metadata.docs.rs] # docs.rs build target default-target = "thumbv7em-none-eabihf" # enable features to get maximum doc coverage -features = ["samv71q21b-rt", "unproven", "usart-spi-host-without-select", "reconfigurable-system-pins"] +features = ["samv71q21b", "rt", "unproven", "usart-spi-host-without-select", "reconfigurable-system-pins"] diff --git a/hal/build.rs b/hal/build.rs index a0428af..f0db39c 100644 --- a/hal/build.rs +++ b/hal/build.rs @@ -11,7 +11,7 @@ fn main() -> Result<(), &'static str> { .is_ok() } - if !feat("device-selected") || ["e70", "s70", "v70", "v71"].iter().all(|&f| !feat(f)) { + if !feat("__device-selected") || ["__e70", "__s70", "__v70", "__v71"].iter().all(|&f| !feat(f)) { return Err( "The HAL is built for a specific target device selected using a feature, but no such a feature was selected." ); diff --git a/hal/src/afec.rs b/hal/src/afec.rs index cd398f8..f33d599 100644 --- a/hal/src/afec.rs +++ b/hal/src/afec.rs @@ -20,7 +20,7 @@ This implementation presumes that VREFP is 3.3V. # use hal::efc::*; # use hal::afec::*; # use hal::fugit::RateExtU32; -# let pac = unsafe{ hal::pac::Peripherals::steal() }; +# let pac = hal::pac::Peripherals::take().unwrap(); # let (slck, mut mck) = Tokens::new((pac.PMC, pac.SUPC, pac.UTMI), &pac.WDT.into()).por_state(&mut Efc::new(pac.EFC, VddioLevel::V3)); let banka = BankA::new(pac.PIOA, &mut mck, &slck, BankConfiguration::default()); @@ -76,49 +76,49 @@ impl_channel_pins!( Afec0 { // Channel 11 is dedicated to the temperature sensor. - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA17, 6), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA18, 7), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA19, 8), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA20, 9), (PA21, 1), (PB0, 10), (PB2, 5), (PB3, 2), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PD30, 0), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] (PE4, 4), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] (PE5, 3), } Afec1 { (PB1, 0), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] (PC0, 9), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] (PC12, 3), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] (PC13, 1), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] (PC15, 2), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] (PC26, 7), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] (PC27, 8), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] (PC29, 4), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] (PC30, 5), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] (PC31, 6), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] (PE0, 11), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] (PE3, 10), } ); diff --git a/hal/src/can.rs b/hal/src/can.rs index 8df8a4f..ad244eb 100644 --- a/hal/src/can.rs +++ b/hal/src/can.rs @@ -54,10 +54,10 @@ unsafe impl mcan_core::CanId for Can0 { } /// Identity type for `MCAN1` -#[cfg(any(feature = "pins-100", feature = "pins-144"))] +#[cfg(any(feature = "__pins-100", feature = "__pins-144"))] pub enum Can1 {} -#[cfg(any(feature = "pins-100", feature = "pins-144"))] +#[cfg(any(feature = "__pins-100", feature = "__pins-144"))] impl CanMeta for Can1 { const PID: PeripheralIdentifier = PeripheralIdentifier::MCAN1; type REG = crate::pac::MCAN1; @@ -66,10 +66,10 @@ impl CanMeta for Can1 { } } -#[cfg(any(feature = "pins-100", feature = "pins-144"))] +#[cfg(any(feature = "__pins-100", feature = "__pins-144"))] impl generics::Sealed for Can1 {} -#[cfg(any(feature = "pins-100", feature = "pins-144"))] +#[cfg(any(feature = "__pins-100", feature = "__pins-144"))] unsafe impl mcan_core::CanId for Can1 { const ADDRESS: *const () = ::REG::PTR as _; } @@ -159,22 +159,22 @@ impl TxPin for Pin { type ValidFor = Can0; } -#[cfg(feature = "pins-144")] +#[cfg(feature = "__pins-144")] impl RxPin for Pin { type ValidFor = Can1; } -#[cfg(feature = "pins-100")] +#[cfg(feature = "__pins-100")] impl RxPin for Pin { type ValidFor = Can1; } -#[cfg(feature = "pins-144")] +#[cfg(feature = "__pins-144")] impl TxPin for Pin { type ValidFor = Can1; } -#[cfg(any(feature = "pins-100", feature = "pins-144"))] +#[cfg(any(feature = "__pins-100", feature = "__pins-144"))] impl TxPin for Pin { type ValidFor = Can1; } diff --git a/hal/src/clocks/mod.rs b/hal/src/clocks/mod.rs index ea9f800..23d9cdd 100644 --- a/hal/src/clocks/mod.rs +++ b/hal/src/clocks/mod.rs @@ -238,7 +238,7 @@ pub enum ClockError { InvalidHccFreq(Megahertz), /// The V70/V71 must be driven with VDDIO = 3.3V, typical. - #[cfg(any(feature = "v70", feature = "v71"))] + #[cfg(any(feature = "__v70", feature = "__v71"))] InvalidVddioLevel, } diff --git a/hal/src/efc.rs b/hal/src/efc.rs index 74341cd..245000b 100644 --- a/hal/src/efc.rs +++ b/hal/src/efc.rs @@ -66,7 +66,7 @@ enum FlashWaitStates { impl FlashWaitStates { pub fn calculate(freq: Megahertz, vddio: &VddioLevel) -> Result { - #[cfg(any(feature = "v70", feature = "v71"))] + #[cfg(any(feature = "__v70", feature = "__v71"))] if vddio == &VddioLevel::V1 { // V70/V71 must be driven with VDDIO = 3.3V, typical return Err(ClockError::InvalidVddioLevel); diff --git a/hal/src/lib.rs b/hal/src/lib.rs index 5c8a9be..13c837d 100644 --- a/hal/src/lib.rs +++ b/hal/src/lib.rs @@ -171,27 +171,27 @@ pub use atsamv71q21 as pac; #[cfg(feature = "samv71q21b")] pub use atsamv71q21b as pac; -#[cfg(feature = "device-selected")] +#[cfg(feature = "__device-selected")] pub mod afec; -#[cfg(all(feature = "device-selected", feature = "can"))] +#[cfg(all(feature = "__device-selected", feature = "can"))] pub mod can; -#[cfg(feature = "device-selected")] +#[cfg(feature = "__device-selected")] pub mod clocks; -#[cfg(feature = "device-selected")] +#[cfg(feature = "__device-selected")] pub mod efc; -#[cfg(feature = "device-selected")] +#[cfg(feature = "__device-selected")] pub mod generics; -#[cfg(feature = "device-selected")] +#[cfg(feature = "__device-selected")] pub mod pio; -#[cfg(feature = "device-selected")] +#[cfg(feature = "__device-selected")] pub mod pwm; -#[cfg(feature = "device-selected")] +#[cfg(feature = "__device-selected")] pub mod rtt; -#[cfg(feature = "device-selected")] +#[cfg(feature = "__device-selected")] pub mod serial; -#[cfg(feature = "device-selected")] +#[cfg(feature = "__device-selected")] pub mod tc; -#[cfg(feature = "device-selected")] +#[cfg(feature = "__device-selected")] pub mod usb; -#[cfg(feature = "device-selected")] +#[cfg(feature = "__device-selected")] pub mod watchdog; diff --git a/hal/src/pio/bank.rs b/hal/src/pio/bank.rs index e79e76f..42fce89 100644 --- a/hal/src/pio/bank.rs +++ b/hal/src/pio/bank.rs @@ -315,16 +315,16 @@ macro_rules! banks { banks!( A { - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA0, 0), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA1, 1), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA2, 2), (PA3, 3), (PA4, 4), (PA5, 5), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] (PA6, 6), (PA7, 7), (PA8, 8), @@ -334,35 +334,35 @@ banks!( (PA12, 12), (PA13, 13), (PA14, 14), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA15, 15), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA16, 16), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA17, 17), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA18, 18), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA19, 19), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA20, 20), (PA21, 21), (PA22, 22), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA23, 23), (PA24, 24), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA25, 25), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA26, 26), (PA27, 27), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA28, 28), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] (PA29, 29), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA30, 30), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PA31, 31), } @@ -383,11 +383,11 @@ banks!( (PB9, 9), #[cfg(feature = "reconfigurable-system-pins")] (PB12, 12), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PB13, 13), } - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] C { (PC0, 0), (PC1, 1), @@ -437,41 +437,41 @@ banks!( (PD10, 10), (PD11, 11), (PD12, 12), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PD13, 13), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PD14, 14), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PD15, 15), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PD16, 16), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PD17, 17), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PD18, 18), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PD19, 19), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PD20, 20), (PD21, 21), (PD22, 22), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] (PD23, 23), (PD24, 24), (PD25, 25), (PD26, 26), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PD27, 27), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PD28, 28), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] (PD29, 29), - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] (PD30, 30), (PD31, 31), } - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] E { (PE0, 0), (PE1, 1), diff --git a/hal/src/pio/dynpin.rs b/hal/src/pio/dynpin.rs index d0d1774..84489dc 100644 --- a/hal/src/pio/dynpin.rs +++ b/hal/src/pio/dynpin.rs @@ -86,10 +86,10 @@ pub enum DynPinMode { pub enum DynBank { A, B, - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] C, D, - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] E, } @@ -98,10 +98,10 @@ impl DynBank { match self { Self::A => PIOA::ptr(), Self::B => PIOB::ptr(), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] Self::C => PIOC::ptr(), Self::D => PIOD::ptr(), - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] Self::E => PIOE::ptr(), } } diff --git a/hal/src/pio/mod.rs b/hal/src/pio/mod.rs index 48ea302..43c832d 100644 --- a/hal/src/pio/mod.rs +++ b/hal/src/pio/mod.rs @@ -129,7 +129,7 @@ use crate::pac::{ PIOB, PIOD, }; -#[cfg(feature = "pins-144")] +#[cfg(feature = "__pins-144")] use crate::pac::{PIOC, PIOE}; pub mod pin; diff --git a/hal/src/pwm.rs b/hal/src/pwm.rs index 8907311..8d280b6 100644 --- a/hal/src/pwm.rs +++ b/hal/src/pwm.rs @@ -17,7 +17,7 @@ Refer to §51 for a full description of the PWM peripheral. # use hal::efc::*; # use hal::pwm::*; # use hal::fugit::RateExtU32; -# let pac = unsafe{hal::pac::Peripherals::steal()}; +# let pac = hal::pac::Peripherals::take().unwrap(); # let (slck, mut mck) = Tokens::new((pac.PMC, pac.SUPC, pac.UTMI), &pac.WDT.into()).por_state(&mut Efc::new(pac.EFC, VddioLevel::V3)); use hal::ehal::PwmPin; @@ -441,23 +441,23 @@ impl_pwm!( Ch0: { // PWMC0_PWMH0 H: [ - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin, Pin, - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin, Pin, - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] Pin, Pin, - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin, ], // PWMC0_PWML0 L: [ - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin, - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin, #[cfg(feature = "reconfigurable-system-pins")] Pin, @@ -476,7 +476,7 @@ impl_pwm!( Ch1: { // PWMC0_PWMH1 H: [ - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin, Pin, Pin, @@ -485,15 +485,15 @@ impl_pwm!( ], // PWMC0_PWML1 L: [ - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin, - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin, #[cfg(feature = "reconfigurable-system-pins")] Pin, - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] Pin, - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] Pin, Pin, ], @@ -510,22 +510,22 @@ impl_pwm!( // PWMC0_PWMH2 H: [ Pin, - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin, #[cfg(feature = "reconfigurable-system-pins")] Pin, - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] Pin, Pin, ], // PWMC0_PWML2 L: [ - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin, Pin, - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] Pin, - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] Pin, Pin, ], @@ -541,26 +541,26 @@ impl_pwm!( H: [ Pin, Pin, - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin, - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] Pin, - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] Pin, - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] Pin, ], // PWMC0_PWML3 L: [ - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin, - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] Pin, - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] Pin, - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] Pin, - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin, ], // PWMC0_PWMEXTRG3 @@ -614,13 +614,13 @@ impl_pwm!( Ch2: { // PWMC1_PWMH2 H: [ - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin, Pin, ], // PWMC1_PWML2 L: [ - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin, Pin, ], diff --git a/hal/src/serial/mod.rs b/hal/src/serial/mod.rs index 653a641..e6537ac 100644 --- a/hal/src/serial/mod.rs +++ b/hal/src/serial/mod.rs @@ -26,5 +26,5 @@ pub mod usart; pub mod twi; pub use twi::*; -#[cfg(not(feature = "pins-64"))] +#[cfg(not(feature = "__pins-64"))] pub mod spi; diff --git a/hal/src/serial/spi.rs b/hal/src/serial/spi.rs index 5ffcb78..a2584de 100644 --- a/hal/src/serial/spi.rs +++ b/hal/src/serial/spi.rs @@ -63,7 +63,7 @@ use super::Bps; use crate::clocks::{Clock, HostClock, PeripheralIdentifier}; use crate::ehal::blocking; use crate::fugit::{ExtU32, NanosDurationU32 as NanosDuration}; -#[cfg(feature = "pins-144")] +#[cfg(feature = "__pins-144")] use crate::pac::SPI1; use crate::pac::{spi0::tdr::PCSSELECT_AW as HwChipSelect, spi0::RegisterBlock, SPI0}; use crate::{ehal, nb}; @@ -578,7 +578,7 @@ impl_spi!( ], }, - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] Spi1: { MISO: [ Pin ], MOSI: [ Pin ], diff --git a/hal/src/serial/twi.rs b/hal/src/serial/twi.rs index 678b9af..c8154ec 100644 --- a/hal/src/serial/twi.rs +++ b/hal/src/serial/twi.rs @@ -47,7 +47,7 @@ use crate::ehal::blocking; use crate::generics; #[cfg(feature = "reconfigurable-system-pins")] use crate::pac::TWIHS1; -#[cfg(not(feature = "pins-64"))] +#[cfg(not(feature = "__pins-64"))] use crate::pac::TWIHS2; use crate::pac::{ twihs0::{sr::R as StatusRegister, RegisterBlock}, @@ -301,7 +301,7 @@ impl_twi!( DATA: Pin, CLOCK: Pin, }, - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] TwiHS2: { DATA: Pin, CLOCK: Pin, diff --git a/hal/src/serial/uart.rs b/hal/src/serial/uart.rs index ef233d9..67669a9 100644 --- a/hal/src/serial/uart.rs +++ b/hal/src/serial/uart.rs @@ -72,8 +72,8 @@ use crate::fugit::HertzU32 as Hertz; use crate::pac::uart0::mr::{CHMODESELECT_A as ChannelModeInner, PARSELECT_A as ParityModeInner}; use crate::pac::{uart0::RegisterBlock, UART0, UART1, UART2}; #[cfg(all( - any(feature = "e70", feature = "s70", feature = "v71"), - any(feature = "pins-100", feature = "pins-144") + any(feature = "__e70", feature = "__s70", feature = "__v71"), + any(feature = "__pins-100", feature = "__pins-144") ))] use crate::pac::{UART3, UART4}; use crate::serial::Bps; @@ -511,7 +511,7 @@ impl_uart!( RX: [ Pin ], TX: [ Pin, - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] Pin, Pin, ], @@ -521,16 +521,16 @@ impl_uart!( TX: [ Pin, ], }, #[cfg(all( - any(feature = "e70", feature = "s70", feature = "v71"), - any(feature = "pins-100", feature = "pins-144") + any(feature = "__e70", feature = "__s70", feature = "__v71"), + any(feature = "__pins-100", feature = "__pins-144") ))] Uart3: { RX: [ Pin ], TX: [ Pin, Pin, ], }, #[cfg(all( - any(feature = "e70", feature = "s70", feature = "v71"), - any(feature = "pins-100", feature = "pins-144") + any(feature = "__e70", feature = "__s70", feature = "__v71"), + any(feature = "__pins-100", feature = "__pins-144") ))] Uart4: { RX: [ Pin ], diff --git a/hal/src/serial/usart/mod.rs b/hal/src/serial/usart/mod.rs index ab2ba6a..70e1240 100644 --- a/hal/src/serial/usart/mod.rs +++ b/hal/src/serial/usart/mod.rs @@ -89,7 +89,7 @@ use crate::clocks::{Clock, Hertz, HostClock, Pck, Pck4, PeripheralIdentifier}; use crate::generics::{self, Token}; #[cfg(feature = "reconfigurable-system-pins")] use crate::pac::USART1; -#[cfg(not(feature = "pins-64"))] +#[cfg(not(feature = "__pins-64"))] use crate::pac::USART2; use crate::pac::{ usart0::us_mr_usart_mode::CHMODESELECT_A as HwChannelMode, @@ -617,7 +617,7 @@ The [pins]("[<$Usart Pins>]") specified determine what [`UsartMode`]s are valid impl_usart!( Usart0: { SCK: [ - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin ], RX: [ Pin ], @@ -634,7 +634,7 @@ impl_usart!( #[cfg(feature = "reconfigurable-system-pins")] Usart1: { SCK: [ - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin ], RX: [ Pin ], @@ -646,12 +646,12 @@ impl_usart!( // DCD: [ Pin ], // DTR: [ Pin ], CTS: [ - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Pin ], RTS: [ Pin ], }, - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] Usart2: { SCK: [ Pin ], RX: [ Pin ], @@ -668,7 +668,7 @@ impl_usart!( ); cfg_if::cfg_if! { - if #[cfg(all(feature = "usart-spi-host-without-select", not(feature = "pins-64")))] { + if #[cfg(all(feature = "usart-spi-host-without-select", not(feature = "__pins-64")))] { impl_pins!( Usart0: { (/* TX */ Pin, /* RX */ Pin, /* SCK */ Pin): { diff --git a/hal/src/tc/mod.rs b/hal/src/tc/mod.rs index b558176..aa667e7 100644 --- a/hal/src/tc/mod.rs +++ b/hal/src/tc/mod.rs @@ -705,127 +705,127 @@ impl_tc!( Tc0: { Ch0: { // TIOA0 - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] TIOA: Pin, // TIOB0 - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] TIOB: Pin, // TCLK0 TCLK: Pin, }, Ch1: { // TIOA1 - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] TIOA: Pin, // TIOB1 - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] TIOB: Pin, // TCLK1 - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] TCLK: Pin, }, Ch2: { // TIOA2 - #[cfg(not(feature = "pins-64"))] + #[cfg(not(feature = "__pins-64"))] TIOA: Pin, // TIOB2 TIOB: Pin, // TCLK2 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TCLK: Pin, }, }, Tc1: { Ch0: { // TIOA3 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TIOA: Pin, // TIOB3 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TIOB: Pin, // TCLK3 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TCLK: Pin, }, Ch1: { // TIOA4 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TIOA: Pin, // TIOB4 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TIOB: Pin, // TCLK4 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TCLK: Pin, }, Ch2: { // TIOA5 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TIOA: Pin, // TIOB5 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TIOB: Pin, // TCLK5 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TCLK: Pin, }, }, Tc2: { Ch0: { // TIOA6 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TIOA: Pin, // TIOB6 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TIOB: Pin, // TCLK6 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TCLK: Pin, }, Ch1: { // TIOA7 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TIOA: Pin, // TIOB7 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TIOB: Pin, // TCLK7 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TCLK: Pin, }, Ch2: { // TIOA8 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TIOA: Pin, - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] // TIOB8 TIOB: Pin, // TCLK8 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TCLK: Pin, }, }, Tc3: { Ch0: { // TIOA9 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TIOA: Pin, // TIOB9 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TIOB: Pin, // TCLK9 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TCLK: Pin, }, Ch1: { // TIOA10 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TIOA: Pin, // TIOB10 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TIOB: Pin, // TCLK10 - #[cfg(feature = "pins-144")] + #[cfg(feature = "__pins-144")] TCLK: Pin, }, Ch2: { diff --git a/hal/src/usb.rs b/hal/src/usb.rs index da549ee..5e8d4fb 100644 --- a/hal/src/usb.rs +++ b/hal/src/usb.rs @@ -64,6 +64,8 @@ use crate::clocks::{HostClock, PeripheralIdentifier, UpllClock}; use crate::pac::{usbhs::RegisterBlock, USBHS}; use core::cell::UnsafeCell; +use core::option::Option; +use core::result::Result::{Err, Ok}; use cortex_m::interrupt::{self, Mutex}; use usb_device::bus::{PollResult, UsbBusAllocator}; diff --git a/hal/src/watchdog.rs b/hal/src/watchdog.rs index bc52c68..1b999ec 100644 --- a/hal/src/watchdog.rs +++ b/hal/src/watchdog.rs @@ -1,6 +1,7 @@ //! Watchdog timer configuration. use crate::{generics, pac::WDT}; +use core::convert::From; use core::marker::PhantomData; /// The state of the [`Watchdog`].