Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
Restore pinSpiCs() method
Browse files Browse the repository at this point in the history
  • Loading branch information
pschatzmann committed Sep 25, 2023
1 parent c6de256 commit 0a935d3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/AudioKitHAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,14 @@ class AudioKit {
*/
int8_t pinBlueLed() { return driver.get_blue_led_gpio(); }

/**
* @brief SPI CS Pin for SD Drive
*
* @return int8_t
*/
int8_t pinSpiCs() { return cfg.pins.sd_cs; }


/**
* @brief Activates/deactivates the speaker amplifier output
* This is working only if the driver is supporting the functionality
Expand Down Expand Up @@ -575,7 +583,6 @@ class AudioKit {
audio_hal_codec_config_t audio_hal_conf;
audio_hal_handle_t hal_handle = 0;
audio_hal_codec_i2s_iface_t iface;
int8_t spi_cs_pin;
bool headphoneIsConnected = false;
unsigned long speakerChangeTimeout = 0;
board_driver driver;
Expand Down Expand Up @@ -614,8 +621,8 @@ class AudioKit {
// I assume this is valid for all AudioKits!
#if AUDIOKIT_SETUP_SD == 1
if (cfg.sd_active) {
spi_cs_pin = cfg.pins.sd_cs;
if (spi_cs_pin!=1){
int spi_cs_pin = cfg.pins.sd_cs;
if (spi_cs_pin != -1){
KIT_LOGI("SPI: cs: %d", spi_cs_pin);
pinMode(spi_cs_pin, OUTPUT);
digitalWrite(spi_cs_pin, HIGH);
Expand Down

0 comments on commit 0a935d3

Please sign in to comment.