Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn main() -> ! {
let sda = gpiob.pb9.into_open_drain_output_in_state(PinState::High);
let scl = gpiob.pb8.into_open_drain_output_in_state(PinState::High);

let mut i2c = dp.I2C.i2c(sda, scl, Config::new(400.kHz()), &mut rcc);
let mut i2c = dp.I2C1.i2c(sda, scl, Config::new(400.kHz()), &mut rcc);

i2c.write(0x2a, &[0x80, 0xff]).unwrap();
i2c.write(0x2a, &[0x01, 0x04, 0x00, 0x00]).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/crc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl Config {
Some(BitReversal::ByWord) => 0b11,
};

crc.init().write(|w| unsafe { w.crc_init().bits(init) });
crc.init().write(|w| unsafe { w.init().bits(init) });
crc.pol().write(|w| unsafe { w.bits(poly) });
crc.cr().write(|w| unsafe {
w.rev_in()
Expand Down Expand Up @@ -160,7 +160,7 @@ impl Crc {
let crc = unsafe { &(*CRC::ptr()) };

crc.init()
.write(|w| unsafe { w.crc_init().bits(initial_value) });
.write(|w| unsafe { w.init().bits(initial_value) });
crc.cr().modify(|_, w| w.reset().set_bit());
}

Expand Down
12 changes: 10 additions & 2 deletions src/serial/usart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@ where
Serial<USART>: hal::serial::Write<u8>,
{
fn write_str(&mut self, s: &str) -> fmt::Result {
let _ = s.as_bytes().iter().map(|c| block!(self.write(*c))).last();
let _ = s
.as_bytes()
.iter()
.map(|c| block!(self.write(*c)))
.next_back();
Ok(())
}
}
Expand All @@ -194,7 +198,11 @@ where
Tx<USART>: hal::serial::Write<u8>,
{
fn write_str(&mut self, s: &str) -> fmt::Result {
let _ = s.as_bytes().iter().map(|c| block!(self.write(*c))).last();
let _ = s
.as_bytes()
.iter()
.map(|c| block!(self.write(*c)))
.next_back();
Ok(())
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/timer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ macro_rules! timers_external_clocks {
}

timers_external_clocks! {
TIM1: (tim1, sms1, ece),
TIM3: (tim3, sms1, ece),
TIM1: (tim1, sms, ece),
TIM3: (tim3, sms, ece),
}

timers! {
Expand Down
2 changes: 1 addition & 1 deletion src/timer/pins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ macro_rules! trigger_pins {
}
};

tim.smcr().modify(|_, w| unsafe { w.ts1().bits(ts) });
tim.smcr().modify(|_, w| unsafe { w.ts().bits(ts) });

Self {
pin,
Expand Down
2 changes: 1 addition & 1 deletion src/timer/qei.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ macro_rules! qei {
tim.ccmr1_output().write(|w| unsafe { w.cc1s().bits(0b01).cc2s().bits(0b01) });

// Encoder mode 2.
tim.smcr().write(|w| unsafe { w.sms1().bits(0b010) });
tim.smcr().write(|w| unsafe { w.sms().bits(0b010) });

// Enable and configure to capture on rising edge
tim.ccer().write(|w| {
Expand Down
Loading