Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update docs #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ Example

Suppose we have set up two I/O interfaces named ``Serial`` and
``SerialUSB``, we serve the same methods on both interfaces by grouping
pointers to these interfaces with the ``pack()`` function as follows.
pointers to these interfaces with the ``makeTuple()`` function as follows.

.. code-block:: cpp

void loop() {
interface(
pack(&Serial, &SerialUSB),
makeTuple(&Serial, &SerialUSB),
inc, F("inc: Increment a value. @a: Value. @return: a + 1."));
}

Expand Down
6 changes: 3 additions & 3 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ Exporting class methods
Class methods are different from ordinary functions in the sense that they
always operate on an object. This is why both a function pointer and a class
instance need to be provided to the ``interface()`` function. To facilitate
this, the ``pack()`` function can be used to combine a class instance and a
this, the ``makeTuple()`` function can be used to combine a class instance and a
function pointer before passing them to ``interface()``.

For a class instance ``c`` of class ``C``, the class method ``f()``
can be packed as follows:

.. code-block:: cpp

pack(&c, &C::f)
makeTuple(&c, &C::f)

The result can be passed to ``interface()``.

Expand All @@ -157,7 +157,7 @@ Exporting this class method goes as follows:
void loop() {
interface(
Serial,
pack(&led, &LED::setBrightness),
makeTuple(&led, &LED::setBrightness),
"set_led: Set LED brightness. @brightness: Brightness.");
}

Expand Down