Skip to content

Commit

Permalink
Merge pull request #48 from electro-smith/patch_sm_audio_fix
Browse files Browse the repository at this point in the history
Fix patch sm audio
  • Loading branch information
beserge authored Aug 5, 2022
2 parents aeb60c6 + 6d46478 commit eb2964f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions src/AudioClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,27 @@ const PinMap PinMap_I2C_SCL[] = {
#endif //ifdef HAL_I2C_MODULE_ENABLED
#endif // ifdef ARDUINO_DAISY_SEED

// workaround for broken patch sm audio
#ifdef ARDUINO_DAISY_PATCH_SM
#ifdef HAL_I2C_MODULE_ENABLED
const PinMap PinMap_I2C_SDA[] = {
// {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
// {PB_7_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)},
{PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
{PB_9_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)},
{PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
{PC_9, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
// {PD_13, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)},
{PF_0, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
{PF_15, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)},
{PH_5, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
{PH_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
{PH_12, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)},
{NC, NP, 0}
};
#endif //ifdef HAL_I2C_MODULE_ENABLED
#endif // ifdef ARDUINO_DAISY_PATCH_SM

using namespace daisy;

dsy_gpio ak4556_reset_pin;
Expand Down
2 changes: 1 addition & 1 deletion src/utility/codec_pcm3060.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Pcm3060::Result Pcm3060::ReadRegister(uint8_t addr, uint8_t* data)
_wire->write(addr);
_wire->endTransmission(false);
_wire->requestFrom(dev_addr_ >> 1, 1);
*data = Wire.read();
*data = _wire->read();

return Result::OK;
}
Expand Down

0 comments on commit eb2964f

Please sign in to comment.