Skip to content

Commit

Permalink
Update library_api.md
Browse files Browse the repository at this point in the history
  • Loading branch information
pjueon authored Nov 15, 2023
1 parent 8816a3c commit 9eb2cb9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/library_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Any object that satisfies the following requirements can be used as a callback f
- Callable with a `const std::string&` type argument (for the channel name) **OR** without any argument. The return type must be `void`.
> [!NOTE]
> If the callback object is **not only** callable with a `const std::string&` type argument **but also** callable without any argument, the method with a `const std::string&` type argument will be used as a callback function.
> If the callback object is *not only* callable with a `const std::string&` type argument *but also* callable without any argument, the method with a `const std::string&` type argument will be used as a callback function.
- Copy-constructible
- Equality-comparable with same type (ex> `func0 == func1`)
Expand Down Expand Up @@ -282,7 +282,8 @@ GPIO::add_event_callback(channel, callback_one);
GPIO::add_event_callback(channel, callback_two);
```
The two callbacks in this case are run sequentially, not concurrently since there is only one event thread running all callback functions.
> [!NOTE]
> The two callbacks in this case are run sequentially, not concurrently since there is only one event thread running all callback functions.
In order to prevent multiple calls to the callback functions by collapsing multiple events in to a single one, a debounce time can be optionally set:
Expand Down

0 comments on commit 9eb2cb9

Please sign in to comment.