Skip to content
Snippets Groups Projects
Commit c66a8af7 authored by Vlăduț-Andrei CHINȚOIU's avatar Vlăduț-Andrei CHINȚOIU
Browse files

Update file slides.md

parent bc7b138f
No related branches found
No related tags found
No related merge requests found
Pipeline #106532 failed
......@@ -136,25 +136,25 @@ const GPIO_OUT_CLR:*mut u32= 0xd000_0018 as *mut u32;
#[panic_handler]
pub fn panic(_info: &PanicInfo) -> ! {
loop { }
loop { }
}
```
```rust {all}{startLine:18}
#[entry]
fn main() -> ! {
let gpio_ctrl = (GPIOX_CTRL + 8 * pin) as *mut u32;
unsafe {
write_volatile(gpio_ctrl, 5);
write_volatile(GPIO_OE_SET, 1 << pin);
let reg = match value {
0 => GPIO_OUT_CLR,
_ => GPIO_OUT_SET
};
write_volatile(reg, 1 << pin);
};
loop { }
let gpio_ctrl = (GPIOX_CTRL + 8 * pin) as *mut u32;
unsafe {
write_volatile(gpio_ctrl, 5);
write_volatile(GPIO_OE_SET, 1 << pin);
let reg = match value {
0 => GPIO_OUT_CLR,
_ => GPIO_OUT_SET
};
write_volatile(reg, 1 << pin);
};
loop { }
}
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment