Skip to content

Commit c71b511

Browse files
committed
USB_DRIVE_NAME is too long to be accepted as a FAT USB drive name, use USB_DRIVE instead.
1 parent eb43c3e commit c71b511

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/Beginner/Audio_Playback/Audio_Playback.ino

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* GIGA R1 - Audio Playback
33
* Simple wav format audio playback via 12-Bit DAC output by reading from a USB drive.
4-
* In order for this sketch to work you need to rename 'USB_DRIVE_NAME' to the name of your USB stick drive.
4+
* In order for this sketch to work you need to rename 'USB_DRIVE' to the name of your USB stick drive.
55
*/
66

77
#include <USBHostMbed5.h>
@@ -13,7 +13,7 @@
1313
AdvancedDAC dac1(A12);
1414

1515
USBHostMSD msd;
16-
mbed::FATFileSystem usb("USB_DRIVE_NAME");
16+
mbed::FATFileSystem usb("USB_DRIVE");
1717

1818
void setup()
1919
{
@@ -29,7 +29,7 @@ void setup()
2929
delay(1000);
3030

3131
Serial.println("Mounting USB device ...");
32-
int const rc_mount = usb.mount(&msd);
32+
int const rc_mount = usb.mount(&msd);
3333
if (rc_mount)
3434
{
3535
Serial.print("Error mounting USB device ");
@@ -40,7 +40,7 @@ void setup()
4040
Serial.println("Opening audio file ...");
4141

4242
// 16-bit PCM Mono 16kHz realigned noise reduction
43-
FILE * f = fopen("/USB_DRIVE_NAME/AUDIO_SAMPLE.wav", "r+");
43+
FILE * f = fopen("/USB_DRIVE/AUDIO_SAMPLE.wav", "r+");
4444
if (f == nullptr)
4545
{
4646
Serial.print("Error opening audio file: ");

0 commit comments

Comments
 (0)