Skip to content

Commit

Permalink
Spawn the URC handler
Browse files Browse the repository at this point in the history
  • Loading branch information
lukipuki committed Nov 16, 2024
1 parent f9938d4 commit 16d3ec2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion nrf52840/src/at_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ async fn parse_lines(buf: &[u8], urc_handler: fn(&str, &str) -> bool) {
}
MAIN_CHANNEL.send(to_send).await;
} else {
info!("CALLBACK! {}", line);
URC_CHANNEL.send(Ok(String::from_str(line).unwrap())).await;
}
}
Expand Down
3 changes: 1 addition & 2 deletions nrf52840/src/bg77.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use heapless::{format, String};
pub type BG77Type = Mutex<ThreadModeRawMutex, Option<BG77>>;

static MINIMUM_TIMEOUT: Duration = Duration::from_millis(300);
const CLIENT_ID: u8 = 0;
const CLIENT_ID: u8 = 1;

pub struct BG77 {
uart1: AtUart,
Expand All @@ -32,7 +32,6 @@ fn urc_handler(prefix: &str, rest: &str) -> bool {
"QMTSTAT" => true,
// The CEREG URC is shorter, normal one has 5 values
"CEREG" => rest.split(',').count() == 4,
"QMTPUB" => true,
_ => false,
}
}
Expand Down
3 changes: 2 additions & 1 deletion nrf52840/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use defmt::*;
use embassy_executor::Spawner;
use embassy_sync::mutex::Mutex;
use yaroc_nrf52840::{
bg77::{bg77_main_loop, BG77Type},
bg77::{bg77_main_loop, bg77_urc_handler, BG77Type},
device::Device,
};

Expand All @@ -22,4 +22,5 @@ async fn main(spawner: Spawner) {
}

spawner.must_spawn(bg77_main_loop(&BG77_MUTEX));
spawner.must_spawn(bg77_urc_handler(&BG77_MUTEX));
}

0 comments on commit 16d3ec2

Please sign in to comment.