modified for VS1033
Dependents: 11U68_MP3Player with TFTLCD 11U68_MP3Player-with-TFTLCD Mp3_1
Fork of VS1033 by
Diff: VS1053.cpp
- Revision:
- 8:171effe49517
- Parent:
- 7:b61cd12eabc5
- Child:
- 9:1dd0ecaac8e5
--- a/VS1053.cpp Sat Jul 11 19:42:28 2015 +0000 +++ b/VS1053.cpp Thu Jul 16 12:42:50 2015 +0000 @@ -146,29 +146,16 @@ * @return Zero at failure, non-zero at success. */ bool VS1053::stop() { - uint16_t reg; - uint8_t endFillByte; size_t n, length; - - // If SM_CANCEL is still set, do nothing - reg = readReg(SCI_MODE); - if (reg & 0x0008) { - return false; - } - - // Read endFillByte from XRAM <1E06h> - writeReg(SCI_WRAMADDR, 0x1e06); - reg = readReg(SCI_WRAM); - - // Send lower 8 bits of endFillByte 2,052 times - endFillByte = reg & 0xff; - length = 2052; + + // Send 0 2056 times + length = 257; while (length) { n = length < 32 ? length : 32; sdi_en(); while (!dreq); for (uint32_t i = 0; i < n; i++) { - spi.write(endFillByte); + spi.write(0x00); length--; } sdi_dis();