summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-03-30 10:15:09 +1100
committerjacqueline <me@jacqueline.id.au>2023-03-30 10:15:09 +1100
commit9799ab458d8ad870aaec048abf5b1b1d93aa7aff (patch)
treeb69def86bb0c6a3a7b4c85610b8eca704fe48ad9
parenta0ae39befe11c2a5a78ee5877cd5dd9cda90e27c (diff)
downloadtangara-fw-9799ab458d8ad870aaec048abf5b1b1d93aa7aff.tar.gz
fix sd card on for dev + mux pin
-rw-r--r--src/drivers/include/gpio_expander.hpp8
-rw-r--r--src/main/main.cpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/drivers/include/gpio_expander.hpp b/src/drivers/include/gpio_expander.hpp
index 86998e7e..d53a1982 100644
--- a/src/drivers/include/gpio_expander.hpp
+++ b/src/drivers/include/gpio_expander.hpp
@@ -42,9 +42,9 @@ class GpioExpander {
// 4 - key lock
// 5 - display reset
// 6 - NC
- // 7 - sd card power
+ // 7 - sd card power (active low)
// Default to SD card off, inputs high.
- static const uint8_t kPortADefault = 0b00011110;
+ static const uint8_t kPortADefault = 0b10011110;
// Port B:
// 0 - trs output enable
@@ -121,8 +121,8 @@ class GpioExpander {
/* Nicer value names for use with the SD_MUX_SWITCH pin. */
enum SdController {
- SD_MUX_ESP = 1,
- SD_MUX_SAMD = 0,
+ SD_MUX_ESP = 0,
+ SD_MUX_SAMD = 1,
};
/**
diff --git a/src/main/main.cpp b/src/main/main.cpp
index 57d88f96..692b97fb 100644
--- a/src/main/main.cpp
+++ b/src/main/main.cpp
@@ -105,7 +105,7 @@ extern "C" void app_main(void) {
gpio.set_pin(drivers::GpioExpander::SD_MUX_EN_ACTIVE_LOW, 0);
gpio.set_pin(drivers::GpioExpander::SD_MUX_SWITCH,
drivers::GpioExpander::SD_MUX_ESP);
- gpio.set_pin(drivers::GpioExpander::SD_CARD_POWER_ENABLE, 1);
+ gpio.set_pin(drivers::GpioExpander::SD_CARD_POWER_ENABLE, 0);
});
ESP_LOGI(TAG, "Init battery measurement");