Clocks and timers

In this section, we'll re-implement the LED roulette application. I'm going to give you back the Led abstraction but this time I'm going to take away the Delay abstraction :-).

Here's the starter code. The delay function is unimplemented so if you run this program the LEDs will blink so fast that they'll appear to always be on.


use aux9::{entry, switch_hal::OutputSwitch, tim6};

fn delay(tim6: &tim6::RegisterBlock, ms: u16) {
    // TODO implement this

fn main() -> ! {
    let (leds, rcc, tim6) = aux9::init();
    let mut leds = leds.into_array();

    // TODO initialize TIM6

    let ms = 50;
    loop {
        for curr in 0..8 {
            let next = (curr + 1) % 8;

            delay(tim6, ms);
            delay(tim6, ms);