Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ZR233 committed Jan 7, 2025
1 parent 508e6ec commit bb63598
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions examples/mqttclient/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ fn client() -> io::Result<()> {

stream.write_all(&connect_bytes).unwrap();

println!("connect send ok");

let mut socket = Socket(stream);

let res = Packet::read_from(&mut socket).expect("read connack fail");
Expand All @@ -73,12 +75,6 @@ fn client() -> io::Result<()> {
let mut buf = [0; MAX_CMD_LEN];
let mut cursor = 0;

// spawn(|| loop {
// sleep(Duration::from_secs(5));

// println!("tick");
// });

loop {
if stdin.read(&mut buf[cursor..cursor + 1]).ok() != Some(1) {
continue;
Expand Down Expand Up @@ -122,6 +118,6 @@ fn client() -> io::Result<()> {

#[cfg_attr(feature = "axstd", no_mangle)]
fn main() {
println!("Hello, simple http client!");
println!("Hello, simple mqtt client!");
client().expect("test http client failed");
}
2 changes: 1 addition & 1 deletion modules/axtask/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ pub fn exit(exit_code: i32) -> ! {
pub fn run_idle() -> ! {
loop {
yield_now();
debug!("idle task: waiting for IRQs...");
// debug!("idle task: waiting for IRQs...");
#[cfg(feature = "irq")]
axhal::arch::wait_for_irqs();
}
Expand Down

0 comments on commit bb63598

Please sign in to comment.