summaryrefslogtreecommitdiff
path: root/daemon/src/Gpio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/src/Gpio.cpp')
-rw-r--r--daemon/src/Gpio.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/daemon/src/Gpio.cpp b/daemon/src/Gpio.cpp
index 23341aa..75d2ff1 100644
--- a/daemon/src/Gpio.cpp
+++ b/daemon/src/Gpio.cpp
@@ -17,17 +17,15 @@ void Gpio::apply(AssemblyContext ctx)
void Gpio::set_mode(const unsigned port, const short mode)
{
- if (SIZE <= port)
- return;
- mode_of[port] = mode & 0x1;
+ if (SIZE > port)
+ mode_of[port] = mode & 0x1;
}
void Gpio::write(const unsigned port, const short value)
{
- if (SIZE <= port)
- return;
- value_of[port] = value & 0x1;
+ if (SIZE > port && mode_of[port] == 0x1)
+ value_of[port] = value & 0x1;
}