blackbox/main.c

changeset 116
c2fc650cc48f
parent 114
313aad7435a8
child 123
ec623e5fcbca
--- a/blackbox/main.c	Sun Dec 02 19:19:23 2012 +0100
+++ b/blackbox/main.c	Sun Dec 02 19:54:14 2012 +0100
@@ -410,7 +410,7 @@
     if ( ((PIN(SW_FUEL_PORT) & _BV(SW_FUEL)) != 0) | (slot[controller].fuel == 0)) tmp |= 1;
     if (insert_queue(tmp, 9)) {
         if ((fuel_enabled) && (slot[controller].unlimitedfuel == 0)) {
-            if (speed != 0) {
+            if ((speed != 0) && (fuel_divisor > 0)) {
                 // do the fuel calculation, regardless if fuel logic active or not
                 tmp = (uint8_t)(((slot[controller].accel * speed) + 1) / fuel_divisor);
                 if (tmp == 0) tmp = 1;

mercurial