Skip to content

Commit a580f0f

Browse files
committed
_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.
1 parent 5a3a0a5 commit a580f0f

File tree

10 files changed

+10
-6
lines changed

10 files changed

+10
-6
lines changed

ports/atmel-samd/supervisor/port.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@
8585
#if CIRCUITPY_GAMEPADSHIFT
8686
#include "shared-module/gamepadshift/__init__.h"
8787
#endif
88-
#include "shared-module/_pew/PewPew.h"
88+
#if CIRCUITPY_PEW
89+
#include "common-hal/_pew/PewPew.h"
90+
#endif
8991

9092
extern volatile bool mp_msc_enabled;
9193

ports/atmel-samd/timer_handler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#include "common-hal/pulseio/PulseIn.h"
3333
#include "common-hal/pulseio/PulseOut.h"
34-
#include "shared-module/_pew/PewPew.h"
34+
#include "common-hal/_pew/PewPew.h"
3535
#include "common-hal/frequencyio/FrequencyIn.h"
3636

3737
extern void _PM_IRQ_HANDLER(void);

ports/mimxrt10xx/supervisor/port.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353
#if CIRCUITPY_GAMEPADSHIFT
5454
#include "shared-module/gamepadshift/__init__.h"
5555
#endif
56+
#if CIRCUITPY_PEW
5657
#include "shared-module/_pew/PewPew.h"
58+
#endif
5759
#include "supervisor/shared/tick.h"
5860

5961
#include "clocks.h"

py/circuitpy_defns.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ SRC_COMMON_HAL_ALL = \
259259
_bleio/PacketBuffer.c \
260260
_bleio/Service.c \
261261
_bleio/UUID.c \
262+
_pew/__init__.c \
263+
_pew/PewPew.c \
262264
analogio/AnalogIn.c \
263265
analogio/AnalogOut.c \
264266
analogio/__init__.c \
@@ -396,8 +398,6 @@ SRC_SHARED_MODULE_ALL = \
396398
terminalio/__init__.c \
397399
uheap/__init__.c \
398400
ustack/__init__.c \
399-
_pew/__init__.c \
400-
_pew/PewPew.c \
401401
_eve/__init__.c
402402

403403
# All possible sources are listed here, and are filtered by SRC_PATTERNS.

shared-bindings/_pew/PewPew.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "shared-bindings/digitalio/DigitalInOut.h"
3232
#include "shared-bindings/util.h"
3333
#include "PewPew.h"
34-
#include "shared-module/_pew/PewPew.h"
34+
#include "common-hal/_pew/PewPew.h"
3535
#include "supervisor/shared/translate.h"
3636

3737
//| class PewPew:

shared-bindings/_pew/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "py/runtime.h"
2828
#include "py/mphal.h"
2929
#include "PewPew.h"
30-
#include "shared-module/_pew/PewPew.h"
30+
#include "common-hal/_pew/PewPew.h"
3131

3232
STATIC mp_obj_t get_pressed(void) {
3333
pew_obj_t *pew = MP_STATE_VM(pew_singleton);

0 commit comments

Comments
 (0)