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
230
230
// Store default i2c address to pins
231
231
setupI2CAddress ();
232
232
233
- p_pins->setSPIActiveForSD (codec_cfg.sd_active );
233
+ AD_LOGI (" sd_active: %d" , codecCfg.sd_active );
234
+ p_pins->setSPIActiveForSD (codecCfg.sd_active );
234
235
if (!p_pins->begin ())
235
236
{
236
237
AD_LOGE (" AudioBoard::pins::begin failed" );
Original file line number Diff line number Diff line change @@ -422,11 +422,16 @@ class DriverPins {
422
422
}
423
423
424
424
void end () {
425
- // setup spi
425
+ // close spi
426
426
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 {
427
431
tmp.end ();
432
+ }
428
433
}
429
- // setup i2c
434
+ // close i2c
430
435
for (auto &tmp : i2c) {
431
436
AD_LOGD (" DriverPins::begin::I2C::end" );
432
437
tmp.end ();
You can’t perform that action at this time.
0 commit comments