From 2441fac3194cfe64c466e89f9244b96e0e003f29 Mon Sep 17 00:00:00 2001 From: Jon Langseth Date: Wed, 7 Sep 2011 00:51:21 +0200 Subject: [PATCH] Simplified, removed an unnecessary boolean. --- source/RCTXDuino/RCTXDuino.pde | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/source/RCTXDuino/RCTXDuino.pde b/source/RCTXDuino/RCTXDuino.pde index 0bc8562..d560fb4 100644 --- a/source/RCTXDuino/RCTXDuino.pde +++ b/source/RCTXDuino/RCTXDuino.pde @@ -224,15 +224,8 @@ void model_defaults( void ) } // ---------- Arduino main loop ----------------------- -void loop () { - - // Determine if the UI needs to run... - boolean disp; - if ( millis() - last > UI_INTERVAL ) { - last = millis(); - disp = true; - } - else disp = false; +void loop () +{ process_inputs(); @@ -243,10 +236,13 @@ void loop () { displaystate = BATTERY; } - if ( disp ) - { + if ( millis() - last > UI_INTERVAL ) + { + last = millis(); ui_handler(); } + + if ( displaystate != MENU ) { // Debugging: how long does the main loop take on avg, -- 2.39.2