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:
Peter Barker
2024-07-16 10:11:40 +10:00
committed by Andrew Tridgell
parent 55308e6d79
commit 501d0d8759
10 changed files with 74 additions and 20 deletions
+7
View File
@@ -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