Skip to content

Commit

Permalink
i2s audio driver: fix conflict with GPIO0 due to default 0 for .mck_i…
Browse files Browse the repository at this point in the history
…o_num (#147)

In the i2s_pin_config_t that's passed to i2s_set_pin, .mck_io_num was not
initialized to GPIO_NUM_NC, so it defaulted to 0. Which matches the GPIO that
the Fri3D Camp 2024 Badge is using for the START button, resulting in "START"
being pressed constantly, which caused it to loop through the emulators.
  • Loading branch information
tomvanbraeckel authored Aug 2, 2024
1 parent 55be9c1 commit e9733bd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/retro-go/drivers/audio/i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ static bool driver_init(int device, int sample_rate)
if (ret == ESP_OK)
{
ret = i2s_set_pin(I2S_NUM_0, &(i2s_pin_config_t) {
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0) // mck_io_num isn't present in esp-idf <= 4.3
.mck_io_num = GPIO_NUM_NC, // must be initialized to prevent it from defaulting to (GPIO_NUM_)0, which would interfere with other uses of that pin
#endif
.bck_io_num = RG_GPIO_SND_I2S_BCK,
.ws_io_num = RG_GPIO_SND_I2S_WS,
.data_out_num = RG_GPIO_SND_I2S_DATA,
Expand Down

0 comments on commit e9733bd

Please sign in to comment.