Skip to content
Closed
6 changes: 2 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ Please make sure that your submission includes the following:

### Must

- [ ] The code compiles without `errors` or `warnings`.
- [ ] All examples compile without warnings.
- [ ] All examples work.
- [ ] `cargo fmt` was run.
- [ ] Your changes were added to the `CHANGELOG.md` in the proper section.
- [ ] You updated existing examples or added examples (if applicable).
- [ ] Added examples are checked in CI
- [ ] Added examples are checked in CI.

### Nice to have

Expand Down
70 changes: 42 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@ jobs:

# Check all RISC-V targets:
- name: check (esp32c3)
run: cd esp-hal-smartled/ && cargo +nightly check --features=esp32c3
run: cd esp-hal-smartled/ && cargo +nightly check --features=esp32c3 --target=riscv32imc-unknown-none-elf
- name: check (esp32c6)
run: cd esp-hal-smartled/ && cargo +nightly check --features=esp32c6
run: cd esp-hal-smartled/ && cargo +nightly check --features=esp32c6 --target=riscv32imac-unknown-none-elf
- name: check (esp32h2)
run: cd esp-hal-smartled/ && cargo +nightly check --features=esp32h2
run: cd esp-hal-smartled/ && cargo +nightly check --features=esp32h2 --target=riscv32imac-unknown-none-elf
# Check all Xtensa targets:
- name: check (esp32)
run: cd esp-hal-smartled/ && cargo +esp check --features=esp32,esp32_40mhz
run: cd esp-hal-smartled/ && cargo +esp check --features=esp32,esp32_40mhz --target=xtensa-esp32-none-elf -Zbuild-std=core
- name: check (esp32s2)
run: cd esp-hal-smartled/ && cargo +esp check --features=esp32s2
run: cd esp-hal-smartled/ && cargo +esp check --features=esp32s2 --target=xtensa-esp32s2-none-elf -Zbuild-std=core
- name: check (esp32s3)
run: cd esp-hal-smartled/ && cargo +esp check --features=esp32s3
run: cd esp-hal-smartled/ && cargo +esp check --features=esp32s3 --target=xtensa-esp32s3-none-elf -Zbuild-std=core
# Ensure documentation can be built (requires a chip feature!)
- name: rustdoc
run: cd esp-hal-smartled/ && cargo doc --features=esp32c3
run: cd esp-hal-smartled/ && cargo doc --features=esp32c3,esp-hal-common/eh1 --target=riscv32imc-unknown-none-elf

esp32-hal:
runs-on: ubuntu-latest
Expand All @@ -73,6 +73,8 @@ jobs:
ldproxy: false
- uses: Swatinem/rust-cache@v2

- name: check esp32-hal
run: cd esp32-hal/ && cargo check
# Perform a full build initially to verify that the examples not only
# build, but also link successfully.
- name: build esp32-hal (no features)
Expand All @@ -93,7 +95,7 @@ jobs:
run: cd esp32-hal/ && cargo check --example=embassy_i2c --features=embassy,embassy-time-timg0,async
# Ensure documentation can be built
- name: rustdoc
run: cd esp32-hal/ && cargo doc
run: cd esp32-hal/ && cargo doc --features=eh1

esp32c2-hal:
runs-on: ubuntu-latest
Expand All @@ -107,6 +109,8 @@ jobs:
components: rust-src
- uses: Swatinem/rust-cache@v2

- name: check esp32c62hal
run: cd esp32c2-hal/ && cargo +nightly check
# Perform a full build initially to verify that the examples not only
# build, but also link successfully.
# We also use this as an opportunity to verify that the examples link
Expand All @@ -132,10 +136,10 @@ jobs:
- name: check esp32c2-hal (async, i2c)
run: cd esp32c2-hal/ && cargo +nightly check --example=embassy_i2c --features=embassy,embassy-time-systick,async
- name: check esp32c2-hal (interrupt-preemption)
run: cd esp32c2-hal/ && cargo check --example=interrupt_preemption --features=interrupt-preemption
run: cd esp32c2-hal/ && cargo +nightly check --example=interrupt_preemption --features=interrupt-preemption
# Ensure documentation can be built
- name: rustdoc
run: cd esp32c2-hal/ && cargo doc
run: cd esp32c2-hal/ && cargo doc --features=eh1

