Merge pull request #73 from treymarc/taskorder

taskorder
This commit is contained in:
dongie 2014-04-12 12:00:25 +09:00
commit 01c63d0dd2
1 changed files with 1 additions and 3 deletions

View File

@ -770,8 +770,6 @@ void loop(void)
} }
} else { // not in rc loop } else { // not in rc loop
static int taskOrder = 0; // never call all function in the same loop, to avoid high delay spikes static int taskOrder = 0; // never call all function in the same loop, to avoid high delay spikes
if (taskOrder > 4)
taskOrder -= 5;
switch (taskOrder) { switch (taskOrder) {
case 0: case 0:
taskOrder++; taskOrder++;
@ -801,7 +799,7 @@ void loop(void)
break; break;
} }
case 4: case 4:
taskOrder++; taskOrder = 0;
#ifdef SONAR #ifdef SONAR
if (sensors(SENSOR_SONAR)) { if (sensors(SENSOR_SONAR)) {
Sonar_update(); Sonar_update();