Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed
Fork of ICE by
Diff: src/ModbusMaster/ModbusMaster.cpp
- Revision:
- 83:0f76cfbb4eba
- Parent:
- 82:f3e495a98877
- Child:
- 88:8a1a2bba8850
diff -r f3e495a98877 -r 0f76cfbb4eba src/ModbusMaster/ModbusMaster.cpp
--- a/src/ModbusMaster/ModbusMaster.cpp Tue Sep 20 15:35:13 2016 +0000
+++ b/src/ModbusMaster/ModbusMaster.cpp Tue Sep 20 16:21:17 2016 +0000
@@ -134,16 +134,17 @@
}
if( iter->second.input == false ) {
- logInfo("processing output=%s, reg=%d, value=%d",iter->first.c_str(), ModbusRegisterMap[iter->first].reg, (bool)ModbusRegisterMap[iter->first].float_value);
- if( ModbusRegisterMap[iter->first].reg == 1 ) {
- dout1 = (bool)ModbusRegisterMap[iter->first].float_value;
- } else {
- dout2 = (bool)ModbusRegisterMap[iter->first].float_value;
+ if( iter->second.node == 0 ) {
+ logInfo("processing PIN output=%s, reg=%d, value=%d",iter->first.c_str(), ModbusRegisterMap[iter->first].reg, (bool)ModbusRegisterMap[iter->first].float_value);
+ if( ModbusRegisterMap[iter->first].reg == 1 ) {
+ dout1 = (bool)ModbusRegisterMap[iter->first].float_value;
+ } else {
+ dout2 = (bool)ModbusRegisterMap[iter->first].float_value;
+ }
}
}
}
- logInfo("Checking for MAIL");
osEvent evt = ModbusMasterMailBox.get(50);
if (evt.status == osEventMail) {
Message_t *mail = (Message_t*)evt.value.p;
@@ -151,8 +152,6 @@
ModbusMasterMailBox.free(mail);
ModbusRegisterMap.clear();
break;
- } else {
- logInfo("No Mail");
}
Thread::wait(5000);
}
