Skip to content
Snippets Groups Projects
Commit d48d6fcb authored by Jonas Jacobsson's avatar Jonas Jacobsson
Browse files

hej

parent 92515b16
No related branches found
No related tags found
No related merge requests found
...@@ -26,8 +26,6 @@ const APP: () = { ...@@ -26,8 +26,6 @@ const APP: () = {
struct Resources { struct Resources {
// late resources // late resources
GPIOA: stm32::GPIOA, GPIOA: stm32::GPIOA,
GPIOC: stm32::GPIOC,
//button: <stm32::GPIOC as int>::PC13,
} }
#[init(schedule = [toggle])] #[init(schedule = [toggle])]
...@@ -61,15 +59,9 @@ const APP: () = { ...@@ -61,15 +59,9 @@ const APP: () = {
// configure PA5 as output, RM0368 8.4.1 // configure PA5 as output, RM0368 8.4.1
device.GPIOA.moder.modify(|_, w| w.moder5().bits(1)); device.GPIOA.moder.modify(|_, w| w.moder5().bits(1));
// Test button thingy. Think I put PC13 to input
device.GPIOC.moder.modify(|_, w| w.moder13().bits(0));
// device.GPIOC.pupdr.modify(|_, w| w.pupdr13().bits(0));
// pass on late resources // pass on late resources
init::LateResources { init::LateResources {
GPIOA: device.GPIOA, GPIOA: device.GPIOA,
GPIOC: device.GPIOC,
//button: device.button,
} }
} }
...@@ -84,7 +76,7 @@ const APP: () = { ...@@ -84,7 +76,7 @@ const APP: () = {
#[task(resources = [GPIOA,GPIOC], schedule = [toggle])] #[task(resources = [GPIOA], schedule = [toggle])]
fn toggle(cx: toggle::Context) { fn toggle(cx: toggle::Context) {
static mut TOGGLE: bool = false; static mut TOGGLE: bool = false;
rprintln!("toggle @ {:?}", Instant::now()); rprintln!("toggle @ {:?}", Instant::now());
...@@ -95,13 +87,19 @@ const APP: () = { ...@@ -95,13 +87,19 @@ const APP: () = {
cx.resources.GPIOA.bsrr.write(|w| w.br5().set_bit()); cx.resources.GPIOA.bsrr.write(|w| w.br5().set_bit());
} }
<<<<<<< HEAD
//cx.resources.GPIOC.PullDown; //cx.resources.GPIOC.PullDown;
=======
>>>>>>> 80d2d39 (changed main)
*TOGGLE = !*TOGGLE; *TOGGLE = !*TOGGLE;
cx.schedule cx.schedule
.toggle(cx.scheduled + 16_000_000.cycles()) .toggle(cx.scheduled + 16_000_000.cycles())
.unwrap(); .unwrap();
<<<<<<< HEAD
=======
>>>>>>> 80d2d39 (changed main)
} }
extern "C" { extern "C" {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment