diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 3622df0..46e6e93 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -2,7 +2,7 @@ on: [push, pull_request] name: CI Checks jobs: check: - name: Check and Lint + name: cargo-check runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 @@ -14,20 +14,7 @@ jobs: target: thumbv6m-none-eabi override: true profile: minimal - components: rustfmt, clippy - uses: actions-rs/cargo@v1 with: command: check args: --workspace --examples - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -Dwarnings - - uses: actions-rs/cargo@v1 - with: - command: test - args: --target x86_64-unknown-linux-gnu diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml new file mode 100644 index 0000000..4675ef7 --- /dev/null +++ b/.github/workflows/clippy.yml @@ -0,0 +1,18 @@ +on: [push, pull_request] +name: Clippy check +jobs: + clippy_check: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: thumbv6m-none-eabi + override: true + profile: minimal + components: clippy + - uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -Dwarnings diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml new file mode 100644 index 0000000..528bb71 --- /dev/null +++ b/.github/workflows/rustfmt.yml @@ -0,0 +1,19 @@ +on: [push, pull_request] +name: Code formatting check +jobs: + fmt: + name: Rustfmt + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: thumbv6m-none-eabi + override: true + profile: minimal + components: rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: -- --check diff --git a/.github/workflows/tests_host.yml b/.github/workflows/tests_host.yml new file mode 100644 index 0000000..0d50f03 --- /dev/null +++ b/.github/workflows/tests_host.yml @@ -0,0 +1,19 @@ +on: [push, pull_request] +name: On-host tests +jobs: + check: + name: Check and Lint + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: thumbv6m-none-eabi + override: true + profile: minimal + ## Tests are currently not working on host - disabled until we can find a good solution + # - uses: actions-rs/cargo@v1 + # with: + # command: test + # args: --target x86_64-unknown-linux-gnu diff --git a/rp2040-hal/src/xosc.rs b/rp2040-hal/src/xosc.rs index a499488..6f67b1e 100644 --- a/rp2040-hal/src/xosc.rs +++ b/rp2040-hal/src/xosc.rs @@ -175,6 +175,8 @@ impl CrystalOscillator { } /// Put the XOSC in DORMANT state. + /// + /// # Safety /// This method is marked unsafe because prior to switch the XOSC into DORMANT state, /// PLLs must be stopped and IRQs have to be properly configured. /// This method does not do any of that, it merely switches the XOSC to DORMANT state.