mirror of
https://github.com/hubaldv/bioz-firmware-rs.git
synced 2025-12-06 05:01:18 +00:00
Created basic sinus output via postcard rpc.
This commit is contained in:
@@ -163,7 +163,7 @@ static STOP: Mutex<ThreadModeRawMutex, bool> = Mutex::new(false);
|
||||
|
||||
#[embassy_executor::task]
|
||||
pub async fn start_impedance_handler(context: SpawnCtx, header: VarHeader, rqst: StartImpedance, sender: Sender<AppTx>) {
|
||||
info!("Start impedance measurement with interval {:?} ms.", rqst.interval_ms);
|
||||
info!("Start impedance measurement with rate {:?} Hz.", rqst.update_frequency);
|
||||
|
||||
let mut impedance = context.impedance.lock().await;
|
||||
|
||||
@@ -176,12 +176,12 @@ pub async fn start_impedance_handler(context: SpawnCtx, header: VarHeader, rqst:
|
||||
return;
|
||||
}
|
||||
|
||||
let mut ticker = Ticker::every(Duration::from_millis(rqst.interval_ms.into()));
|
||||
let mut ticker = Ticker::every(Duration::from_hz(rqst.update_frequency.into()));
|
||||
let mut seq: u8 = 0;
|
||||
while !*STOP.lock().await {
|
||||
ticker.next().await;
|
||||
|
||||
impedance.update();
|
||||
impedance.update(rqst.sinus_frequency);
|
||||
|
||||
let msg = Impedance {
|
||||
magnitude: impedance.magnitude,
|
||||
|
||||
Reference in New Issue
Block a user