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:
- 150:4db35c8234b4
- Parent:
- 149:950c90425f7c
- Child:
- 151:9d47fe5ba805
--- a/src/ModbusMaster/ModbusMaster.cpp Fri Sep 30 12:22:20 2016 +0000
+++ b/src/ModbusMaster/ModbusMaster.cpp Fri Sep 30 13:35:28 2016 +0000
@@ -118,21 +118,21 @@
if( iter->second.simulated == true ) {
std::map<std::string, SimulateInput>::iterator simiter;
for (simiter = SimulateInputMap.begin(); simiter != SimulateInputMap.end(); ++simiter) {
-// logInfo("simulating input=%s, min=%2.2f, max=%2.2f, start_value=%2.2f, step=%2.2f",iter->first.c_str(), SimulateInputMap[iter->first].min, SimulateInputMap[iter->first].max, SimulateInputMap[iter->first].start_value, SimulateInputMap[iter->first].step);
+// logInfo("simulating input=%s, min=%2.2f, max=%2.2f, start_value=%2.2f, up_step=%2.2f, down_step=%2.2f",iter->first.c_str(), SimulateInputMap[iter->first].min, SimulateInputMap[iter->first].max, SimulateInputMap[iter->first].start_value, SimulateInputMap[iter->first].up_step, SimulateInputMap[iter->first].down_step);
if( (SimulateInputMap[iter->first].min == 0) && (SimulateInputMap[iter->first].max == 0) ) {
ModbusRegisterMap[iter->first].float_value = SimulateInputMap[iter->first].start_value;
} else {
if( ModbusRegisterMap[iter->first].float_value >= SimulateInputMap[iter->first].max ) {
move_up = false;
- ModbusRegisterMap[iter->first].float_value = ModbusRegisterMap[iter->first].float_value - SimulateInputMap[iter->first].step;
+ ModbusRegisterMap[iter->first].float_value = ModbusRegisterMap[iter->first].float_value - SimulateInputMap[iter->first].down_step;
} else if( ModbusRegisterMap[iter->first].float_value <= SimulateInputMap[iter->first].min ) {
move_up = true;
- ModbusRegisterMap[iter->first].float_value = ModbusRegisterMap[iter->first].float_value + SimulateInputMap[iter->first].step;
+ ModbusRegisterMap[iter->first].float_value = ModbusRegisterMap[iter->first].float_value + SimulateInputMap[iter->first].up_step;
} else {
if( move_up == true ) {
- ModbusRegisterMap[iter->first].float_value = ModbusRegisterMap[iter->first].float_value + SimulateInputMap[iter->first].step;
+ ModbusRegisterMap[iter->first].float_value = ModbusRegisterMap[iter->first].float_value + SimulateInputMap[iter->first].up_step;
} else {
- ModbusRegisterMap[iter->first].float_value = ModbusRegisterMap[iter->first].float_value - SimulateInputMap[iter->first].step;
+ ModbusRegisterMap[iter->first].float_value = ModbusRegisterMap[iter->first].float_value - SimulateInputMap[iter->first].down_step;
}
}
logInfo("simulating input=%s, value=%2.2f",iter->first.c_str(), ModbusRegisterMap[iter->first].float_value);
