Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #24 from 1Kill2Steal/main
Browse files Browse the repository at this point in the history
Migrate esp-hal dependency to version 0.17.0
  • Loading branch information
bjoernQ authored May 3, 2024
2 parents 919e8d8 + 900215a commit a09fcff
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 21 deletions.
15 changes: 8 additions & 7 deletions esp-ieee802154-examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ edition = "2021"
publish = false

[dependencies]
esp-backtrace = { version = "0.11.1", features = ["panic-handler", "exception-handler", "println"] }
esp-ieee802154 = { version = "0.1.0", path = "../esp-ieee802154" }
esp-println = { version = "0.9.1", features = ["log"] }
esp-hal = "0.16.1"
heapless = "0.8.0"
ieee802154 = "0.6.1"
log = "0.4.20"
esp-backtrace = { version = "0.11.1", features = ["panic-handler", "exception-handler", "println"] }
esp-ieee802154 = { version = "0.1.0", path = "../esp-ieee802154" }
esp-println = { version = "0.9.1", features = ["log"] }
esp-hal = "0.17.0"
heapless = "0.8.0"
ieee802154 = "0.6.1"
log = "0.4.20"
embedded-hal-nb = "1.0.0"

[features]
esp32c6 = ["esp-hal/esp32c6", "esp-backtrace/esp32c6", "esp-ieee802154/esp32c6", "esp-println/esp32c6"]
Expand Down
6 changes: 3 additions & 3 deletions esp-ieee802154-examples/examples/send_broadcast_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![no_main]

use esp_backtrace as _;
use esp_hal::{clock::ClockControl, peripherals::Peripherals, prelude::*, Delay};
use esp_hal::{clock::ClockControl, delay::Delay, peripherals::Peripherals, prelude::*};
use esp_ieee802154::*;
use esp_println::println;
use ieee802154::mac::{Header, PanId, ShortAddress};
Expand All @@ -15,7 +15,7 @@ fn main() -> ! {
let mut system = peripherals.SYSTEM.split();
let clocks = ClockControl::max(system.clock_control).freeze();

let mut delay = Delay::new(&clocks);
let delay = Delay::new(&clocks);

println!("Start");

Expand Down Expand Up @@ -57,7 +57,7 @@ fn main() -> ! {
.ok();

println!("Send frame with sequence number {seq_number}");
delay.delay_ms(1000u32);
delay.delay_millis(1000u32);
seq_number = seq_number.wrapping_add(1);
}
}
6 changes: 3 additions & 3 deletions esp-ieee802154-examples/examples/send_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![no_main]

use esp_backtrace as _;
use esp_hal::{clock::ClockControl, peripherals::Peripherals, prelude::*, Delay};
use esp_hal::{clock::ClockControl, delay::Delay, peripherals::Peripherals, prelude::*};
use esp_ieee802154::*;
use esp_println::println;
use ieee802154::mac::{Header, PanId, ShortAddress};
Expand All @@ -15,7 +15,7 @@ fn main() -> ! {
let mut system = peripherals.SYSTEM.split();
let clocks = ClockControl::max(system.clock_control).freeze();

let mut delay = Delay::new(&clocks);
let delay = Delay::new(&clocks);

println!("Start");

Expand Down Expand Up @@ -58,7 +58,7 @@ fn main() -> ! {
.ok();

println!("Send frame with sequence number {seq_number}");
delay.delay_ms(1000u32);
delay.delay_millis(1000u32);
seq_number = seq_number.wrapping_add(1);
}
}
3 changes: 2 additions & 1 deletion esp-ieee802154-examples/examples/sniffer.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#![no_std]
#![no_main]

use embedded_hal_nb::serial::Read;
use esp_backtrace as _;
use esp_hal::{
clock::ClockControl, peripherals::Peripherals, prelude::*, reset::software_reset, Uart,
clock::ClockControl, peripherals::Peripherals, prelude::*, reset::software_reset, uart::Uart,
};
use esp_ieee802154::*;
use esp_println::println;
Expand Down
2 changes: 1 addition & 1 deletion esp-ieee802154/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test = false
[dependencies]
byte = "0.2.6"
critical-section = "1.1.2"
esp-hal = "0.16.1"
esp-hal = "0.17.0"
heapless = "0.8.0"
ieee802154 = "0.6.1"
log = "0.4.20"
Expand Down
14 changes: 8 additions & 6 deletions esp-ieee802154/src/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ use crate::{
pib::*,
};
use esp_hal::{
interrupt::{self, Priority},
peripherals::Interrupt,
prelude::interrupt,
interrupt::Priority,
prelude::handler,
system::{RadioClockControl, RadioClockController, RadioPeripherals},
};

Expand Down Expand Up @@ -143,10 +142,13 @@ fn ieee802154_mac_init() {
// memset(s_rx_frame, 0, sizeof(s_rx_frame));
// s_ieee802154_state = IEEE802154_STATE_IDLE;

interrupt::enable(Interrupt::ZB_MAC, Priority::Priority1).unwrap();
unsafe {
esp_hal::riscv::interrupt::enable();
esp_hal::interrupt::bind_interrupt(
esp_hal::peripherals::Interrupt::ZB_MAC,
ZB_MAC.handler(),
);
}
esp_hal::interrupt::enable(esp_hal::peripherals::Interrupt::ZB_MAC, ZB_MAC.priority()).unwrap();
}

fn ieee802154_set_txrx_pti(txrx_scene: Ieee802154TxRxScene) {
Expand Down Expand Up @@ -343,7 +345,7 @@ fn next_operation() {
}
}

#[interrupt]
#[handler(priority = "Priority::Priority1")]
fn ZB_MAC() {
log::trace!("ZB_MAC interrupt");

Expand Down

0 comments on commit a09fcff

Please sign in to comment.