missing DACs no longer cause analog card to fails

This commit is contained in:
Siwat Sirichai 2024-04-01 22:36:53 +07:00
parent 667823d598
commit a9871315f2
1 changed files with 5 additions and 5 deletions

View File

@ -133,26 +133,26 @@ uint16_t AnalogCard::analogRead(uint8_t pin)
*/ */
bool AnalogCard::begin() bool AnalogCard::begin()
{ {
bool success = true; bool success = false;
if (!this->dac0.begin()) if (!this->dac0.begin())
{ {
ESP_LOGE("AnalogCard", "Card Analog ERROR: Failed to install DAC0"); ESP_LOGE("AnalogCard", "Card Analog ERROR: Failed to install DAC0");
success = false; // success = false;
} }
if (!this->dac1.begin()) if (!this->dac1.begin())
{ {
ESP_LOGE("AnalogCard", "Card Analog ERROR: Failed to install DAC1"); ESP_LOGE("AnalogCard", "Card Analog ERROR: Failed to install DAC1");
success = false; // success = false;
} }
if (!this->dac2.begin()) if (!this->dac2.begin())
{ {
ESP_LOGE("AnalogCard", "Card Analog ERROR: Failed to install DAC2"); ESP_LOGE("AnalogCard", "Card Analog ERROR: Failed to install DAC2");
success = false; // success = false;
} }
if (!this->dac3.begin()) if (!this->dac3.begin())
{ {
ESP_LOGE("AnalogCard", "Card Analog ERROR: Failed to install DAC3"); ESP_LOGE("AnalogCard", "Card Analog ERROR: Failed to install DAC3");
success = false; // success = false;
} }
if (!this->analogInputBankA.begin(ANALOG_INPUT_BANK_A_ADDRESS)) if (!this->analogInputBankA.begin(ANALOG_INPUT_BANK_A_ADDRESS))
{ {