Skip to content

Commit

Permalink
fix logs using latest sys rev
Browse files Browse the repository at this point in the history
  • Loading branch information
MabezDev committed Sep 19, 2024
1 parent 302c46c commit f037e73
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion esp-ieee802154/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ byte = "0.2.7"
critical-section = "1.1.3"
document-features = "0.2.10"
esp-hal = { version = "0.20.0", path = "../esp-hal" }
esp-wifi-sys = { version = "0.5.0", git = "https://github.com/esp-rs/esp-wifi-sys", rev = "0a2f37f" }
esp-wifi-sys = { version = "0.5.0", git = "https://github.com/esp-rs/esp-wifi-sys", rev = "83ee3bd" }
heapless = "0.8.0"
ieee802154 = "0.6.1"
vcell = "0.1.3"
Expand Down
4 changes: 2 additions & 2 deletions esp-ieee802154/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ static TX_DONE_CALLBACK_FN: Mutex<RefCell<Option<fn()>>> = Mutex::new(RefCell::n
static RX_AVAILABLE_CALLBACK_FN: Mutex<RefCell<Option<fn()>>> = Mutex::new(RefCell::new(None));

fn tx_done() {
log::trace!("tx_done callback");
trace!("tx_done callback");

critical_section::with(|cs| {
let mut tx_done_callback = TX_DONE_CALLBACK.borrow_ref_mut(cs);
Expand All @@ -354,7 +354,7 @@ fn tx_done() {
}

fn rx_available() {
log::trace!("rx available callback");
trace!("rx available callback");

critical_section::with(|cs| {
let mut rx_available_callback = RX_AVAILABLE_CALLBACK.borrow_ref_mut(cs);
Expand Down
28 changes: 14 additions & 14 deletions esp-ieee802154/src/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub(crate) fn esp_ieee802154_enable(radio_clock_control: &mut RADIO_CLK) {
ieee802154_mac_init();

unsafe { phy_version_print() }; // libphy.a
log::info!("date={:x}", mac_date());
info!("date={:x}", mac_date());
}

fn esp_phy_enable() {
Expand Down Expand Up @@ -355,34 +355,34 @@ fn next_operation() {

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

let events = get_events();
clear_events(events);

log::trace!("events = {:032b}", events);
trace!("events = {:032b}", events);

if events & Event::RxSfdDone != 0 {
// IEEE802154_STATE_TX && IEEE802154_STATE_TX_CCA && IEEE802154_STATE_TX_ENH_ACK
// for isr processing delay
log::trace!("rx sfd done");
trace!("rx sfd done");
}

if events & Event::TxSfdDone != 0 {
// IEEE802154_STATE_RX for isr processing delay, only 821
// IEEE802154_STATE_TX_ACK for workaround jira ZB-81.
log::trace!("tx sfd done");
trace!("tx sfd done");
}

if events & Event::TxDone != 0 {
log::trace!("tx done");
trace!("tx done");
next_operation();
}

if events & Event::RxDone != 0 {
log::trace!("rx done");
trace!("rx done");
unsafe {
log::trace!("Received raw {:x?}", RX_BUFFER);
trace!("Received raw {:x?}", RX_BUFFER);
critical_section::with(|cs| {
let mut queue = RX_QUEUE.borrow_ref_mut(cs);
if !queue.is_full() {
Expand All @@ -392,11 +392,11 @@ fn ZB_MAC() {
};
queue.enqueue(item).ok();
} else {
log::warn!("Receive queue full");
warn!("Receive queue full");
}

let frm = if RX_BUFFER[0] >= FRAME_SIZE as u8 {
log::warn!("RX_BUFFER[0] {:} is larger than frame size", RX_BUFFER[0]);
warn!("RX_BUFFER[0] {:} is larger than frame size", RX_BUFFER[0]);
&RX_BUFFER[1..][..FRAME_SIZE - 1]
} else {
&RX_BUFFER[1..][..RX_BUFFER[0] as usize]
Expand All @@ -414,21 +414,21 @@ fn ZB_MAC() {
}

if events & Event::AckRxDone != 0 {
log::info!("EventAckRxDone");
info!("EventAckRxDone");
}

if events & Event::AckTxDone != 0 {
log::trace!("EventAckTxDone");
trace!("EventAckTxDone");
next_operation();
}

if events & Event::TxAbort != 0 {
log::trace!("TxAbort");
trace!("TxAbort");
abort_tx();
}

if events & Event::RxAbort != 0 {
log::trace!("RxAbort");
trace!("RxAbort");
abort_rx();
}
}
Expand Down
2 changes: 1 addition & 1 deletion esp-wifi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ heapless = { version = "0.8.0", default-features = false, features = [
num-derive = { version = "0.4.2" }
num-traits = { version = "0.2.19", default-features = false }
no-std-net = { version = "0.6.0", optional = true }
esp-wifi-sys = { version = "0.5.0", git = "https://github.com/esp-rs/esp-wifi-sys", rev = "0a2f37f" }
esp-wifi-sys = { version = "0.5.0", git = "https://github.com/esp-rs/esp-wifi-sys", rev = "83ee3bd" }
embassy-sync = { version = "0.6.0", optional = true }
embassy-futures = { version = "0.1.1", optional = true }
embassy-net-driver = { version = "0.2.0", optional = true }
Expand Down

0 comments on commit f037e73

Please sign in to comment.