diff options
| author | Karun <[email protected]> | 2024-04-03 14:01:40 -0400 |
|---|---|---|
| committer | Karun <[email protected]> | 2024-04-03 14:01:40 -0400 |
| commit | 630fd90d26207521d39f1bf76d1f19b862e4393d (patch) | |
| tree | 4994bceb7e87d88441c9a968605ed56174f4a633 | |
| parent | a031b3b79ec5ebf8f0ec1f7df605944acf7d5720 (diff) | |
Address PR comments
| -rw-r--r-- | embassy-stm32/src/ospi/mod.rs | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/embassy-stm32/src/ospi/mod.rs b/embassy-stm32/src/ospi/mod.rs index 84d1ac284..59c73c24d 100644 --- a/embassy-stm32/src/ospi/mod.rs +++ b/embassy-stm32/src/ospi/mod.rs | |||
| @@ -889,7 +889,7 @@ impl<'d, T: Instance, Dma> Ospi<'d, T, Dma> { | |||
| 889 | } | 889 | } |
| 890 | 890 | ||
| 891 | /// Set new bus configuration | 891 | /// Set new bus configuration |
| 892 | pub fn set_config(&mut self, config: &Config) -> Result<(), ()> { | 892 | pub fn set_config(&mut self, config: &Config) { |
| 893 | // Wait for busy flag to clear | 893 | // Wait for busy flag to clear |
| 894 | while T::REGS.sr().read().busy() {} | 894 | while T::REGS.sr().read().busy() {} |
| 895 | 895 | ||
| @@ -960,7 +960,6 @@ impl<'d, T: Instance, Dma> Ospi<'d, T, Dma> { | |||
| 960 | } | 960 | } |
| 961 | 961 | ||
| 962 | self.config = *config; | 962 | self.config = *config; |
| 963 | Ok(()) | ||
| 964 | } | 963 | } |
| 965 | 964 | ||
| 966 | /// Get current configuration | 965 | /// Get current configuration |
| @@ -1012,7 +1011,7 @@ pub(crate) trait SealedInstance { | |||
| 1012 | } | 1011 | } |
| 1013 | 1012 | ||
| 1014 | trait SealedWord { | 1013 | trait SealedWord { |
| 1015 | const CONFIG: word_impl::Config; | 1014 | const CONFIG: u8; |
| 1016 | } | 1015 | } |
| 1017 | 1016 | ||
| 1018 | /// OSPI instance trait. | 1017 | /// OSPI instance trait. |
| @@ -1047,7 +1046,8 @@ impl<'d, T: Instance, Dma> SetConfig for Ospi<'d, T, Dma> { | |||
| 1047 | type Config = Config; | 1046 | type Config = Config; |
| 1048 | type ConfigError = (); | 1047 | type ConfigError = (); |
| 1049 | fn set_config(&mut self, config: &Self::Config) -> Result<(), ()> { | 1048 | fn set_config(&mut self, config: &Self::Config) -> Result<(), ()> { |
| 1050 | self.set_config(config) | 1049 | self.set_config(config); |
| 1050 | Ok(()) | ||
| 1051 | } | 1051 | } |
| 1052 | } | 1052 | } |
| 1053 | 1053 | ||
| @@ -1065,18 +1065,12 @@ pub trait Word: word::Word + SealedWord {} | |||
| 1065 | macro_rules! impl_word { | 1065 | macro_rules! impl_word { |
| 1066 | ($T:ty, $config:expr) => { | 1066 | ($T:ty, $config:expr) => { |
| 1067 | impl SealedWord for $T { | 1067 | impl SealedWord for $T { |
| 1068 | const CONFIG: Config = $config; | 1068 | const CONFIG: u8 = $config; |
| 1069 | } | 1069 | } |
| 1070 | impl Word for $T {} | 1070 | impl Word for $T {} |
| 1071 | }; | 1071 | }; |
| 1072 | } | 1072 | } |
| 1073 | 1073 | ||
| 1074 | mod word_impl { | 1074 | impl_word!(u8, 8); |
| 1075 | use super::*; | 1075 | impl_word!(u16, 16); |
| 1076 | 1076 | impl_word!(u32, 32); | |
| 1077 | pub type Config = u8; | ||
| 1078 | |||
| 1079 | impl_word!(u8, 8); | ||
| 1080 | impl_word!(u16, 16); | ||
| 1081 | impl_word!(u32, 32); | ||
| 1082 | } | ||