esp32c3-hal:
runs-on: ubuntu-latest
Expand All @@ -149,6 +153,8 @@ jobs:
components: rust-src
- uses: Swatinem/rust-cache@v2

- name: check esp32c3-hal
run: cd esp32c3-hal/ && cargo +nightly check
# Perform a full build initially to verify that the examples not only
# build, but also link successfully.
# We also use this as an opportunity to verify that the examples link
Expand Down Expand Up @@ -176,10 +182,10 @@ jobs:
- name: check esp32c3-hal (async, i2c)
run: cd esp32c3-hal/ && cargo +nightly check --example=embassy_i2c --features=embassy,embassy-time-systick,async
- name: check esp32c3-hal (interrupt-preemption)
run: cd esp32c3-hal/ && cargo check --example=interrupt_preemption --features=interrupt-preemption
run: cd esp32c3-hal/ && cargo +nightly check --example=interrupt_preemption --features=interrupt-preemption
# Ensure documentation can be built
- name: rustdoc
run: cd esp32c3-hal/ && cargo doc
run: cd esp32c3-hal/ && cargo doc --features=eh1

esp32c6-hal:
runs-on: ubuntu-latest
Expand All @@ -193,6 +199,8 @@ jobs:
components: rust-src
- uses: Swatinem/rust-cache@v2

- name: check esp32c6-hal
run: cd esp32c6-hal/ && cargo +nightly check
# Perform a full build initially to verify that the examples not only
# build, but also link successfully.
# We also use this as an opportunity to verify that the examples link
Expand All @@ -218,10 +226,10 @@ jobs:
- name: check esp32c6-hal (async, i2c)
run: cd esp32c6-hal/ && cargo +nightly check --example=embassy_i2c --features=embassy,embassy-time-systick,async
- name: check esp32c6-hal (interrupt-preemption)
run: cd esp32c6-hal/ && cargo check --example=interrupt_preemption --features=interrupt-preemption
run: cd esp32c6-hal/ && cargo +nightly check --example=interrupt_preemption --features=interrupt-preemption
# Ensure documentation can be built
- name: rustdoc
run: cd esp32c6-hal/ && cargo doc
run: cd esp32c6-hal/ && cargo doc --features=eh1

esp32h2-hal:
runs-on: ubuntu-latest
Expand All @@ -235,6 +243,8 @@ jobs:
components: rust-src
- uses: Swatinem/rust-cache@v2

- name: check esp32h2-hal
run: cd esp32h2-hal/ && cargo +nightly check
# Perform a full build initially to verify that the examples not only
# build, but also link successfully.
# We also use this as an opportunity to verify that the examples link
Expand All @@ -260,10 +270,10 @@ jobs:
- name: check esp32h2-hal (async, i2c)
run: cd esp32h2-hal/ && cargo +nightly check --example=embassy_i2c --features=embassy,embassy-time-systick,async
- name: check esp32h2-hal (interrupt-preemption)
run: cd esp32h2-hal/ && cargo check --example=interrupt_preemption --features=interrupt-preemption
run: cd esp32h2-hal/ && cargo +nightly check --example=interrupt_preemption --features=interrupt-preemption
# Ensure documentation can be built
- name: rustdoc
run: cd esp32h2-hal/ && cargo doc
run: cd esp32h2-hal/ && cargo doc --features=eh1

esp32s2-hal:
runs-on: ubuntu-latest
Expand All @@ -277,6 +287,8 @@ jobs:
ldproxy: false
- uses: Swatinem/rust-cache@v2

