File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,8 @@ namespace audio_driver
230230 // Store default i2c address to pins
231231 setupI2CAddress ();
232232
233- p_pins->setSPIActiveForSD (codec_cfg.sd_active );
233+ AD_LOGI (" sd_active: %d" , codecCfg.sd_active );
234+ p_pins->setSPIActiveForSD (codecCfg.sd_active );
234235 if (!p_pins->begin ())
235236 {
236237 AD_LOGE (" AudioBoard::pins::begin failed" );
Original file line number Diff line number Diff line change @@ -422,11 +422,16 @@ class DriverPins {
422422 }
423423
424424 void end () {
425- // setup spi
425+ // close spi
426426 for (auto &tmp : spi) {
427+ // close SD only when sd_active
428+ if (tmp.function == PinFunction::SD) {
429+ if (sd_active) tmp.end ();
430+ } else {
427431 tmp.end ();
432+ }
428433 }
429- // setup i2c
434+ // close i2c
430435 for (auto &tmp : i2c) {
431436 AD_LOGD (" DriverPins::begin::I2C::end" );
432437 tmp.end ();
You can’t perform that action at this time.
0 commit comments