Merge pull request #745 from CapeLeidokos/pr_driver_LEDs

Fixed missing instanciation of driver::leds::Base<...>::LEDs_
pull/759/head
Jesse Vincent 5 years ago committed by GitHub
commit 5d617d753c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -90,8 +90,8 @@ class Base {
static constexpr uint8_t matrix_rows = KeyScannerProps::matrix_rows; static constexpr uint8_t matrix_rows = KeyScannerProps::matrix_rows;
static constexpr uint8_t matrix_columns = KeyScannerProps::matrix_columns; static constexpr uint8_t matrix_columns = KeyScannerProps::matrix_columns;
static constexpr uint8_t led_count = LEDDriverProps::led_count; static constexpr uint8_t led_count = LEDDriverProps::led_count;
static constexpr typename LEDDriver::LEDs &LEDs() { static constexpr auto LEDs() -> decltype(LEDDriver::LEDs()) & {
return LEDDriver::LEDs_; return LEDDriver::LEDs();
} }
/** /**

@ -374,17 +374,6 @@ cRGB VirtualLEDDriver::getCrgbAt(uint8_t i) const {
} // namespace virt } // namespace virt
} // namespace device } // namespace device
namespace driver {
namespace led {
template<>
Base<kaleidoscope::DeviceProps::LEDDriverProps>::LEDs
Base<kaleidoscope::DeviceProps::LEDDriverProps>::LEDs_{};
} // namespace led
} // namespace driver
} // namespace kaleidoscope } // namespace kaleidoscope

@ -99,8 +99,6 @@ class VirtualLEDDriver
typedef driver::led::Base<kaleidoscope::DeviceProps::LEDDriverProps> typedef driver::led::Base<kaleidoscope::DeviceProps::LEDDriverProps>
ParentType; ParentType;
using typename ParentType::LEDs;
static constexpr uint8_t led_count = kaleidoscope::DeviceProps::LEDDriverProps::led_count; static constexpr uint8_t led_count = kaleidoscope::DeviceProps::LEDDriverProps::led_count;
void setup(); void setup();

@ -65,14 +65,14 @@ class Base {
return pgm_read_byte(&_LEDDriverProps::key_led_map[key_offset]); return pgm_read_byte(&_LEDDriverProps::key_led_map[key_offset]);
} }
static class LEDs { class LEDRangeIterator {
private: private:
uint8_t offset_; uint8_t offset_;
public: public:
LEDs() : offset_(0) {} LEDRangeIterator() : offset_(0) {}
LEDs(uint8_t offset) : offset_(offset) {} LEDRangeIterator(uint8_t offset) : offset_(offset) {}
typedef LEDs ThisType; typedef LEDRangeIterator ThisType;
constexpr uint8_t offset() const { constexpr uint8_t offset() const {
return offset_; return offset_;
@ -109,7 +109,7 @@ class Base {
} }
struct Range { struct Range {
typedef ThisType Iterator; typedef LEDRangeIterator Iterator;
static constexpr ThisType begin() { static constexpr ThisType begin() {
return ThisType(uint8_t(0)); return ThisType(uint8_t(0));
} }
@ -127,7 +127,12 @@ class Base {
constexpr bool isValid(uint8_t index) const { constexpr bool isValid(uint8_t index) const {
return (_LEDDriverProps::led_count > 0 && index < _LEDDriverProps::led_count); return (_LEDDriverProps::led_count > 0 && index < _LEDDriverProps::led_count);
} }
} LEDs_; };
static LEDRangeIterator &LEDs() {
static LEDRangeIterator leds;
return leds;
}
protected: protected:
typedef _LEDDriverProps Props_; typedef _LEDDriverProps Props_;

Loading…
Cancel
Save