firmware fix: only fuel to 100% once in pitlane

Sat, 15 Dec 2012 22:55:30 +0100

author
Malte Bayer <mbayer@neo-soft.org>
date
Sat, 15 Dec 2012 22:55:30 +0100
changeset 123
ec623e5fcbca
parent 122
8344d8d38c4f
child 124
0b12a8bf23b2

firmware fix: only fuel to 100% once in pitlane

blackbox/main.c file | annotate | diff | comparison | revisions
slotUI/slotCli.py file | annotate | diff | comparison | revisions
--- a/blackbox/main.c	Sat Dec 15 17:12:40 2012 +0100
+++ b/blackbox/main.c	Sat Dec 15 22:55:30 2012 +0100
@@ -423,7 +423,10 @@
             } else if (slot[controller].canrefuel) {
                 // increase fuel by 5%/sec, this equals by adding 50 to the counter
                 slot[controller].fuel += 50;
-                if (slot[controller].fuel > FUEL_FULL) slot[controller].fuel = FUEL_FULL;
+                if (slot[controller].fuel > FUEL_FULL) {
+                    slot[controller].fuel = FUEL_FULL;
+                    slot[controller].canrefuel = 0;
+                }
             }
             return 1;
         }
--- a/slotUI/slotCli.py	Sat Dec 15 17:12:40 2012 +0100
+++ b/slotUI/slotCli.py	Sat Dec 15 22:55:30 2012 +0100
@@ -475,8 +475,8 @@
             # is there something in the rx buffer?
             rx = self.box.readline()
             if (rx != "") or self.test:
-                self.scr.addstr(17,0,
-                    "Last RX: %19s" % rx, curses.color_pair(2))
+                self.scr.addstr(17,3,
+                    "RX: %19s" % rx, curses.color_pair(2))
                 self.scr.redrawwin()
                 self.scr.refresh()
                 # we have received something

mercurial