Skip to content

Commit

Permalink
fix: bug in smoltcp current_time, convert nanos to micros
Browse files Browse the repository at this point in the history
  • Loading branch information
hky1999 committed Jul 15, 2024
1 parent 97a6825 commit 79f85ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/axnet/src/smoltcp_impl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use core::cell::RefCell;
use core::ops::DerefMut;

use axdriver::prelude::*;
use axhal::time::wall_time_nanos;
use axhal::time::{wall_time_nanos, NANOS_PER_MICROS};
use axsync::Mutex;
use driver_net::{DevError, NetBufPtr};
use lazy_init::LazyInit;
Expand Down Expand Up @@ -145,7 +145,7 @@ impl InterfaceWrapper {
}

fn current_time() -> Instant {
Instant::from_micros_const(wall_time_nanos() as i64)
Instant::from_micros_const((wall_time_nanos() / NANOS_PER_MICROS) as i64)
}

pub fn name(&self) -> &str {
Expand Down

0 comments on commit 79f85ce

Please sign in to comment.