- name: check esp32s2-hal
run: cd esp32s2-hal/ && cargo check
# Perform a full build initially to verify that the examples not only
# build, but also link successfully.
- name: check esp32s2-hal (no features)
Expand All @@ -300,7 +312,7 @@ jobs:
run: cd esp32s2-hal/ && cargo check --example=embassy_i2c --features=embassy,embassy-time-timg0,async
# Ensure documentation can be built
- name: rustdoc
run: cd esp32s2-hal/ && cargo doc
run: cd esp32s2-hal/ && cargo doc --features=eh1

esp32s3-hal:
runs-on: ubuntu-latest
Expand All @@ -314,6 +326,8 @@ jobs:
ldproxy: false
- uses: Swatinem/rust-cache@v2

- name: check esp32s3-hal
run: cd esp32s3-hal/ && cargo check
# Perform a full build initially to verify that the examples not only
# build, but also link successfully.
# We also use this as an opportunity to verify that the examples link
Expand Down Expand Up @@ -342,7 +356,7 @@ jobs:
run: cd esp32s3-hal/ && cargo check --example=octal_psram --features=opsram_2m --release # This example requires release!
# Ensure documentation can be built
- name: rustdoc
run: cd esp32s3-hal/ && cargo doc
run: cd esp32s3-hal/ && cargo doc --features=eh1

esp-riscv-rt:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -417,21 +431,21 @@ jobs:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
components: clippy
toolchain: nightly
components: clippy, rust-src
- uses: Swatinem/rust-cache@v2

# Run clippy on all packages targeting RISC-V.
- name: clippy (esp-riscv-rt)
run: cargo +stable clippy --manifest-path=esp-riscv-rt/Cargo.toml -- --no-deps
run: cd esp-riscv-rt/ && cargo +nightly clippy -- --no-deps
Copy link
Member

Choose a reason for hiding this comment

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

Why are these tested on nightly now? AFAIK we don't use any nightly features inside esp-riscv-rt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This might have been a consistency/copy-paste thingy. I don't quite remember which one, but either way using a single toolchain looks better and using nightly means usually more lints.

- name: clippy (esp32c2-hal)
run: cargo +stable clippy --manifest-path=esp32c2-hal/Cargo.toml -- --no-deps
run: cd esp32c2-hal/ && cargo +nightly clippy -- --no-deps
- name: clippy (esp32c3-hal)
run: cargo +stable clippy --manifest-path=esp32c3-hal/Cargo.toml -- --no-deps
run: cd esp32c3-hal/ && cargo +nightly clippy -- --no-deps
- name: clippy (esp32c6-hal)
run: cargo +stable clippy --manifest-path=esp32c6-hal/Cargo.toml -- --no-deps
run: cd esp32c6-hal/ && cargo +nightly clippy -- --no-deps
- name: clippy (esp32h2-hal)
run: cargo +stable clippy --manifest-path=esp32h2-hal/Cargo.toml -- --no-deps
run: cd esp32h2-hal/ && cargo +nightly clippy -- --no-deps

clippy-xtensa:
runs-on: ubuntu-latest
Expand All @@ -448,11 +462,11 @@ jobs:
# The ESP32-S2 requires some additional information in order for the
# atomic emulation crate to build.
- name: clippy (esp32-hal)
run: cargo +esp clippy --manifest-path=esp32-hal/Cargo.toml -- --no-deps
run: cd esp32-hal/ && cargo +esp clippy -- --no-deps
- name: clippy (esp32s2-hal)
run: cargo +esp clippy --manifest-path=esp32s2-hal/Cargo.toml -- --no-deps
run: cd esp32s2-hal/ && cargo +esp clippy -- --no-deps
- name: clippy (esp32s3-hal)
run: cargo +esp clippy --manifest-path=esp32s3-hal/Cargo.toml -- --no-deps
run: cd esp32s3-hal/ && cargo +esp clippy -- --no-deps

