123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #pragma once
- #include <AP_HAL/AP_HAL.h>
- #ifdef WITH_SITL_RGBLED
- #include "RGBLed.h"
- #ifdef HAVE_SFML_GRAPHICS_H
- #include <SFML/Graphics.h>
- #else
- #include <SFML/Graphics.hpp>
- #endif
- class SITL_SFML_LED: public RGBLed
- {
- public:
- SITL_SFML_LED();
- protected:
- bool hw_init(void) override;
- bool hw_set_rgb(uint8_t r, uint8_t g, uint8_t b) override;
- private:
- pthread_t thread;
- void update_thread(void);
- static void *update_thread_start(void *obj);
- static constexpr uint8_t height = 50;
- static constexpr uint8_t width = height;
- enum class brightness {
- LED_LOW = 0x33,
- LED_MEDIUM = 0x7F,
- LED_HIGH = 0xFF,
- LED_OFF = 0x00
- };
- uint32_t last_colour;
- uint8_t red;
- uint8_t green;
- uint8_t blue;
- };
- #endif
|