Commit bb24706a authored by DevDoggo's avatar DevDoggo

Done

parent 141f9791
......@@ -7,4 +7,5 @@
#cargo build --target thumbv7em-none-eabihf --release --example bare2
#cargo build --target thumbv7em-none-eabihf --example bare3
#cargo build --target thumbv7em-none-eabihf --example bare4
cargo build --target thumbv7em-none-eabihf --example bare5
#cargo build --target thumbv7em-none-eabihf --example bare5
cargo build --target thumbv7em-none-eabihf --example bare6
......@@ -6,6 +6,7 @@
extern crate f4;
extern crate stm32f40x;
extern crate cortex_m;
#[macro_use]
extern crate cortex_m_debug;
......@@ -76,7 +77,11 @@ fn idle(dwt: &mut DWT, rcc: &mut RCC, gpioa: &mut GPIOA) {
// at 16 Mhz, 8000_0000 cycles = 0.5s
// at 64 Mhz, 8000_0000 cycles = 0.125s
unsafe {
(*DWT.get()).cyccnt.write(0);
}
loop {
ipln!("led on");
// set PA5 high, RM0368 8.4.7
gpioa.bsrr.write(|w| w.bs5().set_bit());
......@@ -100,6 +105,10 @@ fn idle(dwt: &mut DWT, rcc: &mut RCC, gpioa: &mut GPIOA) {
// vscode using the new "cortex debug" plugin
//
// what is the frequency of blinking
//
// >> Given that at 16Mhz, 8000_000 cycles = 0.5s,
// and we need to go 2*8000_000 cycles for the next light on,
// we're about ~1Hz on the blinking, just slightly above.
// ** your answer here **
//
// commit your answers (bare6_1)
......
......@@ -8,4 +8,4 @@ TARGET=thumbv7em-none-eabihf
#arm-none-eabi-gdb target/$TARGET/release/examples/bare2
#arm-none-eabi-gdb target/$TARGET/debug/examples/bare3
#arm-none-eabi-gdb target/$TARGET/debug/examples/bare4
arm-none-eabi-gdb target/$TARGET/debug/examples/bare5
arm-none-eabi-gdb target/$TARGET/debug/examples/bare6
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment