mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
Lint
This commit is contained in:
+14
-7
@@ -24,30 +24,37 @@ void GPIO::configure_pin(Direction dir, uint8_t gpio)
|
|||||||
m_offset = gpio;
|
m_offset = gpio;
|
||||||
if (dir == Direction::Output)
|
if (dir == Direction::Output)
|
||||||
{
|
{
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
m_request = std::make_unique<gpiod::line_request>(
|
m_request = std::make_unique<gpiod::line_request>(
|
||||||
::gpiod::chip(chip_path)
|
::gpiod::chip(chip_path)
|
||||||
.prepare_request()
|
.prepare_request()
|
||||||
.set_consumer("unisim_cpp")
|
.set_consumer("unisim_cpp")
|
||||||
.add_line_settings(m_offset, ::gpiod::line_settings().set_direction(::gpiod::line::direction::OUTPUT))
|
.add_line_settings(m_offset,
|
||||||
|
::gpiod::line_settings().set_direction(::gpiod::line::direction::OUTPUT))
|
||||||
.do_request());
|
.do_request());
|
||||||
} catch (...) {
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
SPDLOG_CRITICAL("Could not set gpio {} as output, run binary as root", gpio);
|
SPDLOG_CRITICAL("Could not set gpio {} as output, run binary as root", gpio);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dir == Direction::Input)
|
if (dir == Direction::Input)
|
||||||
{
|
{
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
m_request = std::make_unique<gpiod::line_request>(
|
m_request = std::make_unique<gpiod::line_request>(
|
||||||
::gpiod::chip(chip_path)
|
::gpiod::chip(chip_path)
|
||||||
.prepare_request()
|
.prepare_request()
|
||||||
.set_consumer("unisim_cpp")
|
.set_consumer("unisim_cpp")
|
||||||
.add_line_settings(m_offset, ::gpiod::line_settings().set_direction(::gpiod::line::direction::INPUT))
|
.add_line_settings(m_offset,
|
||||||
|
::gpiod::line_settings().set_direction(::gpiod::line::direction::INPUT))
|
||||||
.do_request());
|
.do_request());
|
||||||
} catch (...) {
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
SPDLOG_CRITICAL("Could not set gpio {} as input, run binary as root", gpio);
|
SPDLOG_CRITICAL("Could not set gpio {} as input, run binary as root", gpio);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void GPIO::set_value(bool value)
|
void GPIO::set_value(bool value)
|
||||||
|
|||||||
Reference in New Issue
Block a user