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() {
* In this mode coupler will shutdown all
* relays of attached I2C slaves
*/
UA_LOG_INFO(UA_Log_Stdout, \
UA_LOGCATEGORY_USERLAND, \
"Go to SAFE MODE");
// do shutdown all attached I2C slaves (MOD-IO's relays).
safeShutdownI2CSlaveList();
// set to virtual mode which means that coupler will mimic working but
// not set any related relays' state
I2C_VIRTUAL_MODE = 1;
if (!I2C_VIRTUAL_MODE) {
UA_LOG_INFO(UA_Log_Stdout, \
UA_LOGCATEGORY_USERLAND, \
"Go to SAFE MODE");
// do shutdown all attached I2C slaves (MOD-IO's relays).
safeShutdownI2CSlaveList();
// set to virtual mode which means that coupler will mimic working but
// 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