Skip to content

remove gamepad; deprecate gamepadshift #5068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/porting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ as a natural "TODO" list. An example minimal build list is shown below:
# Requires DigitalIO:
CIRCUITPY_BITBANGIO = 0
# Requires DigitalIO
CIRCUITPY_GAMEPAD = 0
CIRCUITPY_GAMEPADSHIFT = 0
# Requires neopixel_write or SPI (dotstar)
CIRCUITPY_PIXELBUF = 0
# Requires OS
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/8086_commander/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ EXTERNAL_FLASH_DEVICES = "W25Q128JVxQ"
LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0

CIRCUITPY_GAMEPAD = 1
CIRCUITPY_BUSDEVICE = 1
CIRCUITPY_KEYPAD = 1

# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ LONGINT_IMPL = NONE

# To keep the build small
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_KEYPAD = 0

# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH
Expand Down
15 changes: 7 additions & 8 deletions ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,36 @@ INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE

CIRCUITPY_FULL_BUILD = 0

CIRCUIPTY_USB_CDC = 0
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_AUDIOPWMIO = 0
CIRCUITPY_AUDIOMP3 = 0
CIRCUITPY_AUDIOPWMIO = 0
CIRCUITPY_BITBANGIO = 0
CIRCUITPY_BITBANG_APA102 = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_GAMEPADSHIFT = 0
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_PIXELBUF = 0
CIRCUITPY_PS2IO = 0
CIRCUITPY_PULSEIO = 0
CIRCUITPY_PWMIO = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
CIRCUITPY_SAMD = 0
CIRCUITPY_TOUCHIO = 0
CIRCUIPTY_USB_CDC = 0
CIRCUITPY_USB_HID = 0
CIRCUITPY_USB_MIDI = 0
CIRCUITPY_VECTORIO = 0
CIRCUITPY_GAMEPAD = 0
CIRCUITPY_PWMIO = 0

CIRCUITPY_ANALOGIO = 1
CIRCUITPY_AUDIOMIXER = 1
CIRCUITPY_AUDIOIO = 1
CIRCUITPY_SYNTHIO = 1
CIRCUITPY_AUDIOMIXER = 1
CIRCUITPY_DISPLAYIO = 1
CIRCUITPY_KEYPAD = 1
CIRCUITPY_MATH = 1
CIRCUITPY_STAGE = 1
CIRCUITPY_KEYPAD = 1
CIRCUITPY_SYNTHIO = 1

FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pewpew_m4
CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf
Expand Down
1 change: 0 additions & 1 deletion ports/atmel-samd/boards/pybadge/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = GD25Q16C
LONGINT_IMPL = MPZ

CIRCUITPY_GAMEPAD = 1
CIRCUITPY_GAMEPADSHIFT = 1
CIRCUITPY_STAGE = 1

Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/pycubed/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ CIRCUITPY_DRIVE_LABEL = "PYCUBED"
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_BITMAPTOOLS = 0
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_KEYPAD = 0
CIRCUITPY_FRAMEBUFFERIO = 0
CIRCUITPY_KEYPAD = 0
CIRCUITPY_RGBMATRIX = 0
CIRCUITPY_PS2IO = 0

Expand Down
1 change: 0 additions & 1 deletion ports/atmel-samd/boards/pygamer/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = GD25Q64C
LONGINT_IMPL = MPZ

CIRCUITPY_GAMEPAD = 1
CIRCUITPY_GAMEPADSHIFT = 1
CIRCUITPY_STAGE = 1

Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/ugame10/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ CIRCUITPY_STAGE = 1
CIRCUITPY_MATH = 1
CIRCUITPY_AUDIOIO = 1
CIRCUITPY_ANALOGIO = 1
CIRCUITPY_GAMEPAD = 1
CIRCUITPY_DISPLAYIO = 1
CIRCUITPY_KEYPPAD = 1

CIRCUITPY_PULSEIO = 0
CIRCUITPY_AUDIOBUSIO = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_BLEIO = 0
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_KEYPAD = 0
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_RGBMATRIX = 0
Expand Down
1 change: 1 addition & 0 deletions ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ CIRCUITPY_BITMAPTOOLS = 0
CIRCUITPY_BLEIO_HCI = 0
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_FRAMEBUFFERIO = 0
CIRCUITPY_KEYPAD = 0
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_RGBMATRIX = 0
Expand Down
6 changes: 0 additions & 6 deletions ports/atmel-samd/supervisor/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@

#include "tusb.h"

