Will LED_COUNT be 0 or ROWS*COLS for non-LED keyboards?


(Shriramana Sharma) #1

Will LED_COUNT be 0 or ROWS*COLS for non-LED keyboards? I ask because I’m writing some code where I need to divide by it. Thanks!


(Gergely Nagy) #2

It will be 0 for non-led boards.


(Shriramana Sharma) #3

OK then I guess for (int i=0; i < LED_COUNT; ++i will immediately fail.

A related question, is it guaranteed to be equal to ROWS*COLS for keyboards with LEDs?


(Gergely Nagy) #4

Yeah, that should work. A few plugins are using similar constructs.

For now, yes, because the only board with per-key LEDs Kaleidoscope supports is the Model01, which has the same amount of LEDs as ROWS*COLS. This is not necessarily true for other boards: the Dygma Raise has fewer LEDs (because there are unused parts of the matrix), and so does the ErgoDox EZ Glow.