Skip to content

Commit

Permalink
ESP32-C6 BLE Support (#262)
Browse files Browse the repository at this point in the history
* ESP32-C6 BLE Support

* Reformat
  • Loading branch information
bjoernQ authored Sep 7, 2023
1 parent 03fd19a commit e7140fd
Show file tree
Hide file tree
Showing 28 changed files with 4,591 additions and 20,709 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,12 @@ jobs:
run: cd examples-${{ matrix.chip }} && cargo +nightly-2023-05-16 build --release --example=embassy_access_point --features=async,wifi,embassy-net

- name: check (common features + ble)
if: ${{ matrix.chip == 'esp32c2' || matrix.chip == 'esp32c3' }}
run: cd examples-${{ matrix.chip }} && cargo +nightly-2023-05-16 check --features=async,wifi,ble,esp-now,embassy-net,log
- name: check (common features + ble + defmt)
if: ${{ matrix.chip == 'esp32c2' || matrix.chip == 'esp32c3' }}
run: cd examples-${{ matrix.chip }} && cargo +nightly-2023-05-16 check --no-default-features --features=${{ matrix.chip }},async,wifi,ble,esp-now,embassy-net,defmt
- name: check (ble)
if: ${{ matrix.chip == 'esp32c2' || matrix.chip == 'esp32c3' }}
run: cd examples-${{ matrix.chip }} && cargo +nightly-2023-05-16 build --release --example=ble --features=ble
- name: check (async_ble)
if: ${{ matrix.chip == 'esp32c2' || matrix.chip == 'esp32c3' }}
run: cd examples-${{ matrix.chip }} && cargo +nightly-2023-05-16 build --release --example=async_ble --features=async,ble
- name: check (coex)
if: ${{ matrix.chip == 'esp32c3' }}
Expand Down
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,8 @@ futures-util = { version = "0.3.28", default-features = false }
esp-println = { version = "0.6.0" }
esp-backtrace = { version = "0.8.0", features = ["panic-handler", "exception-handler", "print-uart"] }
embedded-hal-async = { version = "1.0.0-rc.1" }

# patching esp32c6-hal for BLE - it would compile with 0.5.0 but not work
[patch.crates-io]
esp32c6-hal = { git = "https://github.com/esp-rs/esp-hal.git", rev = "4c34ebe9e264fcc31fabba862274adae8daa680a" }
esp-hal-common = { git = "https://github.com/esp-rs/esp-hal.git", rev = "4c34ebe9e264fcc31fabba862274adae8daa680a" }
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If a cell contains am em dash (—) this means that the particular feature i
| ESP32-S3 |||||
| ESP32-C3 |||||
| ESP32-C2 ||| ||
| ESP32-C6 || | ||
| ESP32-C6 || | ||


## Usage
Expand Down
2 changes: 2 additions & 0 deletions esp-wifi-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ fn copy_libraries(out: &PathBuf) -> Result<()> {

#[cfg(feature = "esp32c6")]
fn copy_libraries(out: &PathBuf) -> Result<()> {
copy_file(out, "libs/esp32c6/libble_app.a", "libble_app.a")?;
copy_file(out, "libs/esp32c6/libbtbb.a", "libbtbb.a")?;
copy_file(out, "libs/esp32c6/libcoexist.a", "libcoexist.a")?;
copy_file(out, "libs/esp32c6/libcore.a", "libcore.a")?;
Expand All @@ -180,6 +181,7 @@ fn copy_libraries(out: &PathBuf) -> Result<()> {
"libwpa_supplicant.a",
)?;

println!("cargo:rustc-link-lib={}", "ble_app");
println!("cargo:rustc-link-lib={}", "btbb");
println!("cargo:rustc-link-lib={}", "coexist");
println!("cargo:rustc-link-lib={}", "core");
Expand Down
2 changes: 1 addition & 1 deletion esp-wifi-sys/include/include.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "phy.h"
#include "esp_timer.h"

#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C6)
#if !defined(CONFIG_IDF_TARGET_ESP32S2)
#include "esp_bt.h"
#include "esp_coexist_internal.h"
#include "esp_coexist_adapter.h"
Expand Down
Binary file modified esp-wifi-sys/libs/esp32c6/libble_app.a
Binary file not shown.
Binary file added esp-wifi-sys/libs/esp32h2/libble_app.a
Binary file not shown.
Loading

0 comments on commit e7140fd

Please sign in to comment.