From 1934647ae52d27b2beb37b303336059883ca9cff Mon Sep 17 00:00:00 2001
From: Anton <anton.frappe@outlook.com>
Date: Thu, 11 Mar 2021 14:07:05 +0100
Subject: [PATCH] bare7_2

---
 examples/rtic_bare7.rs | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/examples/rtic_bare7.rs b/examples/rtic_bare7.rs
index 300356c..0838b90 100644
--- a/examples/rtic_bare7.rs
+++ b/examples/rtic_bare7.rs
@@ -77,16 +77,16 @@ const APP: () = {
         static mut TOGGLE: bool = false;
         rprintln!("toggle  @ {:?}", Instant::now());
 
-
-        if *TOGGLE {
-            //cx.resources.GPIOA.bsrr.write(|w| w.bs5().set_bit());
-            cx.resources.led.set_high().unwrap();
-        } else {
-            cx.resources.led.set_low().unwrap();
-            //cx.resources.GPIOA.bsrr.write(|w| w.br5().set_bit());
-        }
-
-        *TOGGLE = !*TOGGLE;
+        _toggle_generic(cx.resources.led, TOGGLE);
+        // if *TOGGLE {
+        //     //cx.resources.GPIOA.bsrr.write(|w| w.bs5().set_bit());
+        //     cx.resources.led.set_high().unwrap();
+        // } else {
+        //     cx.resources.led.set_low().unwrap();
+        //     //cx.resources.GPIOA.bsrr.write(|w| w.br5().set_bit());
+        // }
+
+        //*TOGGLE = !*TOGGLE;
         cx.schedule.toggle(cx.scheduled + OFFSET.cycles()).unwrap();
     }
 
-- 
GitLab