Browse Source

AP_HAL: AnalogSource: set_pin returns bool

gps-1.3.1
Iampete1 3 years ago committed by Andrew Tridgell
parent
commit
bb04406496
  1. 2
      libraries/AP_HAL/AnalogIn.h
  2. 2
      libraries/AP_HAL/examples/AnalogIn/AnalogIn.cpp

2
libraries/AP_HAL/AnalogIn.h

@ -9,7 +9,7 @@ class AP_HAL::AnalogSource { @@ -9,7 +9,7 @@ class AP_HAL::AnalogSource {
public:
virtual float read_average() = 0;
virtual float read_latest() = 0;
virtual void set_pin(uint8_t p) = 0;
virtual bool set_pin(uint8_t p) WARN_IF_UNUSED = 0;
// return a voltage from 0.0 to 5.0V, scaled
// against a reference voltage

2
libraries/AP_HAL/examples/AnalogIn/AnalogIn.cpp

@ -46,7 +46,7 @@ void loop(void) { @@ -46,7 +46,7 @@ void loop(void) {
//increment the pin number
pin = (pin+1) % 16;
//set pin corresponding to the new pin value
chan->set_pin(pin);
IGNORE_RETURN(chan->set_pin(pin));
//give a delay of 100ms
hal.scheduler->delay(100);
}

Loading…
Cancel
Save