mirror of https://github.com/ArduPilot/ardupilot
AP_HAL_Linux: AnalogIn_Raspilot: rename classes to follow other names
This commit is contained in:
parent
87e7704b1c
commit
21b2d5d34c
|
@ -46,12 +46,12 @@ float AnalogSource_Raspilot::voltage_average_ratiometric()
|
|||
|
||||
extern const AP_HAL::HAL& hal;
|
||||
|
||||
RaspilotAnalogIn::RaspilotAnalogIn()
|
||||
AnalogIn_Raspilot::AnalogIn_Raspilot()
|
||||
{
|
||||
_channels_number = RASPILOT_ADC_MAX_CHANNELS;
|
||||
}
|
||||
|
||||
float RaspilotAnalogIn::board_voltage(void)
|
||||
float AnalogIn_Raspilot::board_voltage(void)
|
||||
{
|
||||
_vcc_pin_analog_source->set_pin(4);
|
||||
|
||||
|
@ -59,7 +59,7 @@ float RaspilotAnalogIn::board_voltage(void)
|
|||
//return _vcc_pin_analog_source->voltage_average() * 2.0;
|
||||
}
|
||||
|
||||
AP_HAL::AnalogSource* RaspilotAnalogIn::channel(int16_t pin)
|
||||
AP_HAL::AnalogSource* AnalogIn_Raspilot::channel(int16_t pin)
|
||||
{
|
||||
for (uint8_t j = 0; j < _channels_number; j++) {
|
||||
if (_channels[j] == NULL) {
|
||||
|
@ -72,7 +72,7 @@ AP_HAL::AnalogSource* RaspilotAnalogIn::channel(int16_t pin)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void RaspilotAnalogIn::init()
|
||||
void AnalogIn_Raspilot::init()
|
||||
{
|
||||
_vcc_pin_analog_source = channel(4);
|
||||
|
||||
|
@ -86,11 +86,11 @@ void RaspilotAnalogIn::init()
|
|||
}
|
||||
|
||||
hal.scheduler->suspend_timer_procs();
|
||||
hal.scheduler->register_timer_process(FUNCTOR_BIND_MEMBER(&RaspilotAnalogIn::_update, void));
|
||||
hal.scheduler->register_timer_process(FUNCTOR_BIND_MEMBER(&AnalogIn_Raspilot::_update, void));
|
||||
hal.scheduler->resume_timer_procs();
|
||||
}
|
||||
|
||||
void RaspilotAnalogIn::_update()
|
||||
void AnalogIn_Raspilot::_update()
|
||||
{
|
||||
if (AP_HAL::micros() - _last_update_timestamp < 100000) {
|
||||
return;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
class AnalogSource_Raspilot: public AP_HAL::AnalogSource {
|
||||
public:
|
||||
friend class RaspilotAnalogIn;
|
||||
friend class AnalogIn_Raspilot;
|
||||
AnalogSource_Raspilot(int16_t pin);
|
||||
float read_average();
|
||||
float read_latest();
|
||||
|
@ -23,9 +23,9 @@ private:
|
|||
float _value;
|
||||
};
|
||||
|
||||
class RaspilotAnalogIn: public AP_HAL::AnalogIn {
|
||||
class AnalogIn_Raspilot: public AP_HAL::AnalogIn {
|
||||
public:
|
||||
RaspilotAnalogIn();
|
||||
AnalogIn_Raspilot();
|
||||
void init();
|
||||
AP_HAL::AnalogSource* channel(int16_t n);
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ static SPIDeviceManager spiDeviceManager;
|
|||
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_PXFMINI
|
||||
static AnalogIn_ADS1115 analogIn;
|
||||
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_RASPILOT
|
||||
static RaspilotAnalogIn analogIn;
|
||||
static AnalogIn_Raspilot analogIn;
|
||||
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_QFLIGHT
|
||||
static Empty::AnalogIn analogIn;
|
||||
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_PXF || \
|
||||
|
|
Loading…
Reference in New Issue