diff options
| author | Jeff Epler <jepler@gmail.com> | 2020-06-21 08:31:26 -0500 |
|---|---|---|
| committer | Jeff Epler <jepler@gmail.com> | 2020-06-22 10:45:27 -0500 |
| commit | a580f0f1c4f2a221ddf3ff169eff79158bd8acf6 (patch) | |
| tree | 98264d9b671610d7dac713911f1eac7661110a01 | |
| parent | 5a3a0a50924e8306690769b0683f836cb9608145 (diff) | |
_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.
| -rw-r--r-- | ports/atmel-samd/common-hal/_pew/PewPew.c (renamed from shared-module/_pew/PewPew.c) | 0 | ||||
| -rw-r--r-- | ports/atmel-samd/common-hal/_pew/PewPew.h (renamed from shared-module/_pew/PewPew.h) | 0 | ||||
| -rw-r--r-- | ports/atmel-samd/common-hal/_pew/__init__.c (renamed from shared-module/_pew/__init__.c) | 0 | ||||
| -rw-r--r-- | ports/atmel-samd/common-hal/_pew/__init__.h (renamed from shared-module/_pew/__init__.h) | 0 | ||||
| -rw-r--r-- | ports/atmel-samd/supervisor/port.c | 4 | ||||
| -rw-r--r-- | ports/atmel-samd/timer_handler.c | 2 | ||||
| -rw-r--r-- | ports/mimxrt10xx/supervisor/port.c | 2 | ||||
| -rw-r--r-- | py/circuitpy_defns.mk | 4 | ||||
| -rw-r--r-- | shared-bindings/_pew/PewPew.c | 2 | ||||
| -rw-r--r-- | shared-bindings/_pew/__init__.c | 2 |
10 files changed, 10 insertions, 6 deletions
diff --git a/shared-module/_pew/PewPew.c b/ports/atmel-samd/common-hal/_pew/PewPew.c index 568dc6425..568dc6425 100644 --- a/shared-module/_pew/PewPew.c +++ b/ports/atmel-samd/common-hal/_pew/PewPew.c diff --git a/shared-module/_pew/PewPew.h b/ports/atmel-samd/common-hal/_pew/PewPew.h index da1cae0a2..da1cae0a2 100644 --- a/shared-module/_pew/PewPew.h +++ b/ports/atmel-samd/common-hal/_pew/PewPew.h diff --git a/shared-module/_pew/__init__.c b/ports/atmel-samd/common-hal/_pew/__init__.c index f3b23c606..f3b23c606 100644 --- a/shared-module/_pew/__init__.c +++ b/ports/atmel-samd/common-hal/_pew/__init__.c diff --git a/shared-module/_pew/__init__.h b/ports/atmel-samd/common-hal/_pew/__init__.h index 4f953c610..4f953c610 100644 --- a/shared-module/_pew/__init__.h +++ b/ports/atmel-samd/common-hal/_pew/__init__.h diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 2b3e9826f..74c984997 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -85,7 +85,9 @@ #if CIRCUITPY_GAMEPADSHIFT #include "shared-module/gamepadshift/__init__.h" #endif -#include "shared-module/_pew/PewPew.h" +#if CIRCUITPY_PEW +#include "common-hal/_pew/PewPew.h" +#endif extern volatile bool mp_msc_enabled; diff --git a/ports/atmel-samd/timer_handler.c b/ports/atmel-samd/timer_handler.c index 34d819e16..16d65334e 100644 --- a/ports/atmel-samd/timer_handler.c +++ b/ports/atmel-samd/timer_handler.c @@ -31,7 +31,7 @@ #include "common-hal/pulseio/PulseIn.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" extern void _PM_IRQ_HANDLER(void); diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index ed5824732..0b53a79f0 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -53,7 +53,9 @@ #if CIRCUITPY_GAMEPADSHIFT #include "shared-module/gamepadshift/__init__.h" #endif +#if CIRCUITPY_PEW #include "shared-module/_pew/PewPew.h" +#endif #include "supervisor/shared/tick.h" #include "clocks.h" diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 67fbde6e4..cdfb4c6b6 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -259,6 +259,8 @@ SRC_COMMON_HAL_ALL = \ _bleio/PacketBuffer.c \ _bleio/Service.c \ _bleio/UUID.c \ + _pew/__init__.c \ + _pew/PewPew.c \ analogio/AnalogIn.c \ analogio/AnalogOut.c \ analogio/__init__.c \ @@ -396,8 +398,6 @@ SRC_SHARED_MODULE_ALL = \ terminalio/__init__.c \ uheap/__init__.c \ ustack/__init__.c \ - _pew/__init__.c \ - _pew/PewPew.c \ _eve/__init__.c # All possible sources are listed here, and are filtered by SRC_PATTERNS. diff --git a/shared-bindings/_pew/PewPew.c b/shared-bindings/_pew/PewPew.c index 82bf04a61..352ef38f2 100644 --- a/shared-bindings/_pew/PewPew.c +++ b/shared-bindings/_pew/PewPew.c @@ -31,7 +31,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/util.h" #include "PewPew.h" -#include "shared-module/_pew/PewPew.h" +#include "common-hal/_pew/PewPew.h" #include "supervisor/shared/translate.h" //| class PewPew: diff --git a/shared-bindings/_pew/__init__.c b/shared-bindings/_pew/__init__.c index 6e0070d8e..498beaf1c 100644 --- a/shared-bindings/_pew/__init__.c +++ b/shared-bindings/_pew/__init__.c @@ -27,7 +27,7 @@ #include "py/runtime.h" #include "py/mphal.h" #include "PewPew.h" -#include "shared-module/_pew/PewPew.h" +#include "common-hal/_pew/PewPew.h" STATIC mp_obj_t get_pressed(void) { pew_obj_t *pew = MP_STATE_VM(pew_singleton); |
