Skip to content

Commit 696117b

Browse files
committed
disable audiomixer on boards it doesn't fit on
1 parent 7f64af3 commit 696117b

6 files changed

Lines changed: 22 additions & 0 deletions

File tree

ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ LONGINT_IMPL = MPZ
1414

1515
CFLAGS_INLINE_LIMIT = 60
1616
SUPEROPT_GC = 0
17+
18+
CIRCUITPY_AUDIOMIXER = 0

ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ LONGINT_IMPL = MPZ
1414

1515
CFLAGS_INLINE_LIMIT = 60
1616
SUPEROPT_GC = 0
17+
18+
CIRCUITPY_AUDIOMIXER = 0

ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ LONGINT_IMPL = MPZ
1414

1515
CFLAGS_INLINE_LIMIT = 60
1616
SUPEROPT_GC = 0
17+
18+
CIRCUITPY_AUDIOMIXER = 0

ports/atmel-samd/boards/snekboard/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ LONGINT_IMPL = MPZ
1414

1515
CFLAGS_INLINE_LIMIT = 60
1616
SUPEROPT_GC = 0
17+
18+
CIRCUITPY_AUDIOMIXER = 0

ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ LONGINT_IMPL = MPZ
1414

1515
CFLAGS_INLINE_LIMIT = 60
1616
SUPEROPT_GC = 0
17+
18+
CIRCUITPY_AUDIOMIXER = 0

shared-module/audiocore/__init__.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ uint32_t audiosample_sample_rate(mp_obj_t sample_obj) {
4242
} else if (MP_OBJ_IS_TYPE(sample_obj, &audioio_wavefile_type)) {
4343
audioio_wavefile_obj_t* file = MP_OBJ_TO_PTR(sample_obj);
4444
return file->sample_rate;
45+
#if CIRCUITPY_AUDIOMIXER
4546
} else if (MP_OBJ_IS_TYPE(sample_obj, &audiomixer_mixer_type)) {
4647
audiomixer_mixer_obj_t* mixer = MP_OBJ_TO_PTR(sample_obj);
4748
return mixer->sample_rate;
49+
#endif
4850
}
4951
return 16000;
5052
}
@@ -56,9 +58,11 @@ uint8_t audiosample_bits_per_sample(mp_obj_t sample_obj) {
5658
} else if (MP_OBJ_IS_TYPE(sample_obj, &audioio_wavefile_type)) {
5759
audioio_wavefile_obj_t* file = MP_OBJ_TO_PTR(sample_obj);
5860
return file->bits_per_sample;
61+
#if CIRCUITPY_AUDIOMIXER
5962
} else if (MP_OBJ_IS_TYPE(sample_obj, &audiomixer_mixer_type)) {
6063
audiomixer_mixer_obj_t* mixer = MP_OBJ_TO_PTR(sample_obj);
6164
return mixer->bits_per_sample;
65+
#endif
6266
}
6367
return 8;
6468
}
@@ -70,9 +74,11 @@ uint8_t audiosample_channel_count(mp_obj_t sample_obj) {
7074
} else if (MP_OBJ_IS_TYPE(sample_obj, &audioio_wavefile_type)) {
7175
audioio_wavefile_obj_t* file = MP_OBJ_TO_PTR(sample_obj);
7276
return file->channel_count;
77+
#if CIRCUITPY_AUDIOMIXER
7378
} else if (MP_OBJ_IS_TYPE(sample_obj, &audiomixer_mixer_type)) {
7479
audiomixer_mixer_obj_t* mixer = MP_OBJ_TO_PTR(sample_obj);
7580
return mixer->channel_count;
81+
#endif
7682
}
7783
return 1;
7884
}
@@ -84,9 +90,11 @@ void audiosample_reset_buffer(mp_obj_t sample_obj, bool single_channel, uint8_t
8490
} else if (MP_OBJ_IS_TYPE(sample_obj, &audioio_wavefile_type)) {
8591
audioio_wavefile_obj_t* file = MP_OBJ_TO_PTR(sample_obj);
8692
audioio_wavefile_reset_buffer(file, single_channel, audio_channel);
93+
#if CIRCUITPY_AUDIOMIXER
8794
} else if (MP_OBJ_IS_TYPE(sample_obj, &audiomixer_mixer_type)) {
8895
audiomixer_mixer_obj_t* file = MP_OBJ_TO_PTR(sample_obj);
8996
audiomixer_mixer_reset_buffer(file, single_channel, audio_channel);
97+
#endif
9098
}
9199
}
92100

@@ -100,9 +108,11 @@ audioio_get_buffer_result_t audiosample_get_buffer(mp_obj_t sample_obj,
100108
} else if (MP_OBJ_IS_TYPE(sample_obj, &audioio_wavefile_type)) {
101109
audioio_wavefile_obj_t* file = MP_OBJ_TO_PTR(sample_obj);
102110
return audioio_wavefile_get_buffer(file, single_channel, channel, buffer, buffer_length);
111+
#if CIRCUITPY_AUDIOMIXER
103112
} else if (MP_OBJ_IS_TYPE(sample_obj, &audiomixer_mixer_type)) {
104113
audiomixer_mixer_obj_t* file = MP_OBJ_TO_PTR(sample_obj);
105114
return audiomixer_mixer_get_buffer(file, single_channel, channel, buffer, buffer_length);
115+
#endif
106116
}
107117
return GET_BUFFER_DONE;
108118
}
@@ -118,9 +128,11 @@ void audiosample_get_buffer_structure(mp_obj_t sample_obj, bool single_channel,
118128
audioio_wavefile_obj_t* file = MP_OBJ_TO_PTR(sample_obj);
119129
audioio_wavefile_get_buffer_structure(file, single_channel, single_buffer, samples_signed,
120130
max_buffer_length, spacing);
131+
#if CIRCUITPY_AUDIOMIXER
121132
} else if (MP_OBJ_IS_TYPE(sample_obj, &audiomixer_mixer_type)) {
122133
audiomixer_mixer_obj_t* file = MP_OBJ_TO_PTR(sample_obj);
123134
audiomixer_mixer_get_buffer_structure(file, single_channel, single_buffer, samples_signed,
124135
max_buffer_length, spacing);
136+
#endif
125137
}
126138
}

0 commit comments

Comments
 (0)