Small changes to work with more Blue Pills

master
Levi Pearson 2020-07-09 15:29:45 -06:00
parent 2a1a5d66df
commit 2796c15208
2 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,8 @@
# Sample OpenOCD configuration for the blue pill board
# Some microcontrollers have a different CPU ID; uncomment this if yours is one
set CPUTAPID 0x2ba01477
# Depending on the hardware revision you got you'll have to pick ONE of these
# interfaces. At any time only one interface should be commented out.

View File

@ -118,6 +118,10 @@ fn main() -> ! {
let scl = gpiob.pb10.into_alternate_open_drain(&mut gpiob.crh);
let sda = gpiob.pb11.into_alternate_open_drain(&mut gpiob.crh);
// Very brief delay before starting up i2c; otherwise the startup process
// could hang.
delay.delay_us(10_u8);
// Configure the I2C peripheral itself
let i2c = BlockingI2c::i2c2(
dev_periph.I2C2,
@ -166,9 +170,6 @@ fn main() -> ! {
// Turn the LED on via the OutputPin trait
led.on().unwrap();
// Very brief delay before the loop, just to show how
delay.delay_us(10_u8);
let mut button_last = false;
// Microcontroller programs never exit main, so we must loop!
loop {