Skip to content

Commit

Permalink
more cfg gating
Browse files Browse the repository at this point in the history
  • Loading branch information
Anatol Ulrich committed Dec 19, 2024
1 parent d91b8c6 commit 7743c8f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions embassy-stm32/src/spi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,15 @@ impl<'d, M: PeriMode> Spi<'d, M> {

let br = compute_baud_rate(self.kernel_clock, config.frequency);

self.rise_fall_speed = config.rise_fall_speed;
if let Some(sck) = self.sck.as_ref() {
sck.set_speed(config.rise_fall_speed);
}
if let Some(mosi) = self.mosi.as_ref() {
mosi.set_speed(config.rise_fall_speed);
#[cfg(gpio_v2)]
{
self.rise_fall_speed = config.rise_fall_speed;
if let Some(sck) = self.sck.as_ref() {
sck.set_speed(config.rise_fall_speed);
}
if let Some(mosi) = self.mosi.as_ref() {
mosi.set_speed(config.rise_fall_speed);
}
}

#[cfg(any(spi_v1, spi_f1, spi_v2))]
Expand Down

0 comments on commit 7743c8f

Please sign in to comment.