aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreverdrone <[email protected]>2025-10-23 12:43:58 +0200
committereverdrone <[email protected]>2025-10-23 12:43:58 +0200
commit23833b1716e2de6ac18db23521073e870c13e009 (patch)
treeb86a7b4a6c585849fab518f2d52f7c044bf2ac20
parent86c32c8d7ce6100e7b18413efd3e13932cbd9157 (diff)
add error message and convert to u8
-rw-r--r--embassy-stm32/src/sai/mod.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/embassy-stm32/src/sai/mod.rs b/embassy-stm32/src/sai/mod.rs
index 08aebfb11..58e3b832a 100644
--- a/embassy-stm32/src/sai/mod.rs
+++ b/embassy-stm32/src/sai/mod.rs
@@ -696,7 +696,12 @@ impl<'d, T: Instance, W: word::Word> Sai<'d, T, W> {
696 w.set_fspol(config.frame_sync_polarity.fspol()); 696 w.set_fspol(config.frame_sync_polarity.fspol());
697 w.set_fsdef(config.frame_sync_definition.fsdef()); 697 w.set_fsdef(config.frame_sync_definition.fsdef());
698 w.set_fsall(config.frame_sync_active_level_length.0 as u8 - 1); 698 w.set_fsall(config.frame_sync_active_level_length.0 as u8 - 1);
699 w.set_frl(config.frame_length - 1); 699
700 if config.frame_length > 256 {
701 panic!("Frame length cannot be greater than 256");
702 }
703
704 w.set_frl((config.frame_length - 1) as u8);
700 }); 705 });
701 706
702 ch.slotr().modify(|w| { 707 ch.slotr().modify(|w| {