Merge pull request #669 from python-ugame/gamepad3

gamepad: Enable the gamepad module for express boards in 3.x
This commit is contained in:
Dan Halbert 2018-03-12 15:32:40 -04:00 committed by GitHub
commit ae3021bc9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -194,10 +194,10 @@ extern const struct _mp_obj_module_t usb_hid_module;
#define CIRCUITPY_GAMEPAD_TICKS 0x1f
#define EXTRA_BUILTIN_MODULES \
{ MP_OBJ_NEW_QSTR(MP_QSTR_bitbangio), (mp_obj_t)&bitbangio_module }
{ MP_OBJ_NEW_QSTR(MP_QSTR_bitbangio), (mp_obj_t)&bitbangio_module }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_gamepad),(mp_obj_t)&gamepad_module }
// { MP_OBJ_NEW_QSTR(MP_QSTR_audioio), (mp_obj_t)&audioio_module },
// { MP_OBJ_NEW_QSTR(MP_QSTR_audiobusio), (mp_obj_t)&audiobusio_module },
// { MP_OBJ_NEW_QSTR(MP_QSTR_gamepad),(mp_obj_t)&gamepad_module },
#define EXPRESS_BOARD
#else
#define MICROPY_PY_BUILTINS_REVERSED (0)

View File

@ -52,6 +52,10 @@
#include "shared_dma.h"
#include "tick.h"
#ifdef CIRCUITPY_GAMEPAD_TICKS
#include "shared-module/gamepad/__init__.h"
#endif
extern volatile bool mp_msc_enabled;
#if defined(SAMD21) && defined(ENABLE_MICRO_TRACE_BUFFER)
@ -198,10 +202,10 @@ void reset_port(void) {
analogin_reset();
// #ifdef CIRCUITPY_GAMEPAD_TICKS
// gamepad_reset();
// #endif
//
#ifdef CIRCUITPY_GAMEPAD_TICKS
gamepad_reset();
#endif
analogout_reset();
reset_all_pins();