File tree Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change
1
+ #include " Arduino.h"
2
+
3
+ /* *
4
+ * @brief Pin Tests for AudioKit
5
+ *
6
+ */
7
+
8
+ void setup () {
9
+ Serial.begin (115200 );
10
+ for (int j=10 ;j<=36 ;j++){
11
+ pinMode (j, INPUT_PULLUP);
12
+ }
13
+ }
14
+
15
+ void loop () {
16
+ for (int j=10 ;j<=36 ;j++){
17
+ int value = digitalRead (j);
18
+ Serial.print (value ? " -" :" +" );
19
+ }
20
+ Serial.println ();
21
+ delay (1000 );
22
+ }
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class AudioKitStreamConfig : public I2SConfig {
23
23
// set dac channel
24
24
audio_hal_dac_output_t output_device = AUDIOKIT_DEFAULT_OUTPUT;
25
25
int masterclock_pin = 0 ;
26
- bool sd_active = false ;
26
+ bool sd_active = true ;
27
27
bool default_actions_active = true ;
28
28
29
29
// / convert to config object needed by HAL
@@ -40,6 +40,7 @@ class AudioKitStreamConfig : public I2SConfig {
40
40
result.sample_rate = toSampleRate ();
41
41
result.bits_per_sample = toBits ();
42
42
result.sd_active = sd_active;
43
+ LOGW (" sd_active = %s" , sd_active ? " true" : " false" );
43
44
return result;
44
45
}
45
46
@@ -536,8 +537,14 @@ class AudioKitStream : public AudioStreamX {
536
537
// / Setup the supported default actions
537
538
void setupActions () {
538
539
LOGI (LOG_METHOD);
540
+ // SPI might have been activated
541
+ if (!cfg.sd_active ){
542
+ LOGW (" Deactivating SPI because SD is not active" );
543
+ SPI.end ();
544
+ }
545
+
539
546
// pin conflicts with AIThinker A101 and headphone detection
540
- if (! (cfg.sd_active && AUDIOKIT_BOARD==6 )) {
547
+ if (! (cfg.sd_active && AUDIOKIT_BOARD==6 )) {
541
548
actions.add (kit.pinHeadphoneDetect (), actionHeadphoneDetection);
542
549
} else {
543
550
LOGW (" Headphone detection ignored because of conflict: %d " ,kit.pinHeadphoneDetect ());
You can’t perform that action at this time.
0 commit comments