Small changes to work with more Blue Pills
parent
2a1a5d66df
commit
2796c15208
|
@ -1,5 +1,8 @@
|
||||||
# Sample OpenOCD configuration for the blue pill board
|
# 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
|
# 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.
|
# interfaces. At any time only one interface should be commented out.
|
||||||
|
|
||||||
|
|
|
@ -118,6 +118,10 @@ fn main() -> ! {
|
||||||
let scl = gpiob.pb10.into_alternate_open_drain(&mut gpiob.crh);
|
let scl = gpiob.pb10.into_alternate_open_drain(&mut gpiob.crh);
|
||||||
let sda = gpiob.pb11.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
|
// Configure the I2C peripheral itself
|
||||||
let i2c = BlockingI2c::i2c2(
|
let i2c = BlockingI2c::i2c2(
|
||||||
dev_periph.I2C2,
|
dev_periph.I2C2,
|
||||||
|
@ -166,9 +170,6 @@ fn main() -> ! {
|
||||||
// Turn the LED on via the OutputPin trait
|
// Turn the LED on via the OutputPin trait
|
||||||
led.on().unwrap();
|
led.on().unwrap();
|
||||||
|
|
||||||
// Very brief delay before the loop, just to show how
|
|
||||||
delay.delay_us(10_u8);
|
|
||||||
|
|
||||||
let mut button_last = false;
|
let mut button_last = false;
|
||||||
// Microcontroller programs never exit main, so we must loop!
|
// Microcontroller programs never exit main, so we must loop!
|
||||||
loop {
|
loop {
|
||||||
|
|
Loading…
Reference in New Issue