From: Jon Langseth Date: Tue, 6 Sep 2011 22:51:21 +0000 (+0200) Subject: Simplified, removed an unnecessary boolean. X-Git-Url: https://git.defcon.no/?a=commitdiff_plain;ds=sidebyside;h=2441fac3194cfe64c466e89f9244b96e0e003f29;p=rctxduino Simplified, removed an unnecessary boolean. --- 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,