Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ENC424J600 support #134

Closed
wants to merge 14 commits into from
77 changes: 73 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
with:
command: clippy

compile:
compile-w5500:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -96,7 +96,66 @@ jobs:
(${{ github.ref == 'refs/heads/master' }} ||
${{ github.ref == 'refs/heads/develop' }})
with:
name: Firmware Images
name: Firmware Images (W5500)
path: |
target/*/release/booster
booster-release.bin

compile-enc424j600:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
steps:
- uses: actions/checkout@v2

- name: Install Rust ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
target: thumbv7em-none-eabihf
override: true
components: llvm-tools-preview

- name: Install Binutils
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-binutils

- name: Style Check
uses: actions-rs/cargo@v1
with:
command: check
args: --verbose

- name: Build [Debug]
uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features --features phy_enc424j600

- name: Build [Release]
uses: actions-rs/cargo@v1
with:
command: build
args: --release --no-default-features --features phy_enc424j600

- name: Generate Release
uses: actions-rs/cargo@v1
with:
command: objcopy
args: --release --verbose -- -O binary booster-release.bin

- name: Upload Release
uses: actions/upload-artifact@v2
if: ${{ matrix.toolchain == 'stable' }} &&
(${{ github.ref == 'refs/heads/master' }} ||
${{ github.ref == 'refs/heads/develop' }})
with:
name: Firmware Images (ENC424J600)
path: |
target/*/release/booster
booster-release.bin
Expand All @@ -111,13 +170,23 @@ jobs:
toolchain: nightly
target: thumbv7em-none-eabihf
override: true
- name: cargo build+unstable
- name: cargo build+unstable+w5500
uses: actions-rs/cargo@v1
with:
command: build
args: --features unstable
- name: cargo build+release+unstable
- name: cargo build+release+unstable+w5500
uses: actions-rs/cargo@v1
with:
command: build
args: --release --features unstable
- name: cargo build+unstable+enc424j600
uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features --features "unstable phy_enc424j600"
- name: cargo build+release+unstable+enc424j600
uses: actions-rs/cargo@v1
with:
command: build
args: --release --no-default-features --features "unstable phy_enc424j600"
112 changes: 112 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ features = ["stm32f407", "rt", "usb_fs"]
[dependencies.w5500]
git = "https://github.com/quartiq/w5500"
branch = "feature/tcp-nal"
optional = true

[dependencies.enc424j600]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the .github/workflow/ci.yml file to build both PHYs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 4ae6e82

git = "https://git.m-labs.hk/M-Labs/ENC424J600.git"
features = [ "nal" ]
optional = true

[dependencies.smoltcp]
version = "0.7.0"
default-features = false
features = [ "ethernet", "proto-ipv4", "proto-ipv6", "socket-tcp" ]
optional = true

[dependencies.ad5627]
path = "ad5627"
Expand Down Expand Up @@ -63,6 +75,9 @@ path = "tca9548"

[features]
unstable = []
phy_enc424j600 = [ "enc424j600", "smoltcp" ]
phy_w5500 = [ "w5500" ]
default = [ "phy_w5500" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like removing this line (i.e. not defining default features entirely) would avoid situations like running cargo build --features=phy_enc424j600 but forgetting to use --no-default-features. I would like to hear the opinion from others on this, thanks!


[profile.release]
codegen-units = 1 # better optimizations
Expand Down
Loading