Skip to content

Commit 1e4fdf7

Browse files
committed
FLAC decoder patch
By uncommenting "#define USEFLAC" in VS1003_STM.h the FLAC patch will be loaded at begin time.
1 parent 3b2c87d commit 1e4fdf7

3 files changed

Lines changed: 1089 additions & 0 deletions

File tree

STM32F1/libraries/Serasidis_VS1003B_STM/src/VS1003_STM.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@
1010
email: avrsite@yahoo.gr
1111
29 May 2015 - Added a fix for booting the VS1053B boards into
1212
mp3 decoding instead of booting into MID (modeSwitch function).
13+
01 July 2015 - Added a Flac decoder patch.
1314
*/
1415

1516
//#include <my_SPI.h>
1617
#include <VS1003_STM.h>
1718

19+
#if defined(USEFLAC)
20+
#include "flac.h"
21+
#endif
22+
1823
#define vs1003_chunk_size 32
1924
/****************************************************************************/
2025

@@ -237,6 +242,9 @@ void VS1003::begin(void)
237242
write_register(SCI_MODE, (1<<SM_SDINEW) | (1<<SM_RESET));
238243
delay(1);
239244
await_data_request();
245+
#if defined(USEFLAC)
246+
loadUserCode(flac_patch,FLAC_PATCHLEN);
247+
#endif
240248
//write_register(SCI_CLOCKF,0xB800); // Experimenting with higher clock settings
241249
write_register(SCI_CLOCKF,0x6000);
242250
delay(1);

STM32F1/libraries/Serasidis_VS1003B_STM/src/VS1003_STM.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
email: avrsite@yahoo.gr
1111
1212
29 May 2015 - Added a fix for booting the VS1053B boards into mp3 decoding instead of booting into MIDI.
13+
01 July 2015 - Added a Flac decoder patch.
1314
*/
1415

1516
//This is an additional test line
@@ -20,6 +21,8 @@
2021
// C headers
2122
// Framework headers
2223

24+
//#define USEFLAC
25+
2326
#include <Arduino.h>
2427
#include <SPI.h>
2528
/**

0 commit comments

Comments
 (0)