diff --git a/doc/examples/piiodevice.cpp b/doc/examples/piiodevice.cpp index fbcb2840..200077de 100644 --- a/doc/examples/piiodevice.cpp +++ b/doc/examples/piiodevice.cpp @@ -26,17 +26,23 @@ void _() { }; REGISTER_DEVICE(SomeIO) //! [0] + + // clang-format off + //! [configure] // file example.conf - dev.reopenEnabled = false dev.device = / dev / ttyS0 dev.speed = 9600 - // end example.conf - // code - PISerial ser; + dev.reopenEnabled = false + dev.device = /dev/ttyS0 + dev.speed = 9600 + // end example.conf + // code + PISerial ser; ser.configure("example.conf", "dev"); //! [configure] //! [configureDevice] class SomeIO: public PIIODevice { - ... bool configureDevice(const void * e_main, const void * e_parent) override { + ... + bool configureDevice(const void * e_main, const void * e_parent) override { PIConfig::Entry * em = (PIConfig::Entry *)e_main; PIConfig::Entry * ep = (PIConfig::Entry *)e_parent; setStringParam(readDeviceSetting("stringParam", stringParam(), em, ep)); @@ -46,4 +52,6 @@ void _() { ... }; //! [configureDevice] + + // clang-format on };