hardware: ROWS, COLS, LED_COUNT and a bit of int8_t #432
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The ultimate goal of this pull request was to eliminate the warnings emitted for boards with no LEDs. To achieve this, we changed the led index type from
uint8_t
toint8_t
. But while there, the code has been cleaned up a little, by movingROWS
,COLS
andLED_COUNT
into the hardware classes, with the#define
'd names referencing those.Furthermore, to make sure that the LED code does not cause any issues when included into boards with no LEDs, the code has been augmented with
if (!Kaleidoscope.has_leds) return;
-like constructs, so that they bail out early on led-less keyboards.This fixed #385.