File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -24,9 +24,13 @@ class AudioSourceLittleFS : public AudioSource {
24
24
virtual bool begin () override {
25
25
TRACED ();
26
26
if (!is_sd_setup) {
27
+ int retry = 10 ;
27
28
while (!LittleFS.begin ()) {
28
29
LOGE (" LittleFS.begin failed" );
29
- delay (1000 );
30
+ delay (500 );
31
+ if (--retry >= 0 ) {
32
+ return false ;
33
+ }
30
34
}
31
35
is_sd_setup = true ;
32
36
}
Original file line number Diff line number Diff line change @@ -56,9 +56,13 @@ class AudioSourceSD : public AudioSource {
56
56
virtual bool begin () override {
57
57
TRACED ();
58
58
if (!is_sd_setup) {
59
+ int retry = 10 ;
59
60
while (!start_sd ()) {
60
61
LOGE (" SD.begin cs=%d failed" , cs);
61
- delay (1000 );
62
+ delay (500 );
63
+ if (--retry <= 0 ) {
64
+ return false ;
65
+ }
62
66
}
63
67
is_sd_setup = true ;
64
68
}
You can’t perform that action at this time.
0 commit comments