final working

This commit is contained in:
Priec
2026-05-23 00:14:01 +02:00
parent 92d69e875a
commit 6334c95e05
2 changed files with 5 additions and 5 deletions

View File

@@ -12,7 +12,7 @@ use embassy_sync::channel::Channel;
use embassy_time::Duration; use embassy_time::Duration;
use semestralka2::receive::bit_receive_and_decode; use semestralka2::receive::bit_receive_and_decode;
use semestralka2::send::Tx; use semestralka2::send::Tx;
use semestralka2::send::{bit_send, nrz}; use semestralka2::send::{bit_send, msg_encode};
use {defmt_rtt as _, panic_probe as _}; use {defmt_rtt as _, panic_probe as _};
@@ -37,11 +37,11 @@ async fn main(spawner: Spawner) {
info!("starting loop"); info!("starting loop");
loop { loop {
nrz(b"ahoj", &sender).await; msg_encode(b"ahoj", &sender).await;
nrz(b"hello", &sender).await; msg_encode(b"hello", &sender).await;
let data = [0x01, 0x02, 0x03, 0x04]; let data = [0x01, 0x02, 0x03, 0x04];
nrz(&data, &sender).await; msg_encode(&data, &sender).await;
info!("frame sent"); info!("frame sent");
embassy_time::Timer::after(Duration::from_secs(1)).await; embassy_time::Timer::after(Duration::from_secs(1)).await;

View File

@@ -22,7 +22,7 @@ async fn send_byte(byte: u8, tx: &Tx) {
} }
/// [START] [LEN] [PAYLOAD ...] [CRC] [P] [STOP] /// [START] [LEN] [PAYLOAD ...] [CRC] [P] [STOP]
pub async fn nrz(payload: &[u8], tx: &Tx) { pub async fn msg_encode(payload: &[u8], tx: &Tx) {
// start // start
send_byte(START, tx).await; send_byte(START, tx).await;