mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-06-19 04:15:06 +00:00
Fix for SpiSdCardDevice
This commit is contained in:
parent
48f9ed4d73
commit
60120c7ff9
@ -21,11 +21,16 @@ static const auto LOGGER = Logger("SpiSdCardDevice");
|
|||||||
bool SpiSdCardDevice::applyGpioWorkAround() {
|
bool SpiSdCardDevice::applyGpioWorkAround() {
|
||||||
LOGGER.info("applyGpioWorkAround");
|
LOGGER.info("applyGpioWorkAround");
|
||||||
|
|
||||||
uint64_t pin_bit_mask = BIT64(config->spiPinCs);
|
uint64_t pin_bit_mask = config->spiPinCs != GPIO_NUM_NC ? BIT64(config->spiPinCs) : 0;
|
||||||
for (auto const& pin: config->csPinWorkAround) {
|
for (auto const& pin: config->csPinWorkAround) {
|
||||||
pin_bit_mask |= BIT64(pin);
|
pin_bit_mask |= BIT64(pin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Nothing to do
|
||||||
|
if (pin_bit_mask == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!gpio::configureWithPinBitmask(pin_bit_mask, gpio::Mode::Output, false, false)) {
|
if (!gpio::configureWithPinBitmask(pin_bit_mask, gpio::Mode::Output, false, false)) {
|
||||||
LOGGER.error("GPIO work-around failed");
|
LOGGER.error("GPIO work-around failed");
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user