Skip to content

Commit

Permalink
fix: VS1053b initialisation on NV14/EL18 (#4108)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelcoeffic authored Sep 25, 2023
1 parent 1d5c7e2 commit 1cc1810
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions radio/src/targets/common/arm/stm32/vs1053b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ uint8_t audioHardReset(void)
delay_ms(100); // 100ms
RST_HIGH();

if (!audioWaitDreq(100))
if (!audioWaitDreq(5000))
return 0;

delay_ms(20); // 20ms
Expand All @@ -249,12 +249,15 @@ uint8_t audioSoftReset(void)

audioSpiReadWriteByte(0x00); // start the transfer

audioSpiWriteCmd(SPI_MODE, 0x0816); // SOFT RESET, new model
if (!audioWaitDreq(100))
return 0;
uint8_t retry = 0;
uint16_t mode = SM_SDINEW | SM_EARSPEAKER_LO;
while (audioSpiReadReg(SPI_MODE) != mode && retry < 100) {
retry++;
audioSpiWriteCmd(SPI_MODE, mode | SM_RESET);
}

// wait for set up successful
uint8_t retry = 0;
retry = 0;
while (audioSpiReadReg(SPI_CLOCKF) != 0x9800 && retry < 100) {
retry++;
audioSpiWriteCmd(SPI_CLOCKF, 0x9800);
Expand Down

0 comments on commit 1cc1810

Please sign in to comment.