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 {
2323 // set dac channel
2424 audio_hal_dac_output_t output_device = AUDIOKIT_DEFAULT_OUTPUT;
2525 int masterclock_pin = 0 ;
26- bool sd_active = false ;
26+ bool sd_active = true ;
2727 bool default_actions_active = true ;
2828
2929 // / convert to config object needed by HAL
@@ -40,6 +40,7 @@ class AudioKitStreamConfig : public I2SConfig {
4040 result.sample_rate = toSampleRate ();
4141 result.bits_per_sample = toBits ();
4242 result.sd_active = sd_active;
43+ LOGW (" sd_active = %s" , sd_active ? " true" : " false" );
4344 return result;
4445 }
4546
@@ -536,8 +537,14 @@ class AudioKitStream : public AudioStreamX {
536537 // / Setup the supported default actions
537538 void setupActions () {
538539 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+
539546 // pin conflicts with AIThinker A101 and headphone detection
540- if (! (cfg.sd_active && AUDIOKIT_BOARD==6 )) {
547+ if (! (cfg.sd_active && AUDIOKIT_BOARD==6 )) {
541548 actions.add (kit.pinHeadphoneDetect (), actionHeadphoneDetection);
542549 } else {
543550 LOGW (" Headphone detection ignored because of conflict: %d " ,kit.pinHeadphoneDetect ());
You can’t perform that action at this time.
0 commit comments