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/ControlTask/ControlTask.cpp
- Revision:
- 46:4cb96ab2d1c8
- Parent:
- 22:fe535532859c
- Child:
- 48:1c7861d80d16
--- a/src/ControlTask/ControlTask.cpp Mon Sep 12 14:38:39 2016 +0000
+++ b/src/ControlTask/ControlTask.cpp Tue Sep 13 11:59:34 2016 +0000
@@ -1,12 +1,64 @@
#include "ControlTask.h"
#include <stdio.h>
#include "rtos.h"
+#include "ConfigurationHandler.h"
+#include "MTSLog.h"
+static void serviceSetpointControl(SetpointControl *control);
+static void serviceTimerControl(TimerControl *control);
+
+/*****************************************************************************
+ * Function: ControlTask()
+ * Description: show the controls
+ *
+ * @param msg
+ * @return none
+ *****************************************************************************/
void ControlTask(void const *args)
{
printf("\r%s has started...\n", __func__);
while ( true ) {
+ // service the setpoint controls
+ if ( !setpointTable.empty() ) {
+ StringSetpointMap::iterator pos;
+ for ( pos = setpointTable.begin(); pos != setpointTable.end(); ++pos ) {
+ serviceSetpointControl(pos->second);
+ }
+ }
+ // service the timer controls
+ if ( !timerTable.empty() ) {
+ StringTimerMap::iterator pos;
+ for ( pos = timerTable.begin(); pos != timerTable.end(); ++pos ) {
+ serviceTimerControl(pos->second);
+ }
+ }
Thread::wait(5000);
}
-}
\ No newline at end of file
+}
+
+/*****************************************************************************
+ * Function: serviceSetpointControl()
+ * Description: service a setpoint control
+ *
+ * @param control -> the setpoint control object
+ * @return none
+ *****************************************************************************/
+static void serviceSetpointControl(SetpointControl *control)
+{
+ logInfo("\r%s: servicing control %s\n",
+ __func__, control->getControlFile().c_str());
+}
+
+/*****************************************************************************
+ * Function: serviceTimerControl()
+ * Description: service a timer control
+ *
+ * @param control -> the timer control object
+ * @return none
+ *****************************************************************************/
+static void serviceTimerControl(TimerControl *control)
+{
+ logInfo("\r%s: servicing timer control %s\n",
+ __func__, control->getControlFile().c_str());
+}
