Skip to content
Snippets Groups Projects
Commit 6e8b8a45 authored by DevDoggo's avatar DevDoggo
Browse files

changing branch

parent 140426a5
No related branches found
No related tags found
No related merge requests found
...@@ -148,6 +148,20 @@ fn r_ead(addr: u32) -> u32 { ...@@ -148,6 +148,20 @@ fn r_ead(addr: u32) -> u32 {
} }
} }
// 2.
// Extend the read/write API with a modify, taking the address, field offsbet, field width, and value.
//
// Change the code into using your new API.
//
// Run and see that the program behaves the same.
//
// commit your answers (bare5_2)
fn m_odify(addr: u32, offset: u32, width: u32, val: u32) {
//something like this, it's a start
addr = addr | (val << offset);
}
// user application // user application
fn idle(rcc: &mut RCC, gpioa: &mut GPIOA) { fn idle(rcc: &mut RCC, gpioa: &mut GPIOA) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment