Skip to content

Commit d99d3bd

Browse files
authored
Merge pull request #2010 from jepler/audiocore
audiocore: Factor from audioio
2 parents 8ec2d6c + 485f06e commit d99d3bd

28 files changed

+333
-186
lines changed

ports/atmel-samd/audio_dma.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
#include "samd/events.h"
3030
#include "samd/dma.h"
3131

32-
#include "shared-bindings/audioio/RawSample.h"
33-
#include "shared-bindings/audioio/WaveFile.h"
32+
#include "shared-bindings/audiocore/RawSample.h"
33+
#include "shared-bindings/audiocore/WaveFile.h"
3434

3535
#include "py/mpstate.h"
3636
#include "py/runtime.h"

ports/atmel-samd/audio_dma.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
#include "extmod/vfs_fat.h"
3131
#include "py/obj.h"
32-
#include "shared-module/audioio/RawSample.h"
33-
#include "shared-module/audioio/WaveFile.h"
32+
#include "shared-module/audiocore/RawSample.h"
33+
#include "shared-module/audiocore/WaveFile.h"
3434

3535
typedef struct {
3636
mp_obj_t sample;

ports/atmel-samd/common-hal/audiobusio/I2SOut.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "py/runtime.h"
3434
#include "common-hal/audiobusio/I2SOut.h"
3535
#include "shared-bindings/audiobusio/I2SOut.h"
36-
#include "shared-bindings/audioio/RawSample.h"
36+
#include "shared-bindings/audiocore/RawSample.h"
3737
#include "shared-bindings/microcontroller/Pin.h"
3838
#include "supervisor/shared/translate.h"
3939

py/circuitpy_defns.mk

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ endif
108108
ifeq ($(CIRCUITPY_AUDIOIO),1)
109109
SRC_PATTERNS += audioio/%
110110
endif
111+
ifeq ($(CIRCUITPY_AUDIOCORE),1)
112+
SRC_PATTERNS += audiocore/%
113+
endif
111114
ifeq ($(CIRCUITPY_BITBANGIO),1)
112115
SRC_PATTERNS += bitbangio/%
113116
endif
@@ -301,9 +304,10 @@ $(filter $(SRC_PATTERNS), \
301304
_stage/Text.c \
302305
_stage/__init__.c \
303306
audioio/__init__.c \
304-
audioio/Mixer.c \
305-
audioio/RawSample.c \
306-
audioio/WaveFile.c \
307+
audiocore/__init__.c \
308+
audiocore/Mixer.c \
309+
audiocore/RawSample.c \
310+
audiocore/WaveFile.c \
307311
bitbangio/I2C.c \
308312
bitbangio/OneWire.c \
309313
bitbangio/SPI.c \

py/circuitpy_mpconfig.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,13 @@ extern const struct _mp_obj_module_t audiobusio_module;
230230
#define AUDIOBUSIO_MODULE
231231
#endif
232232

233+
#if CIRCUITPY_AUDIOCORE
234+
#define AUDIOCORE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_audiocore), (mp_obj_t)&audiocore_module },
235+
extern const struct _mp_obj_module_t audiocore_module;
236+
#else
237+
#define AUDIOCORE_MODULE
238+
#endif
239+
233240
#if CIRCUITPY_AUDIOIO
234241
#define AUDIOIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_audioio), (mp_obj_t)&audioio_module },
235242
extern const struct _mp_obj_module_t audioio_module;
@@ -564,6 +571,7 @@ extern const struct _mp_obj_module_t ustack_module;
564571
#define MICROPY_PORT_BUILTIN_MODULES_STRONG_LINKS \
565572
ANALOGIO_MODULE \
566573
AUDIOBUSIO_MODULE \
574+
AUDIOCORE_MODULE \
567575
AUDIOIO_MODULE \
568576
BITBANGIO_MODULE \
569577
BLEIO_MODULE \

py/circuitpy_mpconfig.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ CIRCUITPY_AUDIOIO = $(CIRCUITPY_FULL_BUILD)
7474
endif
7575
CFLAGS += -DCIRCUITPY_AUDIOIO=$(CIRCUITPY_AUDIOIO)
7676

77+
ifndef CIRCUITPY_AUDIOCORE
78+
CIRCUITPY_AUDIOCORE = $(CIRCUITPY_AUDIOIO)
79+
endif
80+
CFLAGS += -DCIRCUITPY_AUDIOCORE=$(CIRCUITPY_AUDIOCORE)
81+
7782
ifndef CIRCUITPY_BITBANGIO
7883
CIRCUITPY_BITBANGIO = $(CIRCUITPY_FULL_BUILD)
7984
endif

shared-bindings/audioio/Mixer.c renamed to shared-bindings/audiocore/Mixer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424
* THE SOFTWARE.
2525
*/
26-
#include "shared-bindings/audioio/Mixer.h"
26+
#include "shared-bindings/audiocore/Mixer.h"
2727

2828
#include <stdint.h>
2929

@@ -32,7 +32,7 @@
3232
#include "py/objproperty.h"
3333
#include "py/runtime.h"
3434
#include "shared-bindings/microcontroller/Pin.h"
35-
#include "shared-bindings/audioio/RawSample.h"
35+
#include "shared-bindings/audiocore/RawSample.h"
3636
#include "shared-bindings/util.h"
3737
#include "supervisor/shared/translate.h"
3838

shared-bindings/audioio/Mixer.h renamed to shared-bindings/audiocore/Mixer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
#define MICROPY_INCLUDED_SHARED_BINDINGS_AUDIOIO_MIXER_H
2929

3030
#include "common-hal/microcontroller/Pin.h"
31-
#include "shared-module/audioio/Mixer.h"
32-
#include "shared-bindings/audioio/RawSample.h"
31+
#include "shared-module/audiocore/Mixer.h"
32+
#include "shared-bindings/audiocore/RawSample.h"
3333

3434
extern const mp_obj_type_t audioio_mixer_type;
3535

shared-bindings/audioio/RawSample.c renamed to shared-bindings/audiocore/RawSample.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
#include "py/objproperty.h"
3232
#include "py/runtime.h"
3333
#include "shared-bindings/microcontroller/Pin.h"
34-
#include "shared-bindings/audioio/AudioOut.h"
3534
#include "shared-bindings/util.h"
35+
#include "shared-bindings/audiocore/RawSample.h"
3636
#include "supervisor/shared/translate.h"
3737

3838
//| .. currentmodule:: audioio

shared-bindings/audioio/RawSample.h renamed to shared-bindings/audiocore/RawSample.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@
2727
#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_AUDIOIO_RAWSAMPLE_H
2828
#define MICROPY_INCLUDED_SHARED_BINDINGS_AUDIOIO_RAWSAMPLE_H
2929

30-
#include "common-hal/audioio/AudioOut.h"
3130
#include "common-hal/microcontroller/Pin.h"
32-
#include "shared-module/audioio/RawSample.h"
31+
#include "shared-module/audiocore/RawSample.h"
3332

3433
extern const mp_obj_type_t audioio_rawsample_type;
3534

0 commit comments

Comments
 (0)