From 196a87d47b786a7067447365906a48d4fae33f34 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Sun, 10 Mar 2024 00:57:16 +0700 Subject: [PATCH] change analogcard init behavior --- ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/AnalogCard.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/AnalogCard.cpp b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/AnalogCard.cpp index b74f748..ce769b4 100644 --- a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/AnalogCard.cpp +++ b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/AnalogCard.cpp @@ -133,37 +133,38 @@ uint16_t AnalogCard::analogRead(uint8_t pin) */ bool AnalogCard::begin() { + bool success = true; if (!this->dac0.begin()) { ESP_LOGE("AnalogCard", "Card Analog ERROR: Failed to install DAC0"); - return false; + success = false; } if (!this->dac1.begin()) { ESP_LOGE("AnalogCard", "Card Analog ERROR: Failed to install DAC1"); - return false; + success = false; } if (!this->dac2.begin()) { ESP_LOGE("AnalogCard", "Card Analog ERROR: Failed to install DAC2"); - return false; + success = false; } if (!this->dac3.begin()) { ESP_LOGE("AnalogCard", "Card Analog ERROR: Failed to install DAC3"); - return false; + success = false; } if (!this->analogInputBankA.begin()) { ESP_LOGE("AnalogCard", "Card Analog ERROR: Failed to install analog input bank A"); - return false; + success = false; } if (!this->analogInputBankB.begin()) { ESP_LOGE("AnalogCard", "Card Analog ERROR: Failed to install analog input bank B"); - return false; + success = false; } - return true; + return success; } /**