return callback handler

This commit is contained in:
Siwat Sirichai 2023-12-31 13:32:38 +07:00
parent 5f6e586945
commit 724f8f42e9
8 changed files with 20 additions and 15 deletions

View file

@ -157,9 +157,10 @@ uint8_t DigitalInputCard::getInputBufferB()
return inputBufferB_rearranged;
}
// Register a callback function to be called when a pin changes
void DigitalInputCard::registerCallback(std::function<void(uint8_t, bool)> callback)
uint8_t DigitalInputCard::registerCallback(std::function<void(uint8_t, bool)> callback)
{
callbacks[this->callbacks_handler_index++] = callback;
callbacks[this->callbacks_handler_index] = callback;
return this->callbacks_handler_index++;
}
// Refresh the input buffer for bank A