_pew: move to common-hal

I noticed that this code was referring to samd-specific functionality,
and isn't enabled except in one samd board (pewpew10).  Move it.

There is incomplte support for _pew in mimxrt10xx which then caused build
errors; adding a #if guard to check for _pew being enabled fixes it.
The _pew module is not likely to be important on mimxrt but I'll leave the
choice to remove it to someone else.
This commit is contained in:
Jeff Epler 2020-06-21 08:31:26 -05:00
parent 5a3a0a5092
commit a580f0f1c4
10 changed files with 10 additions and 6 deletions

View File

@ -85,7 +85,9 @@
#if CIRCUITPY_GAMEPADSHIFT #if CIRCUITPY_GAMEPADSHIFT
#include "shared-module/gamepadshift/__init__.h" #include "shared-module/gamepadshift/__init__.h"
#endif #endif
#include "shared-module/_pew/PewPew.h" #if CIRCUITPY_PEW
#include "common-hal/_pew/PewPew.h"
#endif
extern volatile bool mp_msc_enabled; extern volatile bool mp_msc_enabled;

View File

@ -31,7 +31,7 @@
#include "common-hal/pulseio/PulseIn.h" #include "common-hal/pulseio/PulseIn.h"
#include "common-hal/pulseio/PulseOut.h" #include "common-hal/pulseio/PulseOut.h"
#include "shared-module/_pew/PewPew.h" #include "common-hal/_pew/PewPew.h"
#include "common-hal/frequencyio/FrequencyIn.h" #include "common-hal/frequencyio/FrequencyIn.h"
extern void _PM_IRQ_HANDLER(void); extern void _PM_IRQ_HANDLER(void);

View File

@ -53,7 +53,9 @@
#if CIRCUITPY_GAMEPADSHIFT #if CIRCUITPY_GAMEPADSHIFT
#include "shared-module/gamepadshift/__init__.h" #include "shared-module/gamepadshift/__init__.h"
#endif #endif
#if CIRCUITPY_PEW
#include "shared-module/_pew/PewPew.h" #include "shared-module/_pew/PewPew.h"
#endif
#include "supervisor/shared/tick.h" #include "supervisor/shared/tick.h"
#include "clocks.h" #include "clocks.h"

View File

@ -259,6 +259,8 @@ SRC_COMMON_HAL_ALL = \
_bleio/PacketBuffer.c \ _bleio/PacketBuffer.c \
_bleio/Service.c \ _bleio/Service.c \
_bleio/UUID.c \ _bleio/UUID.c \
_pew/__init__.c \
_pew/PewPew.c \
analogio/AnalogIn.c \ analogio/AnalogIn.c \
analogio/AnalogOut.c \ analogio/AnalogOut.c \
analogio/__init__.c \ analogio/__init__.c \
@ -396,8 +398,6 @@ SRC_SHARED_MODULE_ALL = \
terminalio/__init__.c \ terminalio/__init__.c \
uheap/__init__.c \ uheap/__init__.c \
ustack/__init__.c \ ustack/__init__.c \
_pew/__init__.c \
_pew/PewPew.c \
_eve/__init__.c _eve/__init__.c
# All possible sources are listed here, and are filtered by SRC_PATTERNS. # All possible sources are listed here, and are filtered by SRC_PATTERNS.

View File

@ -31,7 +31,7 @@
#include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/digitalio/DigitalInOut.h"
#include "shared-bindings/util.h" #include "shared-bindings/util.h"
#include "PewPew.h" #include "PewPew.h"
#include "shared-module/_pew/PewPew.h" #include "common-hal/_pew/PewPew.h"
#include "supervisor/shared/translate.h" #include "supervisor/shared/translate.h"
//| class PewPew: //| class PewPew:

View File

@ -27,7 +27,7 @@
#include "py/runtime.h" #include "py/runtime.h"
#include "py/mphal.h" #include "py/mphal.h"
#include "PewPew.h" #include "PewPew.h"
#include "shared-module/_pew/PewPew.h" #include "common-hal/_pew/PewPew.h"
STATIC mp_obj_t get_pressed(void) { STATIC mp_obj_t get_pressed(void) {
pew_obj_t *pew = MP_STATE_VM(pew_singleton); pew_obj_t *pew = MP_STATE_VM(pew_singleton);