AP_Compass: example fix travis warning

missing function declaration
implicit cast
some style fix
This commit is contained in:
Pierre Kancir 2017-04-13 13:30:20 +02:00 committed by Francisco Ferreira
parent 2200302081
commit d3e27d8720

View File

@ -45,7 +45,7 @@ static void loop()
if ((AP_HAL::micros() - timer) > 100000L) {
timer = AP_HAL::micros();
compass.read();
unsigned long read_time = AP_HAL::micros() - timer;
const uint32_t read_time = AP_HAL::micros() - timer;
for (uint8_t i = 0; i < compass_count; i++) {
float heading;
@ -82,14 +82,16 @@ static void loop()
// display all to user
hal.console->printf("Heading: %.2f (%3d, %3d, %3d)",
ToDeg(heading),
(double)ToDeg(heading),
(int)mag.x,
(int)mag.y,
(int)mag.z);
// display offsets
hal.console->printf(" offsets(%.2f, %.2f, %.2f)",
offset[i][0], offset[i][1], offset[i][2]);
(double)offset[i][0],
(double)offset[i][1],
(double)offset[i][2]);
hal.console->printf(" t=%u", (unsigned)read_time);