rustfmt:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Update `embedded-hal-*` alpha packages to their latest versions (#640)
- Implement the `Clone` and `Copy` traits for the `Rng` driver (#650)
- Implement the `Clone` and `Copy` traits for the `Rng` driver (#650, #666)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

nobody noticed that this is in the wrong line :)


### Fixed

Expand Down
1 change: 1 addition & 0 deletions esp-hal-common/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ fn gen_efuse_table(device_name: &str, out_dir: impl AsRef<Path>) {
fields.next().map(|s| s.trim()),
) {
(Some(name), Some(block), Some(bit_off), Some(bit_len), Some(desc)) => {
let desc = desc.replace('[', "`[").replace(']', "]`");
writeln!(writer, "/// {desc}").unwrap();
writeln!(
writer,
Expand Down
12 changes: 6 additions & 6 deletions esp-hal-common/src/analog/adc/cal_curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ pub trait AdcHasCurveCal {
/// This scheme implements final polynomial error correction using predefined
/// coefficient sets for each attenuation.
///
/// This scheme also includes basic calibration ([`AdcCalBasic`]) and line
/// fitting ([`AdcCalLine`]).
/// This scheme also includes basic calibration ([`super::AdcCalBasic`]) and
/// line fitting ([`AdcCalLine`]).
#[derive(Clone, Copy)]
pub struct AdcCalCurve<ADCI> {
line: AdcCalLine<ADCI>,
Expand Down Expand Up @@ -131,7 +131,7 @@ mod impls {
}

coeff_tables! {
/// Error curve coefficients derived from https://github.com/espressif/esp-idf/blob/903af13e8/components/esp_adc/esp32c3/curve_fitting_coefficients.c
/// Error curve coefficients derived from <https://github.com/espressif/esp-idf/blob/903af13e8/components/esp_adc/esp32c3/curve_fitting_coefficients.c>
#[cfg(esp32c3)]
CURVES_COEFFS1 [
Attenuation0dB => [
Expand All @@ -158,7 +158,7 @@ mod impls {
],
];

/// Error curve coefficients derived from https://github.com/espressif/esp-idf/blob/903af13e8/components/esp_adc/esp32c6/curve_fitting_coefficients.c
/// Error curve coefficients derived from <https://github.com/espressif/esp-idf/blob/903af13e8/components/esp_adc/esp32c6/curve_fitting_coefficients.c>
#[cfg(esp32c6)]
CURVES_COEFFS1 [
Attenuation0dB => [
Expand All @@ -183,7 +183,7 @@ mod impls {
],
];

/// Error curve coefficients derived from https://github.com/espressif/esp-idf/blob/903af13e8/components/esp_adc/esp32s3/curve_fitting_coefficients.c
/// Error curve coefficients derived from <https://github.com/espressif/esp-idf/blob/903af13e8/components/esp_adc/esp32s3/curve_fitting_coefficients.c>
#[cfg(esp32s3)]
CURVES_COEFFS1 [
Attenuation0dB => [
Expand All @@ -210,7 +210,7 @@ mod impls {
],
];

/// Error curve coefficients derived from https://github.com/espressif/esp-idf/blob/903af13e8/components/esp_adc/esp32s3/curve_fitting_coefficients.c
/// Error curve coefficients derived from <https://github.com/espressif/esp-idf/blob/903af13e8/components/esp_adc/esp32s3/curve_fitting_coefficients.c>
#[cfg(esp32s3)]
CURVES_COEFFS2 [
Attenuation0dB => [
Expand Down
1 change: 0 additions & 1 deletion esp-hal-common/src/analog/adc/xtensa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ pub mod implementation {

use embedded_hal::adc::Channel;

use super::impl_adc_interface;
pub use crate::analog::{adc::*, ADC1, ADC2};
use crate::gpio::*;

Expand Down
Loading