[openrtm-commit:02997] r3131 - in trunk/OpenRTM-aist/src/ext: . interrupt_task sdo/logger

openrtm @ openrtm.org openrtm @ openrtm.org
2017年 12月 11日 (月) 18:29:36 JST


Author: miyamoto
Date: 2017-12-11 18:29:36 +0900 (Mon, 11 Dec 2017)
New Revision: 3131

Added:
   trunk/OpenRTM-aist/src/ext/interrupt_task/
   trunk/OpenRTM-aist/src/ext/interrupt_task/CMakeLists.txt
   trunk/OpenRTM-aist/src/ext/interrupt_task/interrupt_task.cpp
Modified:
   trunk/OpenRTM-aist/src/ext/sdo/logger/CMakeLists.txt
Log:
[incompat, VxWorks] refs #4381

Added: trunk/OpenRTM-aist/src/ext/interrupt_task/CMakeLists.txt
===================================================================
--- trunk/OpenRTM-aist/src/ext/interrupt_task/CMakeLists.txt	                        (rev 0)
+++ trunk/OpenRTM-aist/src/ext/interrupt_task/CMakeLists.txt	2017-12-11 09:29:36 UTC (rev 3131)
@@ -0,0 +1,11 @@
+cmake_minimum_required (VERSION 2.6)
+
+
+
+set(target interrupt_task)
+
+project (${target})
+
+add_executable(${target}.cpp)
+
+set_target_properties(${target} PROPERTIES SUFFIX ".out")
\ No newline at end of file

Added: trunk/OpenRTM-aist/src/ext/interrupt_task/interrupt_task.cpp
===================================================================
--- trunk/OpenRTM-aist/src/ext/interrupt_task/interrupt_task.cpp	                        (rev 0)
+++ trunk/OpenRTM-aist/src/ext/interrupt_task/interrupt_task.cpp	2017-12-11 09:29:36 UTC (rev 3131)
@@ -0,0 +1,44 @@
+#include <semLib.h>
+#include <sysLib.h>
+#include <taskLib.h>
+
+#include <iostream>
+
+static SEM_ID syncSemId1000;
+
+
+void update_function(void)
+{
+    semFlush(syncSemId1000);
+}
+
+STATUS interrupt_wait(void)
+{
+    return semTake(syncSemId1000, WAIT_FOREVER);
+}
+
+
+void start_interrupt_handler(void)
+{
+    const double sleep_time = 2.0;
+    const int loop_count = 6;
+    syncSemId1000 = semBCreate(SEM_Q_FIFO, SEM_EMPTY);
+
+
+
+    while(true)
+    {
+        int count = 0;
+        int tps = sysClkRateGet();
+        taskDelay((int)(sleep_time*tps) + 1);
+
+        while(count < loop_count)
+        {
+            update_function();
+            count++;
+        }
+    }
+}
+
+
+

Modified: trunk/OpenRTM-aist/src/ext/sdo/logger/CMakeLists.txt
===================================================================
--- trunk/OpenRTM-aist/src/ext/sdo/logger/CMakeLists.txt	2017-12-11 09:25:07 UTC (rev 3130)
+++ trunk/OpenRTM-aist/src/ext/sdo/logger/CMakeLists.txt	2017-12-11 09:29:36 UTC (rev 3131)
@@ -42,10 +42,9 @@
 
 
 if(VXWORKS AND NOT RTP)
-	set(standalone_srcs ${standalone_srcs} ${CMAKE_SOURCE_DIR}/src/lib/rtm/DataFlowComponentBase.cpp)
 	set(libs ${RTCSKEL_PROJECT_NAME})
 
-	add_executable(${target})
+	add_executable(${target} ${srcs})
 	target_link_libraries(${target} ${libs})
 	add_dependencies(${target} ${RTM_PROJECT_NAME})
 	add_dependencies(${target} ${idl_name}_TGT)



More information about the openrtm-commit mailing list