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/OutputTask/OutputTask.cpp
- Revision:
- 185:5ac6ab1ed875
- Parent:
- 183:44f7fea6b208
- Child:
- 195:21df85341cb3
--- a/src/OutputTask/OutputTask.cpp Tue Oct 04 20:51:39 2016 +0000
+++ b/src/OutputTask/OutputTask.cpp Wed Oct 05 16:41:57 2016 +0000
@@ -9,6 +9,7 @@
#include "MbedJSONValue.h"
#include "ModbusMasterApi.h"
#include "LoggerApi.h"
+#include "Control.h"
#include <vector>
#include <string>
#include <algorithm>
@@ -209,10 +210,11 @@
if ( pos != outputMap.end() ) {
if ( pos->second.empty() ) {
// play it safe
- ModbusMasterWriteRegister(pos->first, 0.0);
+ ModbusMasterWriteRegister(pos->first, RELAY_STATUS_NOT_CONTROLLED);
recordEvent(pos->first, NULL);
} else {
- ModbusMasterWriteRegister(pos->first, pos->second.begin()->getState());
+ ModbusMasterWriteRegister(pos->first, pos->second.begin()->getMappedState());
+ printf("\rDEBUG: wrote %u to the modbus map\n", pos->second.begin()->getMappedState());
recordEvent(pos->first, (Control*)pos->second.begin());
}
} else {
@@ -453,4 +455,5 @@
outputMap[id] = v;
}
}
-}
\ No newline at end of file
+}
+
