update arduboy, arduboy2 libraries

Arduboy, Arduboy2:
Rotated D-pad buttons 180 degrees for microcade

arduboy:
added forgotten rgb on code for microcade
This commit is contained in:
Mr.Blinky 2022-12-12 14:18:46 +01:00
parent 6ba403d487
commit 822745e220
3 changed files with 50 additions and 1 deletions

View File

@ -909,13 +909,15 @@ void ArduboyCore::flipHorizontal(boolean flipped)
void ArduboyCore::setRGBled(uint8_t red, uint8_t green, uint8_t blue)
{
#ifdef ARDUBOY_10 // RGB, all the pretty colors
#if defined(LCD_ST7565)
#if defined(LCD_ST7565) || (MICROCADE)
if ((red | green | blue) == 0) //prevent backlight off
{
red = 255;
green = 255;
blue = 255;
}
#endif
#if defined(LCD_ST7565)
analogWrite(RED_LED, red);
analogWrite(GREEN_LED, green);
analogWrite(BLUE_LED, blue);

View File

@ -87,10 +87,17 @@
#define RX_LED 17
// pin values for buttons, probably shouldn't use these
#if defined (MICROCADE)
#define PIN_LEFT_BUTTON A1 // joystick rotated 180 degrees
#define PIN_RIGHT_BUTTON A2
#define PIN_UP_BUTTON A3
#define PIN_DOWN_BUTTON A0
#else
#define PIN_LEFT_BUTTON A2
#define PIN_RIGHT_BUTTON A1
#define PIN_UP_BUTTON A0
#define PIN_DOWN_BUTTON A3
#endif
#ifndef SUPPORT_XY_BUTTONS
#define PIN_A_BUTTON 7
#define PIN_B_BUTTON 8
@ -100,10 +107,17 @@
#endif
// bit values for button states
#if defined (MICROCADE)
#define LEFT_BUTTON _BV(6)
#define RIGHT_BUTTON _BV(5)
#define UP_BUTTON _BV(4)
#define DOWN_BUTTON _BV(7)
#else
#define LEFT_BUTTON _BV(5)
#define RIGHT_BUTTON _BV(6)
#define UP_BUTTON _BV(7)
#define DOWN_BUTTON _BV(4)
#endif
#define A_BUTTON _BV(3)
#define B_BUTTON _BV(2)

View File

@ -140,10 +140,17 @@
// bit values for button states
// these are determined by the buttonsState() function
#if defined (MICROCADE)
#define LEFT_BUTTON _BV(6) // joystick is rotated 180 degrees
#define RIGHT_BUTTON _BV(5)
#define UP_BUTTON _BV(4)
#define DOWN_BUTTON _BV(7)
#else
#define LEFT_BUTTON _BV(5) /**< The Left button value for functions requiring a bitmask */
#define RIGHT_BUTTON _BV(6) /**< The Right button value for functions requiring a bitmask */
#define UP_BUTTON _BV(7) /**< The Up button value for functions requiring a bitmask */
#define DOWN_BUTTON _BV(4) /**< The Down button value for functions requiring a bitmask */
#endif
#define A_BUTTON _BV(3) /**< The A button value for functions requiring a bitmask */
#define B_BUTTON _BV(2) /**< The B button value for functions requiring a bitmask */
#ifdef SUPPORT_XY_BUTTONS
@ -151,6 +158,31 @@
#define Y_BUTTON _BV(1)
#endif
#if defined (MICROCADE)
#define PIN_LEFT_BUTTON A1
#define LEFT_BUTTON_PORT PORTF
#define LEFT_BUTTON_PORTIN PINF
#define LEFT_BUTTON_DDR DDRF
#define LEFT_BUTTON_BIT PORTF6
#define PIN_RIGHT_BUTTON A2
#define RIGHT_BUTTON_PORT PORTF
#define RIGHT_BUTTON_PORTIN PINF
#define RIGHT_BUTTON_DDR DDRF
#define RIGHT_BUTTON_BIT PORTF5
#define PIN_UP_BUTTON A3
#define UP_BUTTON_PORT PORTF
#define UP_BUTTON_PORTIN PINF
#define UP_BUTTON_DDR DDRF
#define UP_BUTTON_BIT PORTF4
#define PIN_DOWN_BUTTON A0
#define DOWN_BUTTON_PORT PORTF
#define DOWN_BUTTON_PORTIN PINF
#define DOWN_BUTTON_DDR DDRF
#define DOWN_BUTTON_BIT PORTF7
#else
#define PIN_LEFT_BUTTON A2
#define LEFT_BUTTON_PORT PORTF
#define LEFT_BUTTON_PORTIN PINF
@ -174,6 +206,7 @@
#define DOWN_BUTTON_PORTIN PINF
#define DOWN_BUTTON_DDR DDRF
#define DOWN_BUTTON_BIT PORTF4
#endif
#ifndef SUPPORT_XY_BUTTONS
#define PIN_A_BUTTON 7