mirror of
https://github.com/hubaldv/bioz-firmware-rs.git
synced 2025-12-06 05:01:18 +00:00
Basic working impedance.
This commit is contained in:
@@ -22,7 +22,7 @@ use postcard_rpc::{
|
||||
|
||||
use bioz_icd_rs::{PingEndpoint, GetUniqueIdEndpoint, SetGreenLedEndpoint, StartImpedanceEndpoint, StopImpedanceEndpoint, StartImpedance, Impedance, ImpedanceTopic, ENDPOINT_LIST, TOPICS_IN_LIST, TOPICS_OUT_LIST};
|
||||
|
||||
use crate::impedance_test::{ImpedanceTest, IMPEDANCE_TEST};
|
||||
use crate::impedance_test::{ImpedanceTest, IMPEDANCE_TEST, IMPEDANCE_CHANNEL};
|
||||
|
||||
// Postcard RPC types
|
||||
type AppDriver = usb::Driver<'static, peripherals::USB>;
|
||||
@@ -179,13 +179,21 @@ pub async fn start_impedance_handler(context: SpawnCtx, header: VarHeader, rqst:
|
||||
let mut ticker = Ticker::every(Duration::from_hz(rqst.update_frequency.into()));
|
||||
let mut seq: u8 = 0;
|
||||
while !*STOP.lock().await {
|
||||
ticker.next().await;
|
||||
// ticker.next().await;
|
||||
|
||||
impedance.update(rqst.sinus_frequency);
|
||||
// impedance.update(rqst.sinus_frequency);
|
||||
|
||||
|
||||
// let msg = Impedance {
|
||||
// magnitude: impedance.magnitude,
|
||||
// phase: impedance.phase,
|
||||
// };
|
||||
|
||||
let data = IMPEDANCE_CHANNEL.receive().await;
|
||||
|
||||
let msg = Impedance {
|
||||
magnitude: impedance.magnitude,
|
||||
phase: impedance.phase,
|
||||
magnitude: data,
|
||||
phase: data,
|
||||
};
|
||||
|
||||
if sender
|
||||
|
||||
Reference in New Issue
Block a user