Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #132 from OpenStickFoundation/no-displayleft-right
Browse files Browse the repository at this point in the history
Blank A/B Display settings
  • Loading branch information
arntsonl authored Oct 24, 2022
2 parents 5fcda07 + 4f9f35c commit 8fd962c
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
4 changes: 3 additions & 1 deletion include/addons/i2cdisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@ class I2CDisplayAddon : public GPAddon
void drawDancepadB(int startX, int startY, int buttonSize, int buttonPadding);
void drawTwinStickA(int startX, int startY, int buttonSize, int buttonPadding);
void drawTwinStickB(int startX, int startY, int buttonSize, int buttonPadding);
void drawBlankA(int startX, int startY, int buttonSize, int buttonPadding);
void drawBlankB(int startX, int startY, int buttonSize, int buttonPadding);
uint8_t ucBackBuffer[1024];
OBDISP obd;
std::string statusBar;
Gamepad* gamepad;
Gamepad* pGamepad;
};

#endif
#endif
4 changes: 3 additions & 1 deletion include/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ typedef enum
BUTTON_LAYOUT_KEYBOARDA,
BUTTON_LAYOUT_DANCEPADA,
BUTTON_LAYOUT_TWINSTICKA,
BUTTON_LAYOUT_BLANKA,
} ButtonLayout;

typedef enum
Expand All @@ -26,7 +27,8 @@ typedef enum
BUTTON_LAYOUT_NOIR8,
BUTTON_LAYOUT_KEYBOARDB,
BUTTON_LAYOUT_DANCEPADB,
BUTTON_LAYOUT_TWINSTICKB,
BUTTON_LAYOUT_TWINSTICKB,
BUTTON_LAYOUT_BLANKB
} ButtonLayoutRight;

typedef enum
Expand Down
16 changes: 14 additions & 2 deletions src/addons/i2cdisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ void I2CDisplayAddon::process() {
case BUTTON_LAYOUT_STICK:
drawArcadeStick(8, 28, 8, 2);
break;

case BUTTON_LAYOUT_STICKLESS:
drawStickless(8, 20, 8, 2);
break;

case BUTTON_LAYOUT_BUTTONS_ANGLED:
drawWasdBox(8, 28, 7, 3);
break;
Expand All @@ -78,6 +76,9 @@ void I2CDisplayAddon::process() {
case BUTTON_LAYOUT_TWINSTICKA:
drawTwinStickA(8, 28, 8, 2);
break;
case BUTTON_LAYOUT_BLANKA:
drawBlankA(0, 0, 0, 0);
break;
}

switch (BUTTON_LAYOUT_RIGHT)
Expand Down Expand Up @@ -118,6 +119,9 @@ void I2CDisplayAddon::process() {
case BUTTON_LAYOUT_TWINSTICKB:
drawTwinStickB(100, 28, 8, 2);
break;
case BUTTON_LAYOUT_BLANKB:
drawSticklessButtons(0, 0, 0, 0);
break;
}
}

Expand Down Expand Up @@ -475,6 +479,14 @@ void I2CDisplayAddon::drawDancepadB(int startX, int startY, int buttonSize, int
obdRectangle(&obd, startX + buttonMargin * 2, startY + buttonMargin * 2, startX + buttonSize + buttonMargin * 2, startY + buttonSize + buttonMargin * 2, 1, pGamepad->pressedB3()); // Down/Right
}

void I2CDisplayAddon::drawBlankA(int startX, int startY, int buttonSize, int buttonPadding)
{
}

void I2CDisplayAddon::drawBlankB(int startX, int startY, int buttonSize, int buttonPadding)
{
}

void I2CDisplayAddon::drawSplashScreen(int splashMode, int splashSpeed)
{
int mils = getMillis();
Expand Down
18 changes: 18 additions & 0 deletions src/addons/neopicoleds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,24 @@ std::vector<std::vector<Pixel>> NeoPicoLEDAddon::createLEDLayout(ButtonLayout la

switch (layout)
{
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);

Expand Down

0 comments on commit 8fd962c

Please sign in to comment.