hardware: Introduce KeyboardHardware.has_leds

Intended to make it easier for LED-using code to bail out early, this simple
constant will tell us whether the board has LEDs or if it does not.

Because this will be used regularly, by code not close to the hardware,
`Kaleidoscope.has_leds` is an alias to `KeyboardHardware.has_leds`.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/432/head
Gergely Nagy 6 years ago
parent 3a015d2094
commit 3253f97c88
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -97,6 +97,8 @@ class Kaleidoscope_ {
void setup(void); void setup(void);
void loop(void); void loop(void);
static constexpr bool has_leds = (KeyboardHardware.led_count > 0);
/** Detaching from / attaching to the host. /** Detaching from / attaching to the host.
* *
* These two functions wrap the hardware plugin's similarly named functions. * These two functions wrap the hardware plugin's similarly named functions.

Loading…
Cancel
Save