Commit 7bc3a7a7 authored by Ivan Tyagov's avatar Ivan Tyagov

No need to set mode if it's already set.

parent cda6c0db
...@@ -31,15 +31,17 @@ void gotoSafeMode() { ...@@ -31,15 +31,17 @@ void gotoSafeMode() {
* In this mode coupler will shutdown all * In this mode coupler will shutdown all
* relays of attached I2C slaves * relays of attached I2C slaves
*/ */
UA_LOG_INFO(UA_Log_Stdout, \ if (!I2C_VIRTUAL_MODE) {
UA_LOGCATEGORY_USERLAND, \ UA_LOG_INFO(UA_Log_Stdout, \
"Go to SAFE MODE"); UA_LOGCATEGORY_USERLAND, \
"Go to SAFE MODE");
// do shutdown all attached I2C slaves (MOD-IO's relays).
safeShutdownI2CSlaveList(); // do shutdown all attached I2C slaves (MOD-IO's relays).
// set to virtual mode which means that coupler will mimic working but safeShutdownI2CSlaveList();
// not set any related relays' state // set to virtual mode which means that coupler will mimic working but
I2C_VIRTUAL_MODE = 1; // not set any related relays' state
I2C_VIRTUAL_MODE = 1;
}
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment