Ardupilot2/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_Stream.cpp
Gustavo Jose de Sousa 7789aec85b AP_InertialSensor: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:28:43 +10:00

28 lines
593 B
C++

#include <stdarg.h>
#include <AP_HAL/AP_HAL.h>
#include "AP_InertialSensor_UserInteract_Stream.h"
extern const AP_HAL::HAL& hal;
bool AP_InertialSensor_UserInteractStream::blocking_read()
{
/* Wait for input to be available */
while(!_s->available()) {
hal.scheduler->delay(20);
}
/* Clear all available input */
while (_s->available()) {
_s->read();
}
return true;
}
void AP_InertialSensor_UserInteractStream::_printf_P(
const prog_char* fmt, ...) {
va_list ap;
va_start(ap, fmt);
_s->vprintf_P(fmt, ap);
va_end(ap);
}