Skip to content

Commit

Permalink
Update example dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoernQ committed Dec 4, 2023
1 parent 7074555 commit b68aaf5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 33 deletions.
1 change: 1 addition & 0 deletions bleps-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ pub fn gatt(input: TokenStream) -> TokenStream {

let backing_data = format_ident!("_attr_data{}", current_handle);
pre.push(quote!(
#[allow(non_upper_case_globals)]
static mut #backing_data: [u8; 2] = [0u8; 2];

let mut #rfunction = |offset: usize, data: &mut [u8]| {
Expand Down
10 changes: 5 additions & 5 deletions esp32s3-serial-hci/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ license = "MIT OR Apache-2.0"
opt-level = 3

[dependencies]
esp32s3-hal = "0.9.0"
esp-backtrace = { version = "0.7.0", features = ["esp32s3", "panic-handler", "print-uart"] }
esp-println = { version = "0.5.0", features = [ "esp32s3", "log" ] }
esp-wifi = { git = "https://github.com/esp-rs/esp-wifi", rev = "dad30df82aabc76e81c341845f260d5049e0f304", features = ["esp32s3", "ble"] }
embedded-io-blocking = { package = "embedded-io", version = "0.5.0" }
esp32s3-hal = "0.13.0"
esp-backtrace = { version = "0.9.0", features = ["esp32s3", "panic-handler", "print-uart"] }
esp-println = { version = "0.7.1", features = [ "esp32s3", "log" ] }
esp-wifi = { version = "0.1.1", features = ["esp32s3", "ble"] }
embedded-io-blocking = { package = "embedded-io", version = "0.6.1" }
log = "0.4.17"
35 changes: 9 additions & 26 deletions esp32s3-serial-hci/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use esp32s3_hal::{
peripherals::Peripherals,
prelude::*,
timer::TimerGroup,
Rng, Rtc, Uart,
Rng, Uart,
};
use esp_backtrace as _;
use esp_println::logger::init_logger;
Expand All @@ -22,48 +22,31 @@ fn main() -> ! {
init_logger(log::LevelFilter::Off);

let peripherals = Peripherals::take();
let mut system = peripherals.SYSTEM.split();
let system = peripherals.SYSTEM.split();
let clocks = ClockControl::configure(system.clock_control, CpuClock::Clock240MHz).freeze();

// Disable the RTC and TIMG watchdog timers
let mut rtc = Rtc::new(peripherals.RTC_CNTL);
let timer_group0 = TimerGroup::new(
peripherals.TIMG0,
&clocks,
&mut system.peripheral_clock_control,
);
let mut wdt0 = timer_group0.wdt;
let timer_group1 = TimerGroup::new(
peripherals.TIMG1,
&clocks,
&mut system.peripheral_clock_control,
);
let mut wdt1 = timer_group1.wdt;

rtc.rwdt.disable();
wdt0.disable();
wdt1.disable();
let timer_group1 = TimerGroup::new(peripherals.TIMG1, &clocks);

let bt = peripherals.RADIO.split().1;
esp_wifi::initialize(
let init = esp_wifi::initialize(
esp_wifi::EspWifiInitFor::Ble,
timer_group1.timer0,
Rng::new(peripherals.RNG),
system.radio_clock_control,
&clocks,
)
.unwrap();

let mut connector = BleConnector::new(bt);
let mut connector = BleConnector::new(&init, peripherals.BT);

let mut serial = Uart::new(peripherals.UART0, &mut system.peripheral_clock_control);
let mut serial = Uart::new(peripherals.UART0, &clocks);

serial.write(0xff).unwrap();
esp32s3_hal::prelude::_embedded_hal_serial_Write::write(&mut serial, 0xff).unwrap();

let mut buffer = [0u8; 256];
loop {
let mut cnt = CNT;
loop {
let b = serial.read();
let b = esp32s3_hal::prelude::_embedded_hal_serial_Read::read(&mut serial);
match b {
Ok(b) => {
connector.write(&[b]).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ edition = "2021"
[dependencies]
serialport = "4.2.0"
critical-section = "1.1.1"
embedded-io-adapters = { version = "0.5.0", features = ["std"] }
embedded-io-blocking = { package = "embedded-io", version = "0.5.0" }
embedded-io-adapters = { version = "0.6.1", features = ["std"] }
embedded-io-blocking = { package = "embedded-io", version = "0.6.1" }
bleps = { path = "../bleps", features = ["macros"] }
env_logger = "0.10.0"
crossterm = "0.25.0"

0 comments on commit b68aaf5

Please sign in to comment.