From 55b0f7a0860e8f73f90f2844f1ae8092059cb105 Mon Sep 17 00:00:00 2001 From: Felix Mann Date: Tue, 9 Feb 2016 19:57:15 +0100 Subject: [PATCH] Move the yield to yield only if we have a sufficient remainingTimeBudget --- code/oakpowerboard/oakpowerboard.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/oakpowerboard/oakpowerboard.ino b/code/oakpowerboard/oakpowerboard.ino index c6a8e7f..300ee54 100644 --- a/code/oakpowerboard/oakpowerboard.ino +++ b/code/oakpowerboard/oakpowerboard.ino @@ -119,10 +119,10 @@ bool btn_state = false; void loop() { int remainingTimeBudget = ui.update(); - yield(); long deadline = millis() + remainingTimeBudget; + if (remainingTimeBudget > 0) { - + yield(); if(b1_pressed == true) { ui.nextFrame(); b1_pressed = false;