Skip to content

Commit

Permalink
Config Fix for Button Layouts crashing neopico.cpp (OpenStickCommunit…
Browse files Browse the repository at this point in the history
…y#1045)

* Fixes when a button layout is not defined in the LED orders of neopico by adding a default.

Also constricts the cases to 4 returns rather than individual returns.

* Converting spaces back to tabs for this file
  • Loading branch information
arntsonl authored Jun 6, 2024
1 parent c1dbd5c commit 85dfb31
Showing 1 changed file with 13 additions and 38 deletions.
51 changes: 13 additions & 38 deletions src/addons/neopicoleds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,53 +436,28 @@ std::vector<std::vector<Pixel>> NeoPicoLEDAddon::createLEDLayout(ButtonLayout la

switch (static_cast<ButtonLayout>(layout))
{
case BUTTON_LAYOUT_STICKLESS:
case BUTTON_LAYOUT_OPENCORE0WASDA:
case BUTTON_LAYOUT_STICKLESS_13:
case BUTTON_LAYOUT_STICKLESS_14:
case BUTTON_LAYOUT_STICKLESS_16:
case BUTTON_LAYOUT_BOARD_DEFINED_A:
return generatedLEDStickless(&positions);
case BUTTON_LAYOUT_FIGHTBOARD_MIRRORED:
return generatedLEDWasdFBM(&positions);
case BUTTON_LAYOUT_BUTTONS_ANGLED:
case BUTTON_LAYOUT_FIGHTBOARD_STICK:
return generatedLEDWasd(&positions);
case BUTTON_LAYOUT_BLANKA:
return generatedLEDButtons(&positions);

case BUTTON_LAYOUT_BUTTONS_BASIC:
return generatedLEDButtons(&positions);

case BUTTON_LAYOUT_KEYBOARD_ANGLED:
return generatedLEDButtons(&positions);

case BUTTON_LAYOUT_KEYBOARDA:
return generatedLEDButtons(&positions);

case BUTTON_LAYOUT_DANCEPADA:
return generatedLEDButtons(&positions);

case BUTTON_LAYOUT_TWINSTICKA:
return generatedLEDButtons(&positions);

case BUTTON_LAYOUT_ARCADE:
return generatedLEDButtons(&positions);

case BUTTON_LAYOUT_STICKLESS:
return generatedLEDStickless(&positions);

case BUTTON_LAYOUT_BUTTONS_ANGLED:
return generatedLEDWasd(&positions);

case BUTTON_LAYOUT_VLXA:
default:
return generatedLEDButtons(&positions);

case BUTTON_LAYOUT_FIGHTBOARD_STICK:
return generatedLEDWasd(&positions);

case BUTTON_LAYOUT_FIGHTBOARD_MIRRORED:
return generatedLEDWasdFBM(&positions);

case BUTTON_LAYOUT_OPENCORE0WASDA:
return generatedLEDStickless(&positions);

case BUTTON_LAYOUT_STICKLESS_13:
return generatedLEDStickless(&positions);

case BUTTON_LAYOUT_STICKLESS_16:
return generatedLEDStickless(&positions);

case BUTTON_LAYOUT_STICKLESS_14:
return generatedLEDStickless(&positions);
}

assert(false);
Expand Down

0 comments on commit 85dfb31

Please sign in to comment.