change logging method

This commit is contained in:
Siwat Sirichai 2023-12-30 18:47:52 +07:00
parent b5806498ea
commit 53937dd0ed
8 changed files with 58 additions and 39 deletions

View file

@ -34,11 +34,11 @@ bool DigitalInputCard::begin()
this->inputBankA = PCF8574(this->address_a);
this->inputBankB = PCF8574(this->address_b);
if (!this->inputBankA.begin()) {
Serial.println("Input Card ERROR: Failed to install input bank A");
ESP_LOGE("DigitalInputCard", "Input Card ERROR: Failed to install input bank A");
return false;
}
if (!this->inputBankB.begin()) {
Serial.println("Input Card ERROR: Failed to install input bank B");
ESP_LOGE("DigitalInputCard", "Input Card ERROR: Failed to install input bank B");
return false;
}
// Set the debounce time for all pins to 50ms
@ -158,9 +158,9 @@ uint8_t DigitalInputCard::getInputBufferB()
// Register a callback function to be called when a pin changes
void DigitalInputCard::registerCallback(std::function<void(uint8_t, bool)> callback)
{
Serial.println("Pushing back on Input Card Callbacks");
ESP_LOGD("DigitalInputCard", "Registering callback");
callbacks.push_back(callback);
Serial.println("Pushed back on Input Card Callbacks");
ESP_LOGD("DigitalInputCard", "Callback registered");
}
// Refresh the input buffer for bank A