mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-06 19:00:27 +08:00
AP_Notify: stop using linux board subtype in Notify LED setup
... instead have the board definitions define things like we do for ChibiOS
This commit is contained in:
committed by
Andrew Tridgell
parent
55308e6d79
commit
501d0d8759
@@ -15,6 +15,10 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "AP_Notify_config.h"
|
||||
|
||||
#if AP_NOTIFY_RCOUTPUTRGBLED_LED_ENABLED
|
||||
|
||||
#include "RCOutputRGBLed.h"
|
||||
|
||||
#include <AP_Math/AP_Math.h>
|
||||
@@ -58,10 +62,12 @@ uint16_t RCOutputRGBLed::get_duty_cycle_for_color(const uint8_t color, const uin
|
||||
return usec_period * color / _led_bright;
|
||||
}
|
||||
|
||||
#if AP_NOTIFY_RCOUTPUTRGBLEDINVERTED_LED_ENABLED
|
||||
uint16_t RCOutputRGBLedInverted::get_duty_cycle_for_color(const uint8_t color, const uint16_t usec_period) const
|
||||
{
|
||||
return usec_period * (255 - color) / _led_bright;
|
||||
}
|
||||
#endif // AP_NOTIFY_RCOUTPUTRGBLEDINVERTED_LED_ENABLED
|
||||
|
||||
|
||||
bool RCOutputRGBLed::hw_set_rgb(uint8_t red, uint8_t green, uint8_t blue)
|
||||
@@ -91,3 +97,4 @@ bool RCOutputRGBLed::hw_set_rgb(uint8_t red, uint8_t green, uint8_t blue)
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif // AP_NOTIFY_RCOUTPUTRGBLED_LED_ENABLED
|
||||
|
||||
Reference in New Issue
Block a user