VibTest: fixed sample count output on console

This commit is contained in:
Andrew Tridgell 2014-07-08 10:23:56 +10:00
parent c1d1406c59
commit d50d5b8f24

View File

@ -138,6 +138,7 @@ void loop(void)
}; };
DataFlash.WriteBlock(&pkt, sizeof(pkt)); DataFlash.WriteBlock(&pkt, sizeof(pkt));
got_sample = true; got_sample = true;
total_samples[i]++;
} }
if (gyro_fd[i] != -1 && ::read(gyro_fd[i], &gyro_report, sizeof(gyro_report)) == if (gyro_fd[i] != -1 && ::read(gyro_fd[i], &gyro_report, sizeof(gyro_report)) ==
sizeof(gyro_report) && sizeof(gyro_report) &&
@ -154,14 +155,14 @@ void loop(void)
}; };
DataFlash.WriteBlock(&pkt, sizeof(pkt)); DataFlash.WriteBlock(&pkt, sizeof(pkt));
got_sample = true; got_sample = true;
}
if (got_sample) {
total_samples[i]++; total_samples[i]++;
if (total_samples[i] % 2000 == 0) { }
hal.console->printf("t=%lu total_samples=%lu/%lu/%lu\n", }
hal.scheduler->millis(), if (got_sample) {
total_samples[0], total_samples[1],total_samples[2]); if (total_samples[0] % 2000 == 0) {
} hal.console->printf("t=%lu total_samples=%lu/%lu/%lu\n",
hal.scheduler->millis(),
total_samples[0], total_samples[1],total_samples[2]);
} }
} }
} while (got_sample); } while (got_sample);