diff --git a/board-package-source/boards.txt b/board-package-source/boards.txt index 081114c..096eea0 100644 --- a/board-package-source/boards.txt +++ b/board-package-source/boards.txt @@ -441,3 +441,169 @@ arduboy-devkit.menu.boot.cathy3kg.bootloader.high_fuses=0xd2 arduboy-devkit.menu.boot.cathy3kg.bootloader.file=cathy3k/arduboy3k-bootloader-game-devkit.hex ################################################################################ +# 8BitCADE XL board +################################################################################ + +8bitcadexl.name=8BitCADE XL + +#Arduino Leonardo +8bitcadexl.vid.0=0x2341 +8bitcadexl.pid.0=0x0036 +8bitcadexl.vid.1=0x2341 +8bitcadexl.pid.1=0x8036 +8bitcadexl.vid.2=0x2A03 +8bitcadexl.pid.2=0x0036 +8bitcadexl.vid.3=0x2A03 +8bitcadexl.pid.3=0x8036 + +8bitcadexl.upload.tool=arduino:avrdude +8bitcadexl.upload.protocol=avr109 +8bitcadexl.upload.maximum_size=29696 +8bitcadexl.upload.maximum_data_size=2560 +8bitcadexl.upload.speed=57600 +8bitcadexl.upload.disable_flushing=true +8bitcadexl.upload.use_1200bps_touch=true +8bitcadexl.upload.wait_for_upload_port=true + +8bitcadexl.bootloader.tool=arduino:avrdude +8bitcadexl.bootloader.low_fuses=0xff +8bitcadexl.bootloader.high_fuses=0xd2 +8bitcadexl.bootloader.extended_fuses=0xcb +8bitcadexl.bootloader.file=cathy3k/arduboy3k-bootloader-menu-promicro.hex +8bitcadexl.bootloader.unlock_bits=0x3F +8bitcadexl.bootloader.lock_bits=0x2F + +8bitcadexl.build.mcu=atmega32u4 +8bitcadexl.build.f_cpu=16000000L +8bitcadexl.build.variant=arduboy-promicro-alt +8bitcadexl.build.board=AVR_PROMICRO -DAB_ALTERNATE_WIRING +8bitcadexl.build.vid=0x2341 +8bitcadexl.build.pid=0x8036 +8bitcadexl.build.usb_product="8bitCADE" +8bitcadexl.build.core=arduino:arduino +8bitcadexl.build.flash_cs=-DCART_CS_RX +8bitcadexl.build.extra_flags=-DARDUBOY_10 -DOLED_SSD1309 {build.flash_cs} {build.contrast} {build.usb_flags} + +# Arduboy menu options ######################################################### + +#core select + +8bitcadexl.menu.core.arduboy-core=Arduboy optimized core +8bitcadexl.menu.core.arduboy-core.build.core=arduboy + +8bitcadexl.menu.core.arduino-core=Standard Arduino core +8bitcadexl.menu.core.arduino-core.build.core=arduino:arduino + +#bootloader select + +8bitcadexl.menu.boot.cathy3k=Cathy3K (starts with menu) +8bitcadexl.menu.boot.cathy3k.upload.maximum_size=29696 +8bitcadexl.menu.boot.cathy3k.bootloader.high_fuses=0xd2 +8bitcadexl.menu.boot.cathy3k.bootloader.file=cathy3k/arduboy3k-bootloader-menu-promicro.hex + +8bitcadexl.menu.boot.cathy3kg=Cathy3K (starts with game) +8bitcadexl.menu.boot.cathy3kg.upload.maximum_size=29696 +8bitcadexl.menu.boot.cathy3kg.bootloader.high_fuses=0xd2 +8bitcadexl.menu.boot.cathy3kg.bootloader.file=cathy3k/arduboy3k-bootloader-game-promicro.hex + +# Display contrast adjustment # + +8bitcadexl.menu.contrast.normal=Normal +8bitcadexl.menu.contrast.normal.build.contrast= + +8bitcadexl.menu.contrast.dimmed=Dimmed +8bitcadexl.menu.contrast.dimmed.build.contrast=-DOLED_CONTRAST=0x7F + +8bitcadexl.menu.contrast.low=Low +8bitcadexl.menu.contrast.low.build.contrast=-DOLED_CONTRAST=0x2F + +8bitcadexl.menu.contrast.lowest=Lowest +8bitcadexl.menu.contrast.lowest.build.contrast=-DOLED_CONTRAST=0x00 + +8bitcadexl.menu.contrast.highest=Highest +8bitcadexl.menu.contrast.highest.build.contrast=-DOLED_CONTRAST=0xFF + +################################################################################ +# 8BitCADE XL Level UP board +################################################################################ + +8bitcadexlup.name=8BitCADE XL Level UP + +#Arduino Leonardo +8bitcadexlup.vid.0=0x2341 +8bitcadexlup.pid.0=0x0036 +8bitcadexlup.vid.1=0x2341 +8bitcadexlup.pid.1=0x8036 +8bitcadexlup.vid.2=0x2A03 +8bitcadexlup.pid.2=0x0036 +8bitcadexlup.vid.3=0x2A03 +8bitcadexlup.pid.3=0x8036 + +8bitcadexlup.upload.tool=arduino:avrdude +8bitcadexlup.upload.protocol=avr109 +8bitcadexlup.upload.maximum_size=29696 +8bitcadexlup.upload.maximum_data_size=2560 +8bitcadexlup.upload.speed=57600 +8bitcadexlup.upload.disable_flushing=true +8bitcadexlup.upload.use_1200bps_touch=true +8bitcadexlup.upload.wait_for_upload_port=true + +8bitcadexlup.bootloader.tool=arduino:avrdude +8bitcadexlup.bootloader.low_fuses=0xff +8bitcadexlup.bootloader.high_fuses=0xd2 +8bitcadexlup.bootloader.extended_fuses=0xcb +8bitcadexlup.bootloader.file=cathy3k/arduboy3k-bootloader-menu-promicro.hex +8bitcadexlup.bootloader.unlock_bits=0x3F +8bitcadexlup.bootloader.lock_bits=0x2F + +8bitcadexlup.build.mcu=atmega32u4 +8bitcadexlup.build.f_cpu=16000000L +8bitcadexlup.build.variant=arduboy-promicro-alt +8bitcadexlup.build.board=AVR_PROMICRO -DAB_ALTERNATE_WIRING +8bitcadexlup.build.vid=0x2341 +8bitcadexlup.build.pid=0x8036 +8bitcadexlup.build.usb_product="8bitCADE" +8bitcadexlup.build.core=arduino:arduino +8bitcadexlup.build.flash_cs=-DCART_CS_RX +8bitcadexlup.build.extra_flags=-DARDUBOY_10 -DOLED_SSD1309 -DSUPPORT_XY_BUTTONS {build.flash_cs} {build.contrast} {build.usb_flags} + +# Arduboy menu options ######################################################### + +#core select + +8bitcadexlup.menu.core.arduboy-core=Arduboy optimized core +8bitcadexlup.menu.core.arduboy-core.build.core=arduboy + +8bitcadexlup.menu.core.arduino-core=Standard Arduino core +8bitcadexlup.menu.core.arduino-core.build.core=arduino:arduino + +#bootloader select + +8bitcadexlup.menu.boot.cathy3k=Cathy3K (starts with menu) +8bitcadexlup.menu.boot.cathy3k.upload.maximum_size=29696 +8bitcadexlup.menu.boot.cathy3k.bootloader.high_fuses=0xd2 +8bitcadexlup.menu.boot.cathy3k.bootloader.file=cathy3k/arduboy3k-bootloader-menu-promicro.hex + +8bitcadexlup.menu.boot.cathy3kg=Cathy3K (starts with game) +8bitcadexlup.menu.boot.cathy3kg.upload.maximum_size=29696 +8bitcadexlup.menu.boot.cathy3kg.bootloader.high_fuses=0xd2 +8bitcadexlup.menu.boot.cathy3kg.bootloader.file=cathy3k/arduboy3k-bootloader-game-promicro.hex + +# Display contrast adjustment # + +8bitcadexlup.menu.contrast.normal=Normal +8bitcadexlup.menu.contrast.normal.build.contrast= + +8bitcadexlup.menu.contrast.dimmed=Dimmed +8bitcadexlup.menu.contrast.dimmed.build.contrast=-DOLED_CONTRAST=0x7F + +8bitcadexlup.menu.contrast.low=Low +8bitcadexlup.menu.contrast.low.build.contrast=-DOLED_CONTRAST=0x2F + +8bitcadexlup.menu.contrast.lowest=Lowest +8bitcadexlup.menu.contrast.lowest.build.contrast=-DOLED_CONTRAST=0x00 + +8bitcadexlup.menu.contrast.highest=Highest +8bitcadexlup.menu.contrast.highest.build.contrast=-DOLED_CONTRAST=0xFF + +################################################################################ diff --git a/board-package-source/libraries/Arduboy2/src/Arduboy2Core.cpp b/board-package-source/libraries/Arduboy2/src/Arduboy2Core.cpp index f26a724..51d2ba0 100644 --- a/board-package-source/libraries/Arduboy2/src/Arduboy2Core.cpp +++ b/board-package-source/libraries/Arduboy2/src/Arduboy2Core.cpp @@ -198,6 +198,9 @@ void Arduboy2Core::bootPins() #ifndef AB_ALTERNATE_WIRING _BV(GREEN_LED_BIT) | #endif + #ifdef SUPPORT_XY_BUTTONS + _BV(Y_BUTTON_BIT) | + #endif #ifndef ARDUINO_AVR_MICRO _BV(RX_LED_BIT) | //RX LED off for Arduboy and non Micro based Arduino #endif @@ -212,7 +215,11 @@ void Arduboy2Core::bootPins() #endif _BV(SPI_MOSI_BIT) | _BV(SPI_SCK_BIT) | _BV(RX_LED_BIT)) & // Port B inputs - ~(_BV(B_BUTTON_BIT) | _BV(SPI_MISO_BIT)); + ~(_BV(B_BUTTON_BIT) | _BV(SPI_MISO_BIT) + #ifdef SUPPORT_XY_BUTTONS + | _BV(Y_BUTTON_BIT) + #endif + ); // Port C // Speaker: Not set here. Controlled by audio class @@ -278,7 +285,11 @@ void Arduboy2Core::bootPins() // Port F INPUT_PULLUP or HIGH PORTF = (_BV(LEFT_BUTTON_BIT) | _BV(RIGHT_BUTTON_BIT) | - _BV(UP_BUTTON_BIT) | _BV(DOWN_BUTTON_BIT)) & + _BV(UP_BUTTON_BIT) | _BV(DOWN_BUTTON_BIT) + #ifdef SUPPORT_XY_BUTTONS + | _BV(X_BUTTON_BIT) + #endif + ) & // Port F INPUT or LOW ~(_BV(RAND_SEED_IN_BIT)); @@ -287,6 +298,9 @@ void Arduboy2Core::bootPins() // Port F inputs ~(_BV(LEFT_BUTTON_BIT) | _BV(RIGHT_BUTTON_BIT) | _BV(UP_BUTTON_BIT) | _BV(DOWN_BUTTON_BIT) | + #ifdef SUPPORT_XY_BUTTONS + _BV(X_BUTTON_BIT) | + #endif _BV(RAND_SEED_IN_BIT)); #elif defined(AB_DEVKIT) @@ -1369,13 +1383,17 @@ uint8_t Arduboy2Core::buttonsState() (_BV(UP_BUTTON_BIT) | _BV(RIGHT_BUTTON_BIT) | _BV(LEFT_BUTTON_BIT) | _BV(DOWN_BUTTON_BIT) | #ifdef SUPPORT_XY_BUTTONS - _BV(X_BUTTON_BIT) | _BV(Y_BUTTON_BIT) | + _BV(X_BUTTON_BIT) | #endif 0)); // A if (bitRead(A_BUTTON_PORTIN, A_BUTTON_BIT) == 0) { buttons |= A_BUTTON; } // B if (bitRead(B_BUTTON_PORTIN, B_BUTTON_BIT) == 0) { buttons |= B_BUTTON; } + #ifdef SUPPORT_XY_BUTTONS + // Y + if (bitRead(Y_BUTTON_PORTIN, Y_BUTTON_BIT) == 0) { buttons |= Y_BUTTON; } + #endif #elif defined(AB_DEVKIT) // down, left, up buttons = ((~PINB) & diff --git a/board-package-source/libraries/Arduboy2/src/Arduboy2Core.h b/board-package-source/libraries/Arduboy2/src/Arduboy2Core.h index 370d5df..0b44bff 100644 --- a/board-package-source/libraries/Arduboy2/src/Arduboy2Core.h +++ b/board-package-source/libraries/Arduboy2/src/Arduboy2Core.h @@ -194,11 +194,11 @@ #define X_BUTTON_DDR DDRF #define X_BUTTON_BIT PORTF1 - #define PIN_Y_BUTTON A5 - #define Y_BUTTON_PORT PORTF - #define Y_BUTTON_PORTIN PINF - #define Y_BUTTON_DDR DDRF - #define Y_BUTTON_BIT PORTF0 + #define PIN_Y_BUTTON 11 + #define Y_BUTTON_PORT PORTB + #define Y_BUTTON_PORTIN PINB + #define Y_BUTTON_DDR DDRB + #define Y_BUTTON_BIT PORTB7 #endif #define PIN_SPEAKER_1 5 /**< The pin number of the first lead of the speaker */ @@ -311,11 +311,19 @@ // ----- Pins common on Arduboy and DevKit ----- // Unconnected analog input used for noise by initRandomSeed() +#ifndef SUPPORT_XY_BUTTONS #define RAND_SEED_IN A4 #define RAND_SEED_IN_PORT PORTF #define RAND_SEED_IN_BIT PORTF1 // Value for ADMUX to read the random seed pin: 2.56V reference, ADC1 #define RAND_SEED_IN_ADMUX (_BV(REFS0) | _BV(REFS1) | _BV(MUX0)) +#else +#define RAND_SEED_IN A5 +#define RAND_SEED_IN_PORT PORTF +#define RAND_SEED_IN_BIT PORTF0 +// Value for ADMUX to read the random seed pin: 2.56V reference, ADC1 +#define RAND_SEED_IN_ADMUX (_BV(REFS0) | _BV(REFS1)) +#endif // SPI interface #define SPI_MISO_PORT PORTB diff --git a/board-package/arduboy-homemade-1.3.2.zip b/board-package/arduboy-homemade-1.3.2.zip new file mode 100644 index 0000000..4f5f86d Binary files /dev/null and b/board-package/arduboy-homemade-1.3.2.zip differ diff --git a/package_arduboy_homemade_index.json b/package_arduboy_homemade_index.json index 8bbd608..d821756 100644 --- a/package_arduboy_homemade_index.json +++ b/package_arduboy_homemade_index.json @@ -273,6 +273,28 @@ ], "toolsDependencies": [ ] + }, + { + "name": "Arduboy homemade package", + "architecture": "avr", + "version": "1.3.2", + "category": "Contributed", + "help": { + "online": "http://community.arduboy.com/" + }, + "url": "https://github.com/MrBlinky/Arduboy-homemade-package/raw/master/board-package/arduboy-homemade-1.3.2.zip", + "archiveFileName": "arduboy-homemade-1.3.2.zip", + "checksum": "SHA-256:939e5eafe7ff646e3007b6e566bd69f81abd6c7a84a9347c1f60048698b077e9", + "size": "1322502", + "boards": [ + {"name": "Arduboy production"}, + {"name": "Arduboy DevKit"}, + {"name": "Arduino Leonardo"}, + {"name": "Arduino / Genuino Micro"}, + {"name": "ProMicro 5V"} + ], + "toolsDependencies": [ + ] } ], "tools":[] }