#if CIRCUITPY_GAMEPAD
#include "shared-module/gamepad/__init__.h"
#endif
#if CIRCUITPY_GAMEPADSHIFT
#include "shared-module/gamepadshift/__init__.h"
#endif
Expand Down Expand Up @@ -358,9 +355,6 @@ void reset_port(void) {

reset_gclks();

#if CIRCUITPY_GAMEPAD
gamepad_reset();
#endif
#if CIRCUITPY_GAMEPADSHIFT
gamepadshift_reset();
#endif
Expand Down
2 changes: 1 addition & 1 deletion ports/cxd56/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ CIRCUITPY_CAMERA = 1
CIRCUITPY_COUNTIO = 0
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_GAMEPAD = 0
CIRCUITPY_GNSS = 1
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_KEYPAD = 0
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_NVM = 0
CIRCUITPY_ROTARYIO = 0
Expand Down
6 changes: 0 additions & 6 deletions ports/mimxrt10xx/supervisor/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@

#include "tusb.h"

#if CIRCUITPY_GAMEPAD
#include "shared-module/gamepad/__init__.h"
#endif
#if CIRCUITPY_GAMEPADSHIFT
#include "shared-module/gamepadshift/__init__.h"
#endif
Expand Down Expand Up @@ -300,9 +297,6 @@ void reset_port(void) {
rtc_reset();
#endif

#if CIRCUITPY_GAMEPAD
gamepad_reset();
#endif
#if CIRCUITPY_GAMEPADSHIFT
gamepadshift_reset();
#endif
Expand Down
1 change: 0 additions & 1 deletion ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ MCU_CHIP = nrf52840
INTERNAL_FLASH_FILESYSTEM = 1
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_DISPLAYIO = 1
CIRCUITPY_GAMEPAD = 1
CIRCUITPY_STAGE = 1
26 changes: 0 additions & 26 deletions ports/nrf/boards/pca10056/examples/buttons.py

This file was deleted.

5 changes: 0 additions & 5 deletions ports/nrf/supervisor/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include "nrf/power.h"
#include "nrf/timers.h"

#include "shared-module/gamepad/__init__.h"
#include "common-hal/microcontroller/Pin.h"
#include "common-hal/_bleio/__init__.h"
#include "common-hal/analogio/AnalogIn.h"
Expand Down Expand Up @@ -207,10 +206,6 @@ safe_mode_t port_init(void) {
}

void reset_port(void) {
#ifdef CIRCUITPY_GAMEPAD_TICKS
gamepad_reset();
#endif

#if CIRCUITPY_BUSIO
i2c_reset();
spi_reset();
Expand Down
6 changes: 1 addition & 5 deletions py/circuitpy_defns.mk
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,7 @@ endif
ifeq ($(CIRCUITPY_FREQUENCYIO),1)
SRC_PATTERNS += frequencyio/%
endif
ifeq ($(CIRCUITPY_GAMEPAD),1)
SRC_PATTERNS += gamepad/%
endif

ifeq ($(CIRCUITPY_GAMEPADSHIFT),1)
SRC_PATTERNS += gamepadshift/%
endif
Expand Down Expand Up @@ -523,8 +521,6 @@ SRC_SHARED_MODULE_ALL = \
keypad/Keys.c \
sdcardio/SDCard.c \
sdcardio/__init__.c \
gamepad/GamePad.c \
gamepad/__init__.c \
gamepadshift/GamePadShift.c \
gamepadshift/__init__.c \
memorymonitor/__init__.c \
Expand Down
14 changes: 3 additions & 11 deletions py/circuitpy_mpconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,21 +468,14 @@ extern const struct _mp_obj_module_t frequencyio_module;
#define FREQUENCYIO_MODULE
#endif

#if CIRCUITPY_GAMEPAD
extern const struct _mp_obj_module_t gamepad_module;
#define GAMEPAD_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_gamepad),(mp_obj_t)&gamepad_module },
#else
#define GAMEPAD_MODULE
#endif

#if CIRCUITPY_GAMEPADSHIFT
extern const struct _mp_obj_module_t gamepadshift_module;
#define GAMEPADSHIFT_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_gamepadshift),(mp_obj_t)&gamepadshift_module },
#else
#define GAMEPADSHIFT_MODULE
#endif

#if CIRCUITPY_GAMEPAD || CIRCUITPY_GAMEPADSHIFT
#if CIRCUITPY_GAMEPADSHIFT
// Scan gamepad every 32ms
#define CIRCUITPY_GAMEPAD_TICKS 0x1f
#define GAMEPAD_ROOT_POINTERS mp_obj_t gamepad_singleton;
Expand Down Expand Up @@ -539,8 +532,8 @@ extern const struct _mp_obj_module_t keypad_module;
#define KEYPAD_ROOT_POINTERS
#endif

#if CIRCUITPY_GAMEPAD || CIRCUITPY_GAMEPADSHIFT
// Scan gamepad every 32ms
#if CIRCUITPY_GAMEPADSHIFT
// Scan gamepadshift every 32ms
#define CIRCUITPY_GAMEPAD_TICKS 0x1f
#define GAMEPAD_ROOT_POINTERS mp_obj_t gamepad_singleton;
#else
Expand Down Expand Up @@ -888,7 +881,6 @@ extern const struct _mp_obj_module_t msgpack_module;
_EVE_MODULE \
FRAMEBUFFERIO_MODULE \
FREQUENCYIO_MODULE \
GAMEPAD_MODULE \
GAMEPADSHIFT_MODULE \
GNSS_MODULE \
I2CPERIPHERAL_MODULE \
Expand Down
3 changes: 0 additions & 3 deletions py/circuitpy_mpconfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,6 @@ CFLAGS += -DCIRCUITPY__EVE=$(CIRCUITPY__EVE)
CIRCUITPY_FREQUENCYIO ?= $(CIRCUITPY_FULL_BUILD)
CFLAGS += -DCIRCUITPY_FREQUENCYIO=$(CIRCUITPY_FREQUENCYIO)

CIRCUITPY_GAMEPAD ?= 0
CFLAGS += -DCIRCUITPY_GAMEPAD=$(CIRCUITPY_GAMEPAD)

CIRCUITPY_GAMEPADSHIFT ?= 0
CFLAGS += -DCIRCUITPY_GAMEPADSHIFT=$(CIRCUITPY_GAMEPADSHIFT)

Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cpp-coveralls
Sphinx<4
sphinx-rtd-theme
myst-parser
sphinx-autoapi
sphinx-autoapi<=1.8.1
sphinxcontrib-svg2pdfconverter
readthedocs-sphinx-search

Expand Down
Loading