1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #include <AP_HAL/AP_HAL.h>
- #if CONFIG_HAL_BOARD == HAL_BOARD_LINUX
- #include "Led_Sysfs.h"
- #include <AP_HAL_Linux/Led_Sysfs.h>
- Led_Sysfs::Led_Sysfs(const char *red, const char *green, const char *blue,
- uint8_t off_brightness, uint8_t low_brightness, uint8_t medium_brightness, uint8_t high_brightness):
- RGBLed(off_brightness, high_brightness, medium_brightness, low_brightness),
- red_led(red),
- green_led(green),
- blue_led(blue)
- {
- }
- bool Led_Sysfs::hw_init()
- {
- if (red_led.init() && green_led.init() && blue_led.init()) {
- return true;
- }
- return false;
- }
- bool Led_Sysfs::hw_set_rgb(uint8_t red, uint8_t green, uint8_t blue)
- {
- red_led.set_brightness(red);
- green_led.set_brightness(green);
- blue_led.set_brightness(blue);
- return true;
- }
- #endif
|