diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..bb93650 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +on: + push: + branches: [ staging, trying, master ] + pull_request: + +name: CI + +jobs: + ci-linux: + runs-on: ubuntu-20.04 + continue-on-error: ${{ matrix.experimental || false }} + strategy: + matrix: + rust: [stable, nightly] + include: + # Nightly is only for reference and allowed to fail + - rust: nightly + experimental: true + + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + + - name: Check code + run: cargo check + + - name: Check examples + run: cargo check --examples diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml new file mode 100644 index 0000000..9a55c00 --- /dev/null +++ b/.github/workflows/rustfmt.yml @@ -0,0 +1,23 @@ +on: + push: + branches: [ staging, trying, master ] + pull_request: + +name: Code formatting check + +jobs: + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 787c1dd..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: rust - -rust: - - nightly - - stable - -matrix: - fast_finish: true - allow_failures: - - rust: nightly - -cache: cargo - -install: - - rustup component add rustfmt - -script: - - ci/script.sh diff --git a/Cargo.toml b/Cargo.toml index def3c6c..44ead02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stm32-usbd" -version = "0.5.1" +version = "0.6.0" edition = "2018" authors = ["Matti Virkkunen ", "Vadim Kaushan ", "Nicolas Stalder ", "Jonas Martin "] description = "'usb-device' implementation for STM32 microcontrollers" @@ -15,9 +15,4 @@ cortex-m = "0.7.1" usb-device = "0.2.3" [dev-dependencies] -stm32f1xx-hal = { version = "0.4.0", features = ["stm32f103"] } - -[features] -# USB RAM access scheme -ram_access_1x16 = [] -ram_access_2x16 = [] +stm32f1xx-hal = { version = "0.7.0", features = ["stm32f103"] } diff --git a/README.md b/README.md index 8bf5a95..2a353fc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![crates.io](https://img.shields.io/crates/d/stm32-usbd.svg)](https://crates.io/crates/stm32-usbd) [![crates.io](https://img.shields.io/crates/v/stm32-usbd.svg)](https://crates.io/crates/stm32-usbd) -[![Build Status](https://travis-ci.org/stm32-rs/stm32-usbd.svg?branch=master)](https://travis-ci.org/stm32-rs/stm32-usbd) +![Build Status](https://github.com/stm32-rs/stm32-usbd/workflows/CI/badge.svg) # `stm32-usbd` diff --git a/ci/script.sh b/ci/script.sh deleted file mode 100755 index f77d232..0000000 --- a/ci/script.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -euxo pipefail - -cargo check -cargo check --example hal -cargo fmt -- --check diff --git a/src/lib.rs b/src/lib.rs index b1c0997..3f92e32 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,9 +5,6 @@ #![no_std] -#[cfg(all(feature = "ram_access_1x16", feature = "ram_access_2x16"))] -compile_error!("Multiple ram_access features are specified. Only a single feature can be specified."); - pub mod bus; mod endpoint; mod endpoint_memory; @@ -32,16 +29,11 @@ pub unsafe trait UsbPeripheral: Send + Sync { /// Endpoint memory size in bytes const EP_MEMORY_SIZE: usize; - #[cfg(not(any(feature = "ram_access_1x16", feature = "ram_access_2x16")))] /// Endpoint memory access scheme /// /// Check Reference Manual for details. /// Set to `true` if "2x16 bits/word" access scheme is used, otherwise set to `false`. const EP_MEMORY_ACCESS_2X16: bool; - #[cfg(feature = "ram_access_1x16")] - const EP_MEMORY_ACCESS_2X16: bool = false; - #[cfg(feature = "ram_access_2x16")] - const EP_MEMORY_ACCESS_2X16: bool = true; /// Enables USB device on its peripheral bus fn enable();