diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2019-04-15 15:40:06 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2019-04-15 15:40:06 -0700 |
| commit | c927e6b938ff35fe0f42180d1dc0f9d58f8e571c (patch) | |
| tree | 7be059364206e22823c099bd6c5870dc1fd78392 /py | |
| parent | eeef5359f90fc3fa8b4b736d8f751b034a448167 (diff) | |
Split GamePadShift from GamePad to save space on most boards.
Diffstat (limited to 'py')
| -rw-r--r-- | py/circuitpy_defns.mk | 7 | ||||
| -rw-r--r-- | py/circuitpy_mpconfig.h | 8 | ||||
| -rw-r--r-- | py/circuitpy_mpconfig.mk | 5 |
3 files changed, 19 insertions, 1 deletions
diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 41c73430f..be7ff0b11 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -131,6 +131,10 @@ SRC_PATTERNS += frequencyio/% endif ifeq ($(CIRCUITPY_GAMEPAD),1) SRC_PATTERNS += gamepad/% + # gamepadshift depends on gamepad + ifeq ($(CIRCUITPY_GAMEPADSHIFT),1) + SRC_PATTERNS += gamepadshift/% + endif endif ifeq ($(CIRCUITPY_I2CSLAVE),1) SRC_PATTERNS += i2cslave/% @@ -317,8 +321,9 @@ $(filter $(SRC_PATTERNS), \ fontio/BuiltinFont.c \ fontio/__init__.c \ gamepad/GamePad.c \ - gamepad/GamePadShift.c \ gamepad/__init__.c \ + gamepadshift/GamePadShift.c \ + gamepadshift/__init__.c \ os/__init__.c \ random/__init__.c \ socket/__init__.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 441dd5bad..3952b5e06 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -322,6 +322,13 @@ extern const struct _mp_obj_module_t gamepad_module; #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_I2CSLAVE extern const struct _mp_obj_module_t i2cslave_module; #define I2CSLAVE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_i2cslave), (mp_obj_t)&i2cslave_module }, @@ -554,6 +561,7 @@ extern const struct _mp_obj_module_t ustack_module; ERRNO_MODULE \ FREQUENCYIO_MODULE \ GAMEPAD_MODULE \ + GAMEPADSHIFT_MODULE \ I2CSLAVE_MODULE \ JSON_MODULE \ MATH_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 8ea72f0bf..b436929e0 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -102,6 +102,11 @@ CIRCUITPY_GAMEPAD = $(CIRCUITPY_FULL_BUILD) endif CFLAGS += -DCIRCUITPY_GAMEPAD=$(CIRCUITPY_GAMEPAD) +ifndef CIRCUITPY_GAMEPADSHIFT +CIRCUITPY_GAMEPADSHIFT = 0 +endif +CFLAGS += -DCIRCUITPY_GAMEPADSHIFT=$(CIRCUITPY_GAMEPADSHIFT) + ifndef CIRCUITPY_I2CSLAVE CIRCUITPY_I2CSLAVE = $(CIRCUITPY_FULL_BUILD) endif |
