Skip to content
Snippets Groups Projects
Commit f19ece31 authored by Kalle Löfgren's avatar Kalle Löfgren
Browse files

Update Project_Mouse.rs

parent 2d79fcd0
No related branches found
No related tags found
No related merge requests found
......@@ -205,7 +205,7 @@ const APP: () = {
#[task(resources = [scl_minus, scl_plus, Scaler, Scale_modify], priority = 1, schedule = [toggle_speed])]
fn toggle_speed(mut cx: toggle_speed::Context) {
if cx.resources.scl_plus.is_high().unwrap() && !*cx.resources.Scale_modify {
if cx.resources.scl_plus.is_high().unwrap() && !*cx.resources.Scale_modify && cx.resources.scl_minus.is_low().unwrap() {
*cx.resources.Scale_modify = true;
cx.resources.Scaler.lock(|Scaler| {
*Scaler += 0.1;
......@@ -216,7 +216,7 @@ const APP: () = {
*cx.resources.Scale_modify = false;
}
}
if cx.resources.scl_minus.is_high().unwrap() && !*cx.resources.Scale_modify {
if cx.resources.scl_minus.is_high().unwrap() && !*cx.resources.Scale_modify && cx.resources.scl_plus.is_low().unwrap() {
*cx.resources.Scale_modify = true;
cx.resources.Scaler.lock(|Scaler| {
if *Scaler != 1.0 && !(*Scaler < 1.0){
......
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