Skip to content

Commit f93022b

Browse files
committed
Two tweaks to mclk
1 parent 8c5c73d commit f93022b

File tree

2 files changed

+6
-4
lines changed
  • ports/mimxrt10xx/common-hal/audiobusio
  • shared-bindings/audiobusio

2 files changed

+6
-4
lines changed

ports/mimxrt10xx/common-hal/audiobusio/I2SOut.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,12 @@ void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t *self) {
131131
common_hal_reset_pin(self->data);
132132
self->data = NULL;
133133

134-
IOMUXC_GPR->GPR1 &= ~(IOMUXC_GPR_GPR1_SAI1_MCLK_DIR_MASK << (self->instance - 1));
134+
if (self->mclk != NULL) {
135+
IOMUXC_GPR->GPR1 &= ~(IOMUXC_GPR_GPR1_SAI1_MCLK_DIR_MASK << (self->instance - 1));
135136

136-
common_hal_reset_pin(self->mclk);
137-
self->mclk = NULL;
137+
common_hal_reset_pin(self->mclk);
138+
self->mclk = NULL;
139+
}
138140
}
139141

140142
void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t *self,

shared-bindings/audiobusio/I2SOut.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
//| word_select: microcontroller.Pin,
4545
//| data: microcontroller.Pin,
4646
//| *,
47-
//| main_clock: microcontroller.Pin = None,
47+
//| main_clock: Optional[microcontroller.Pin] = None,
4848
//| left_justified: bool = False
4949
//| ) -> None:
5050
//| """Create a I2SOut object associated with the given pins.

0 commit comments

Comments
 (0)