code format

This commit is contained in:
2022-12-14 14:13:52 +03:00
parent 430a41fefc
commit c2b8a8d6da
297 changed files with 27331 additions and 24162 deletions

View File

@@ -3,24 +3,24 @@
* \~\brief
* \~english GPIO
* \~russian GPIO
*/
*/
/*
PIP - Platform Independent Primitives
GPIO
Andrey Bychkov work.a.b@yandex.ru, Ivan Pelipenko peri4ko@yandex.ru
PIP - Platform Independent Primitives
GPIO
Andrey Bychkov work.a.b@yandex.ru, Ivan Pelipenko peri4ko@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PIGPIO_H
@@ -33,15 +33,14 @@
//! \~\brief
//! \~english GPIO support.
//! \~russian Поддержка GPIO.
class PIP_EXPORT PIGPIO: public PIThread
{
class PIP_EXPORT PIGPIO: public PIThread {
PIOBJECT_SUBCLASS(PIGPIO, PIThread);
public:
public:
//! \~english Work mode for pin
//! \~russian Режим работы пина
enum Direction {
In /** \~english Input direction (read) \~russian Входной (чтение) */,
In /** \~english Input direction (read) \~russian Входной (чтение) */,
Out /** \~english Output direction (write) \~russian Выходной (запись) */
};
@@ -55,15 +54,15 @@ public:
//! \~english Set pin "gpio_num" value to "value"
//! \~russian Устанавливает значение пина "gpio_num" в "value"
void pinSet (int gpio_num, bool value);
void pinSet(int gpio_num, bool value);
//! \~english Set pin "gpio_num" value to \b true
//! \~russian Устанавливает значение пина "gpio_num" в \b true
void pinHigh (int gpio_num) {pinSet(gpio_num, true );}
void pinHigh(int gpio_num) { pinSet(gpio_num, true); }
//! \~english Set pin "gpio_num" value to \b false
//! \~russian Устанавливает значение пина "gpio_num" в \b false
void pinLow (int gpio_num) {pinSet(gpio_num, false);}
void pinLow(int gpio_num) { pinSet(gpio_num, false); }
//!
//! \~english Returns pin "gpio_num" state
@@ -76,7 +75,7 @@ public:
//! \~english End watch for pin "gpio_num"
//! \~russian Заканчивает наблюдение за пином "gpio_num"
void pinEndWatch (int gpio_num);
void pinEndWatch(int gpio_num);
//! \~english End watch for all pins
//! \~russian Заканчивает наблюдение за всеми пинами
@@ -87,13 +86,13 @@ public:
//! \events
//! \{
//! \fn void pinChanged(int gpio_num, bool new_value)
//! \~english Raise on pin "gpio_num" state changes to "new_value"
//! \~russian Вызывается по смене состояния пина "gpio_num" на "new_value"
//! \~\details
//! \~\warning
//! \~english This event raised only when thread started.
//! \~russian Это событие вызывается только при запущенном потоке.
//! \fn void pinChanged(int gpio_num, bool new_value)
//! \~english Raise on pin "gpio_num" state changes to "new_value"
//! \~russian Вызывается по смене состояния пина "gpio_num" на "new_value"
//! \~\details
//! \~\warning
//! \~english This event raised only when thread started.
//! \~russian Это событие вызывается только при запущенном потоке.
//! \}
@@ -103,7 +102,10 @@ private:
NO_COPY_CLASS(PIGPIO);
struct PIP_EXPORT GPIOData {
GPIOData() {dir = PIGPIO::In; num = fd = -1;}
GPIOData() {
dir = PIGPIO::In;
num = fd = -1;
}
PIString name;
int dir;
int num;
@@ -121,7 +123,6 @@ private:
PIMap<int, GPIOData> gpio_;
PIMap<int, bool> watch_state;
PIMutex mutex;
};