Index: rtos_arduino/trunk/README.txt
===================================================================
--- rtos_arduino/trunk/README.txt	(revision 259)
+++ rtos_arduino/trunk/README.txt	(revision 260)
@@ -1,5 +1,5 @@
 =====================================================================
        TOPPERS RTE/RTOS compatible with Arduino libraries : R2CA  
-                                   Last Modified:2016 Oct 23 15:23:11
+                                   Last Modified:2016 Oct 23 16:29:13
 =====================================================================
 
@@ -99,16 +99,16 @@
 
 Arduinoã©ã¤ãã©ãªãå®è¡ããããã®ã¿ã¹ã¯ã¨ãã¦ï¼ã¡ã¤ã³ã¿ã¹ã¯ã¨ã¿ã¹ã¯1,
-ã¿ã¹ã¯2,...(RCAã¿ã¹ã¯)ãç¨æãã¦ããï¼ã¡ã¤ã³ã¿ã¹ã¯ã¯å¿
-ãçæããï¼RCA
-ã¿ã¹ã¯ã¯ï¼å¹¾ã¤çæãããã¯ãã¯ã­ã§å®ç¾©å¯è½ã§ããï¼ç¾ç¶æå¤§æ°ã¯5åã§ããï¼
-
-ããããã®ã¿ã¹ã¯åã¯æ¬¡ã®éãã§ããï¼
-
- ã¡ã¤ã³ã¿ã¹ã¯ : RCA_MAINTASK
- ã¿ã¹ã¯1      : RCA_TASK1
- ã¿ã¹ã¯2      : RCA_TASK2
- ã¿ã¹ã¯3      : RCA_TASK3
- ã¿ã¹ã¯4      : RCA_TASK4
- ã¿ã¹ã¯5      : RCA_TASK5 
+ã¿ã¹ã¯2,...ãç¨æãã¦ããï¼ã¡ã¤ã³ã¿ã¹ã¯ã¯å¿
+ãçæããï¼ã¿ã¹ã¯xã¯ï¼å¹¾ã¤
+çæãããã¯ãã¯ã­ã§å®ç¾©å¯è½ã§ããï¼ç¾ç¶æå¤§æ°ã¯5åã§ããï¼
+
+ããããã®ã¿ã¹ã¯å(ID)ã¯æ¬¡ã®éãã§ããï¼
+
+ ã¡ã¤ã³ã¿ã¹ã¯ : R2CA_MAINTASK
+ ã¿ã¹ã¯1      : R2CA_TASK1
+ ã¿ã¹ã¯2      : R2CA_TASK2
+ ã¿ã¹ã¯3      : R2CA_TASK3
+ ã¿ã¹ã¯4      : R2CA_TASK4
+ ã¿ã¹ã¯5      : R2CA_TASK5 
 
 
@@ -116,37 +116,64 @@
 
  ã¡ã¤ã³ã¿ã¹ã¯ : setup/loop
- ã¿ã¹ã¯1      : task1_setup/task2_loop
- ã¿ã¹ã¯2      : task2_setup/task2_loop
- ã¿ã¹ã¯3      : task3_setup/task3_loop
- ã¿ã¹ã¯4      : task4_setup/task4_loop 
- ã¿ã¹ã¯5      : task5_setup/task5_loop  
- 
-åsetup/loopã®æ¯ãèãã¯Arduinoã¨åç­ã§ããï¼
+ ã¿ã¹ã¯1      : loop1
+ ã¿ã¹ã¯2      : loop2
+ ã¿ã¹ã¯3      : loop3
+ ã¿ã¹ã¯4      : loop4
+ ã¿ã¹ã¯5      : loop5
+  
+å®è¡æã®æ¯ãèãã¯æ¬¡ã®éãã§ããï¼
+  
+OSèµ·åå¾ã«ã¡ã¤ã³ã¿ã¹ã¯ãå®è¡ç¶æ
+ã¨ãªãsetup()ãå®è¡ãããï¼setup()å®è¡
+çµäºå¾ã«ä»ã®ã¿ã¹ã¯ãèµ·åããï¼åã«ã¼ãé¢æ°ãå®è¡ãããï¼
  
 âã¹ã±ã¸ã¥ã¼ãªã³ã°
 
 åºæ¬çã«ã¯åªå
-åº¦ãã¼ã¹ã®ã¹ã±ã¸ã¥ã¼ã«ã§ããï¼
-
-åã¿ã¹ã¯ã®setupå®è¡æ(èµ·åæ)ã¨loopå®è¡æã®åªå
-åº¦ããããããã¯ã­ã§æ
-å®å¯è½ã§ããï¼
-
-åªå
-åº¦ã®è¨­å®æ¹æ³ã«ãããããï¼setup()ãã¾ãå®è¡ãããï¼setup()ããªã¿ã¼
-ã³ããã¾ã§ã¯ï¼taskx_setup()ã¯å®è¡ãããªãï¼setup()å
-ã§å¾
-ã¡ç¶æ
-ã«å
-¥ã£ã
-ã¨ãã¦ã¯ï¼taskx_setup()ã¯å®è¡ãããªãï¼setup()çµäºå¾ï¼taskx_setup() ã¯
-åªå
-åº¦é ã§å®è¡ãããï¼taskx_setup()ããªã¿ã¼ã³ããã¾ã§ï¼ä»ã®
-taskx_setup()ã¯å®è¡ãããªãï¼
+åº¦ãã¼ã¹ã®ã¹ã±ã¸ã¥ã¼ãªã³ã°ã¨ãªãï¼
 
 ãªãã·ã§ã³ã§ã©ã¦ã³ãã­ãã³ã¹ã±ã¸ã¥ã¼ãªã³ã°ãé¸æå¯è½ã§ããï¼ã©ã¦ã³ãã­
-ãã³ã®å¨æã¨ã©ã¦ã³ãã­ãã³ã®å¯¾è±¡ã¨ããåªå
-åº¦ããã¯ã­ã§æå®å¯è½ã§ããï¼
- 
+ãã³ã¹ã±ã¸ã¥ã¼ã«ãªã³ã°ã®å¨æã¨å¯¾è±¡ã¨ããåªå
+åº¦ã¯ãã¯ã­ã§å¤æ´å¯è½ã§ããï¼
+
+ã©ã¦ã³ãã­ãã³ã¹ã±ã¸ã¥ã¼ãªã³ã°ã®å¯¾è±¡ã¨ããªãåªå
+åº¦ã§ã¯åªå
+åº¦ãã¼ã¹ã®ã¹
+ã±ã¸ã¥ã¼ãªã³ã°ã¨ãªãï¼
+
+âãã¯ã­
+
+ã¦ã¼ã¶ã¼ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«"rca_app.h"ã§æå®å¯è½ãªãã¯ã­ã«ã¤ãã¦èª¬æ
+ããï¼
+
+R2CA_NUM_TASK
+ã»ã¡ã¤ã³ã¿ã¹ã¯æ°ä»¥å¤ã®ã¿ã¹ã¯ã®æ°
+
+R2CA_MAINTASK_PRI/R2CA_TASKx_PRIï¼x:1ï½5ï¼
+ã»åã¿ã¹ã¯ã®åªå
+åº¦ï¼
+ã»æå®ããªãå ´å
+  ã»å
+¨ã¦'5'ã¨ãªãï¼
+
+R2CA_MAINTASK_STACK_SIZE/R2CA_TASKx_STACK_SIZEï¼x:1ï½5ï¼
+ã»åã¿ã¹ã¯ã®ã¹ã¿ãã¯ãµã¤ãº
+ã»æå®ããªãå ´å
+  ã»ã¡ã¤ã³ã¿ã¹ã¯ : 2048
+  ã»ã¿ã¹ã¯x      : 1024
+  
+R2CA_RR_SCHEDULE_CYCLE
+ã»ã©ã¦ã³ãã­ãã³ã¹ã±ã¸ã¥ã¼ãªã³ã°ã®å¨æ(ms)
+ã»æå®ããªãå ´å
+  ã»1
+  
+R2CA_RR_SCHEDULE_PRI
+ã»ã©ã¦ã³ãã­ãã³ã¹ã±ã¸ã¥ã¼ãªã³ã°ã®å¯¾è±¡ã®åªå
+åº¦
+  ã»LSBããåªå
+åº¦1,2,3ã¨å²ãå½ã¦ã¦ãã
+ã»æå®ããªãå ´å
+  ã»0x0000
+
 âã©ã¤ãã©ãª
 
Index: rtos_arduino/trunk/arduino_lib/hardware/tools/CMSIS/CMSIS/Include/core_cm0plus.h
===================================================================
--- rtos_arduino/trunk/arduino_lib/hardware/tools/CMSIS/CMSIS/Include/core_cm0plus.h	(revision 259)
+++ rtos_arduino/trunk/arduino_lib/hardware/tools/CMSIS/CMSIS/Include/core_cm0plus.h	(revision 260)
@@ -647,6 +647,6 @@
 {
 //  NVIC->ISER[0] = (1 << ((uint32_t)(IRQn) & 0x1F));
-    extern void rca_ena_int(uint32_t intno);
-    rca_ena_int(IRQn);
+    extern void r2ca_ena_int(uint32_t intno);
+    r2ca_ena_int(IRQn);
 }
 
@@ -661,6 +661,6 @@
 {
 //  NVIC->ICER[0] = (1 << ((uint32_t)(IRQn) & 0x1F));
-    extern void rca_dis_int(uint32_t intno);
-    rca_dis_int(IRQn);
+    extern void r2ca_dis_int(uint32_t intno);
+    r2ca_dis_int(IRQn);
 }
 
Index: rtos_arduino/trunk/arduino_lib/libraries/ESP8266_Arudino_AT/ESP8266.cpp
===================================================================
--- rtos_arduino/trunk/arduino_lib/libraries/ESP8266_Arudino_AT/ESP8266.cpp	(revision 259)
+++ rtos_arduino/trunk/arduino_lib/libraries/ESP8266_Arudino_AT/ESP8266.cpp	(revision 260)
@@ -30,5 +30,5 @@
 
 #ifdef TOPPERS_WITH_ARDUINO
-#include "rca.h"
+#include "r2ca.h"
 #define WAIT_TIMEOUT delay(1);
 #define ENTER_CRITICAL wai_sem(ESP8266_SEM);
Index: rtos_arduino/trunk/arduino_lib/libraries/Milkcocoa_Arduino_SDK/Milkcocoa.cpp
===================================================================
--- rtos_arduino/trunk/arduino_lib/libraries/Milkcocoa_Arduino_SDK/Milkcocoa.cpp	(revision 259)
+++ rtos_arduino/trunk/arduino_lib/libraries/Milkcocoa_Arduino_SDK/Milkcocoa.cpp	(revision 260)
@@ -24,5 +24,5 @@
 */
 #include "Milkcocoa.h"
-#include "rca.h"
+#include "r2ca.h"
 
 DataElement::DataElement() {
Index: rtos_arduino/trunk/arduino_lib/libraries/NcesCan/mcp_can.cpp
===================================================================
--- rtos_arduino/trunk/arduino_lib/libraries/NcesCan/mcp_can.cpp	(revision 259)
+++ rtos_arduino/trunk/arduino_lib/libraries/NcesCan/mcp_can.cpp	(revision 260)
@@ -24,5 +24,5 @@
 
 #ifdef TOPPERS_WITH_ARDUINO
-#include "rca.h"
+#include "r2ca.h"
 #define ENTER_CRITICAL wai_sem(SPI_SEM);
 #define LEAVE_CRITICAL sig_sem(SPI_SEM);
Index: rtos_arduino/trunk/arduino_lib/libraries/SD/src/utility/Sd2Card.cpp
===================================================================
--- rtos_arduino/trunk/arduino_lib/libraries/SD/src/utility/Sd2Card.cpp	(revision 259)
+++ rtos_arduino/trunk/arduino_lib/libraries/SD/src/utility/Sd2Card.cpp	(revision 260)
@@ -23,5 +23,5 @@
 
 #ifdef TOPPERS_WITH_ARDUINO
-#include "rca.h"
+#include "r2ca.h"
 #define ENTER_CRITICAL wai_sem(SPI_SEM);
 #define LEAVE_CRITICAL sig_sem(SPI_SEM);
Index: rtos_arduino/trunk/arduino_lib/libraries/ZumoShield/ZumoBuzzer.cpp
===================================================================
--- rtos_arduino/trunk/arduino_lib/libraries/ZumoShield/ZumoBuzzer.cpp	(revision 259)
+++ rtos_arduino/trunk/arduino_lib/libraries/ZumoShield/ZumoBuzzer.cpp	(revision 260)
@@ -141,5 +141,5 @@
 
 #include "ZumoShield_cfg.h"
-#include "rca.h"
+#include "r2ca.h"
 
 void
Index: rtos_arduino/trunk/examples/Basic/Makefile
===================================================================
--- rtos_arduino/trunk/examples/Basic/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/Basic/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -37,7 +37,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -53,3 +53,3 @@
 APPL_DIR = 
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/Basic/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/Basic/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/Basic/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/Basic/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/Basic/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/Basic/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/Basic/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/Basic/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/Basic/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/Basic/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/Basic/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/Basic/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,8 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("r2ca_lib.cfg");
Index: rtos_arduino/trunk/examples/Basic/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/Basic/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/Basic/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,415 @@
+#include "r2ca.h"
+
+#define BLINK
+//#define toneMelody
+//#define USBUART
+//#define SERIALUSB
+//#define SERIAL5
+//#define ATTACHINTERRUPT
+//#define ANALOGWRITE
+//#define ANALOGREAD
+//#define RTC_ALARM
+//#define SD_CARD
+
+#ifdef BLINK
+/*
+  Blink
+  Turns on an LED on for one second, then off for one second, repeatedly.
+
+  Most Arduinos have an on-board LED you can control. On the Uno and
+  Leonardo, it is attached to digital pin 13. If you're unsure what
+  pin the on-board LED is connected to on your Arduino model, check
+  the documentation at http://arduino.cc
+
+  This example code is in the public domain.
+
+  modified 8 May 2014
+  by Scott Fitzgerald
+ */
+
+// the setup function runs once when you press reset or power the board
+void setup() {
+  // initialize digital pin 13 as an output.
+  pinMode(13, OUTPUT);
+  Serial.begin(115200);
+}
+
+// the loop function runs over and over again forever
+void loop() {
+    digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
+    Serial.println("HIGH");    
+    delay(1000);              // wait for a second
+    digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
+    Serial.println("LOW");        
+    delay(1000);              // wait for a second
+}
+#endif /* BLINK */
+
+#ifdef toneMelody
+/*
+  Melody
+
+ Plays a melody
+
+ circuit:
+ * 8-ohm speaker on digital pin 8
+
+ created 21 Jan 2010
+ modified 30 Aug 2011
+ by Tom Igoe
+
+This example code is in the public domain.
+
+ http://arduino.cc/en/Tutorial/Tone
+
+ */
+#include "pitches.h"
+
+// notes in the melody:
+int melody[] = {
+  NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, 0, NOTE_B3, NOTE_C4
+};
+
+// note durations: 4 = quarter note, 8 = eighth note, etc.:
+int noteDurations[] = {
+  4, 8, 8, 4, 4, 4, 4, 4
+};
+
+void setup() {
+    // no need to repeat the melody.
+}
+
+void loop() {
+  // iterate over the notes of the melody:
+  for (int thisNote = 0; thisNote < 8; thisNote++) {
+
+    // to calculate the note duration, take one second
+    // divided by the note type.
+    //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
+    int noteDuration = 1000 / noteDurations[thisNote];
+    tone(8, melody[thisNote], noteDuration);
+
+    // to distinguish the notes, set a minimum time between them.
+    // the note's duration + 30% seems to work well:
+    int pauseBetweenNotes = noteDuration * 1.30;
+    delay(pauseBetweenNotes);
+    // stop the tone playing:
+    noTone(8);
+  }
+  delay(2000);
+}
+#endif /* toneMelody */
+
+#ifdef SERIALUSB
+
+void setup() {
+    SerialUSB.begin(115200);
+    while(!SerialUSB){ ; }
+    SerialUSB.println("SerialUSB start!");
+}
+
+int val;
+void loop() {
+    SerialUSB.println("arrive!");
+    delay(1000);
+}
+#endif /* SERIALUSB */
+
+#ifdef SERIAL5
+
+void setup() {
+    Serial5.begin(115200);
+    Serial5.println("Serial5 start!");
+}
+
+int val;
+void loop() {
+    Serial5.println("arrive");
+    delay(1000);
+}
+#endif /* SERIAL5 */
+
+#ifdef ATTACHINTERRUPT
+const int buttonPin = 7;     // the number of the pushbutton pin
+const int ledPin =  13;      // the number of the LED pin
+
+// variables will change:
+int buttonState = 0;         // variable for reading the pushbutton status
+
+extern void blink(void);
+    
+void setup() {
+  // initialize the LED pin as an output:
+  pinMode(ledPin, OUTPUT);
+  // initialize the pushbutton pin as an input:
+  pinMode(buttonPin, INPUT);
+  Serial.begin(115200);
+  attachInterrupt(buttonPin, blink, CHANGE);
+}
+
+int interrupt;
+/* ToDo */
+void
+blink(void){
+//    Serial.println("interrupt!");
+    syslog(LOG_NOTICE, "data = %d", interrupt++);
+}
+
+void loop() {
+  // read the state of the pushbutton value:
+  buttonState = digitalRead(buttonPin);
+
+  // check if the pushbutton is pressed.
+  // if it is, the buttonState is HIGH:
+  if (buttonState == HIGH) {
+    // turn LED on:
+    digitalWrite(ledPin, HIGH);
+  }
+  else {
+    // turn LED off:
+    digitalWrite(ledPin, LOW);
+  }
+  delay(10);
+}
+#endif /* ATTACHINTERRUPT */
+
+#ifdef ANALOGWRITE
+
+const int ledPin =  13;
+
+void setup() {
+}
+
+void loop() {
+  int i;
+  while(1){
+    for(i= 0; i<255; i++){
+      analogWrite(ledPin,i);
+      delay(10);
+    }
+    for(i= 255; i>0; i--){
+      analogWrite(ledPin,i);
+      delay(10);
+    }        
+  }
+}
+#endif /* ANALOGWRITE */
+
+#ifdef ANALOGREAD
+/*
+  Analog Input
+ Demonstrates analog input by reading an analog sensor on analog pin 0 and
+ turning on and off a light emitting diode(LED)  connected to digital pin 13.
+ The amount of time the LED will be on and off depends on
+ the value obtained by analogRead().
+
+ The circuit:
+ * Potentiometer attached to analog input 0
+ * center pin of the potentiometer to the analog pin
+ * one side pin (either one) to ground
+ * the other side pin to +5V
+ * LED anode (long leg) attached to digital output 13
+ * LED cathode (short leg) attached to ground
+
+ * Note: because most Arduinos have a built-in LED attached
+ to pin 13 on the board, the LED is optional.
+
+
+ Created by David Cuartielles
+ modified 30 Aug 2011
+ By Tom Igoe
+
+ This example code is in the public domain.
+
+ http://arduino.cc/en/Tutorial/AnalogInput
+
+ */
+int sensorPin = A0;    // select the input pin for the potentiometer
+int ledPin = 13;      // select the pin for the LED
+int sensorValue = 0;  // variable to store the value coming from the sensor
+
+void setup() {
+  // declare the ledPin as an OUTPUT:
+  pinMode(ledPin, OUTPUT);
+}
+
+int i = 0;
+void loop() {
+    // read the value from the sensor:
+    sensorValue = analogRead(sensorPin);
+    analogWrite(ledPin,sensorValue/4);
+    delay(10);
+    if(i++ == 100){
+        i = 0;
+        syslog(LOG_NOTICE, "hoge = %d", sensorValue);
+    }
+}
+#endif /* ANALOGREAD */
+
+#ifdef RTC_ALARM
+/*****************************************************************************************************************************************************************************
+* This sketch demonstrate how to use alarm in interrupt mode.
+This mode is more conveniently because you use processor for other tasks and when alarm match occurs interrupt routine is executed.
+In this way, alarm flag checking is indipendent from main program flow.
+******************************************************************************************************************************************************************************/
+
+#include <RTCInt.h>
+
+RTCInt rtc;
+
+extern void alarm_int(void);
+
+void setup() 
+{
+  Serial.begin(115200);       //serial communication initializing
+  pinMode(13,OUTPUT);
+  rtc.begin(TIME_H24);      //RTC initializing with 24 hour representation mode
+  rtc.setTime(17,0,5,0);    //setting time (hour minute and second)
+  rtc.setDate(13,8,15);     //setting date
+  rtc.enableAlarm(SEC,ALARM_INTERRUPT,alarm_int); //enabling alarm in polled mode and match on second
+  rtc.local_time.hour=17;
+  rtc.local_time.minute=5;
+  rtc.local_time.second=10;  //setting second to match
+  rtc.setAlarm();  //write second in alarm register
+}
+
+void loop()
+{
+//  digitalWrite(13,HIGH);   //main program code
+  Serial.println("HIGH!");
+  delay(1000);
+//  digitalWrite(13,LOW);
+  Serial.println("LOW!");
+  delay(1000);
+  
+}
+
+
+/*************** Interrupt routine for alarm ******************************/
+void alarm_int(void)
+{
+  Serial.println("Alarm match!");
+//    RTC->MODE2.INTFLAG.bit.ALARM0=1; //clearing alarm0 flag
+     rtc.getDate();      //getting date in local structure (local_date)
+ rtc.getTime();      //getting time in local structure(local_time)
+ 
+ //printing date in format YYYY/MM/DD
+ Serial.print(rtc.local_date.year+2000); // year
+ Serial.print('/');
+ Serial.print(rtc.local_date.month);    // month
+ Serial.print('/');
+ Serial.print(rtc.local_date.day);      // day
+ Serial.print(' ');
+ 
+ //printing time
+ Serial.print(rtc.local_time.hour);    //hour
+ Serial.print(':');
+ Serial.print(rtc.local_time.minute);  //minute
+ Serial.print(':');
+ Serial.println(rtc.local_time.second);  //second 
+}
+#endif /* RTC_ALARM */
+
+
+#ifdef SD_CARD
+/*
+  SD card datalogger
+
+ This example shows how to log data from three analog sensors
+ to an SD card using the SD library.
+
+ The circuit:
+ * analog sensors on analog ins 0, 1, and 2
+ * SD card attached to SPI bus as follows:
+ ** MOSI - pin 11
+ ** MISO - pin 12
+ ** CLK - pin 13
+ ** CS - pin 4
+
+ created  24 Nov 2010
+ modified 9 Apr 2012
+ by Tom Igoe
+
+ This example code is in the public domain.
+
+ */
+
+#include <SPI.h>
+#include <SD.h>
+
+// On the Ethernet Shield, CS is pin 4. Note that even if it's not
+// used as the CS pin, the hardware CS pin (10 on most Arduino boards,
+// 53 on the Mega) must be left as an output or the SD library
+// functions will not work.
+const int chipSelect = 10;
+
+void setup()
+{
+  // Open serial communications and wait for port to open:
+  Serial.begin(115200);
+  while (!Serial) {
+    ; // wait for serial port to connect. Needed for Leonardo only
+  }
+
+  Serial.print("Initializing SD card...");
+  // make sure that the default chip select pin is set to
+  // output, even if you don't use it:
+  // pinMode(10, OUTPUT);
+
+  // see if the card is present and can be initialized:
+  if (!SD.begin(chipSelect)) {
+    Serial.println("Card failed, or not present");
+    // don't do anything more:
+    return;
+  }
+  Serial.println("card initialized.");
+
+  if (SD.remove("datalog.txt")) {
+    Serial.println("Delete datalog.txt");
+  }    
+}
+
+void loop()
+{
+  // make a string for assembling the data to log:
+  String dataString = "";
+
+  // read three sensors and append to the string:
+  for (int analogPin = 0; analogPin < 3; analogPin++) {
+    int sensor = analogRead(analogPin);
+    dataString += String(sensor);
+    if (analogPin < 2) {
+      dataString += ",";
+    }
+  }
+
+  File dataFile = SD.open("datalog.txt");
+  if (dataFile) {    
+    Serial.println("=== data from file ===");
+    while (dataFile.available()) {
+      Serial.write(dataFile.read());
+    }
+    dataFile.close();
+  }
+    
+  // open the file. note that only one file can be open at a time,
+  // so you have to close this one before opening another.
+  dataFile = SD.open("datalog.txt", FILE_WRITE);
+
+  // if the file is available, write to it:
+  if (dataFile) {
+    dataFile.println(dataString);
+    dataFile.close();
+    // print to the serial port too:
+    Serial.println("=== new data to file ===");      
+    Serial.println(dataString);
+  }
+  // if the file isn't open, pop up an error:
+  else {
+    Serial.println("error opening datalog.txt");
+  }
+  delay(4000);  
+}
+#endif /* SD_CARD */
+
+
Index: rtos_arduino/trunk/examples/Basic/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/Basic/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/Basic/r2ca_app.h	(revision 260)
@@ -0,0 +1,6 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 0
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/Basic/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/Basic/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/Basic/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/Basic/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/Basic/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/Basic/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/Basic/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/Basic/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,8 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-/*
- *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
- */
-INCLUDE("rca_lib.cfg");
Index: rtos_arduino/trunk/examples/Basic/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/Basic/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,415 +1,0 @@
-#include "rca.h"
-
-#define BLINK
-//#define toneMelody
-//#define USBUART
-//#define SERIALUSB
-//#define SERIAL5
-//#define ATTACHINTERRUPT
-//#define ANALOGWRITE
-//#define ANALOGREAD
-//#define RTC_ALARM
-//#define SD_CARD
-
-#ifdef BLINK
-/*
-  Blink
-  Turns on an LED on for one second, then off for one second, repeatedly.
-
-  Most Arduinos have an on-board LED you can control. On the Uno and
-  Leonardo, it is attached to digital pin 13. If you're unsure what
-  pin the on-board LED is connected to on your Arduino model, check
-  the documentation at http://arduino.cc
-
-  This example code is in the public domain.
-
-  modified 8 May 2014
-  by Scott Fitzgerald
- */
-
-// the setup function runs once when you press reset or power the board
-void setup() {
-  // initialize digital pin 13 as an output.
-  pinMode(13, OUTPUT);
-  Serial.begin(115200);
-}
-
-// the loop function runs over and over again forever
-void loop() {
-    digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
-    Serial.println("HIGH");    
-    delay(1000);              // wait for a second
-    digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
-    Serial.println("LOW");        
-    delay(1000);              // wait for a second
-}
-#endif /* BLINK */
-
-#ifdef toneMelody
-/*
-  Melody
-
- Plays a melody
-
- circuit:
- * 8-ohm speaker on digital pin 8
-
- created 21 Jan 2010
- modified 30 Aug 2011
- by Tom Igoe
-
-This example code is in the public domain.
-
- http://arduino.cc/en/Tutorial/Tone
-
- */
-#include "pitches.h"
-
-// notes in the melody:
-int melody[] = {
-  NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, 0, NOTE_B3, NOTE_C4
-};
-
-// note durations: 4 = quarter note, 8 = eighth note, etc.:
-int noteDurations[] = {
-  4, 8, 8, 4, 4, 4, 4, 4
-};
-
-void setup() {
-    // no need to repeat the melody.
-}
-
-void loop() {
-  // iterate over the notes of the melody:
-  for (int thisNote = 0; thisNote < 8; thisNote++) {
-
-    // to calculate the note duration, take one second
-    // divided by the note type.
-    //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
-    int noteDuration = 1000 / noteDurations[thisNote];
-    tone(8, melody[thisNote], noteDuration);
-
-    // to distinguish the notes, set a minimum time between them.
-    // the note's duration + 30% seems to work well:
-    int pauseBetweenNotes = noteDuration * 1.30;
-    delay(pauseBetweenNotes);
-    // stop the tone playing:
-    noTone(8);
-  }
-  delay(2000);
-}
-#endif /* toneMelody */
-
-#ifdef SERIALUSB
-
-void setup() {
-    SerialUSB.begin(115200);
-    while(!SerialUSB){ ; }
-    SerialUSB.println("SerialUSB start!");
-}
-
-int val;
-void loop() {
-    SerialUSB.println("arrive!");
-    delay(1000);
-}
-#endif /* SERIALUSB */
-
-#ifdef SERIAL5
-
-void setup() {
-    Serial5.begin(115200);
-    Serial5.println("Serial5 start!");
-}
-
-int val;
-void loop() {
-    Serial5.println("arrive");
-    delay(1000);
-}
-#endif /* SERIAL5 */
-
-#ifdef ATTACHINTERRUPT
-const int buttonPin = 7;     // the number of the pushbutton pin
-const int ledPin =  13;      // the number of the LED pin
-
-// variables will change:
-int buttonState = 0;         // variable for reading the pushbutton status
-
-extern void blink(void);
-    
-void setup() {
-  // initialize the LED pin as an output:
-  pinMode(ledPin, OUTPUT);
-  // initialize the pushbutton pin as an input:
-  pinMode(buttonPin, INPUT);
-  Serial.begin(115200);
-  attachInterrupt(buttonPin, blink, CHANGE);
-}
-
-int interrupt;
-/* ToDo */
-void
-blink(void){
-//    Serial.println("interrupt!");
-    syslog(LOG_NOTICE, "data = %d", interrupt++);
-}
-
-void loop() {
-  // read the state of the pushbutton value:
-  buttonState = digitalRead(buttonPin);
-
-  // check if the pushbutton is pressed.
-  // if it is, the buttonState is HIGH:
-  if (buttonState == HIGH) {
-    // turn LED on:
-    digitalWrite(ledPin, HIGH);
-  }
-  else {
-    // turn LED off:
-    digitalWrite(ledPin, LOW);
-  }
-  delay(10);
-}
-#endif /* ATTACHINTERRUPT */
-
-#ifdef ANALOGWRITE
-
-const int ledPin =  13;
-
-void setup() {
-}
-
-void loop() {
-  int i;
-  while(1){
-    for(i= 0; i<255; i++){
-      analogWrite(ledPin,i);
-      delay(10);
-    }
-    for(i= 255; i>0; i--){
-      analogWrite(ledPin,i);
-      delay(10);
-    }        
-  }
-}
-#endif /* ANALOGWRITE */
-
-#ifdef ANALOGREAD
-/*
-  Analog Input
- Demonstrates analog input by reading an analog sensor on analog pin 0 and
- turning on and off a light emitting diode(LED)  connected to digital pin 13.
- The amount of time the LED will be on and off depends on
- the value obtained by analogRead().
-
- The circuit:
- * Potentiometer attached to analog input 0
- * center pin of the potentiometer to the analog pin
- * one side pin (either one) to ground
- * the other side pin to +5V
- * LED anode (long leg) attached to digital output 13
- * LED cathode (short leg) attached to ground
-
- * Note: because most Arduinos have a built-in LED attached
- to pin 13 on the board, the LED is optional.
-
-
- Created by David Cuartielles
- modified 30 Aug 2011
- By Tom Igoe
-
- This example code is in the public domain.
-
- http://arduino.cc/en/Tutorial/AnalogInput
-
- */
-int sensorPin = A0;    // select the input pin for the potentiometer
-int ledPin = 13;      // select the pin for the LED
-int sensorValue = 0;  // variable to store the value coming from the sensor
-
-void setup() {
-  // declare the ledPin as an OUTPUT:
-  pinMode(ledPin, OUTPUT);
-}
-
-int i = 0;
-void loop() {
-    // read the value from the sensor:
-    sensorValue = analogRead(sensorPin);
-    analogWrite(ledPin,sensorValue/4);
-    delay(10);
-    if(i++ == 100){
-        i = 0;
-        syslog(LOG_NOTICE, "hoge = %d", sensorValue);
-    }
-}
-#endif /* ANALOGREAD */
-
-#ifdef RTC_ALARM
-/*****************************************************************************************************************************************************************************
-* This sketch demonstrate how to use alarm in interrupt mode.
-This mode is more conveniently because you use processor for other tasks and when alarm match occurs interrupt routine is executed.
-In this way, alarm flag checking is indipendent from main program flow.
-******************************************************************************************************************************************************************************/
-
-#include <RTCInt.h>
-
-RTCInt rtc;
-
-extern void alarm_int(void);
-
-void setup() 
-{
-  Serial.begin(115200);       //serial communication initializing
-  pinMode(13,OUTPUT);
-  rtc.begin(TIME_H24);      //RTC initializing with 24 hour representation mode
-  rtc.setTime(17,0,5,0);    //setting time (hour minute and second)
-  rtc.setDate(13,8,15);     //setting date
-  rtc.enableAlarm(SEC,ALARM_INTERRUPT,alarm_int); //enabling alarm in polled mode and match on second
-  rtc.local_time.hour=17;
-  rtc.local_time.minute=5;
-  rtc.local_time.second=10;  //setting second to match
-  rtc.setAlarm();  //write second in alarm register
-}
-
-void loop()
-{
-//  digitalWrite(13,HIGH);   //main program code
-  Serial.println("HIGH!");
-  delay(1000);
-//  digitalWrite(13,LOW);
-  Serial.println("LOW!");
-  delay(1000);
-  
-}
-
-
-/*************** Interrupt routine for alarm ******************************/
-void alarm_int(void)
-{
-  Serial.println("Alarm match!");
-//    RTC->MODE2.INTFLAG.bit.ALARM0=1; //clearing alarm0 flag
-     rtc.getDate();      //getting date in local structure (local_date)
- rtc.getTime();      //getting time in local structure(local_time)
- 
- //printing date in format YYYY/MM/DD
- Serial.print(rtc.local_date.year+2000); // year
- Serial.print('/');
- Serial.print(rtc.local_date.month);    // month
- Serial.print('/');
- Serial.print(rtc.local_date.day);      // day
- Serial.print(' ');
- 
- //printing time
- Serial.print(rtc.local_time.hour);    //hour
- Serial.print(':');
- Serial.print(rtc.local_time.minute);  //minute
- Serial.print(':');
- Serial.println(rtc.local_time.second);  //second 
-}
-#endif /* RTC_ALARM */
-
-
-#ifdef SD_CARD
-/*
-  SD card datalogger
-
- This example shows how to log data from three analog sensors
- to an SD card using the SD library.
-
- The circuit:
- * analog sensors on analog ins 0, 1, and 2
- * SD card attached to SPI bus as follows:
- ** MOSI - pin 11
- ** MISO - pin 12
- ** CLK - pin 13
- ** CS - pin 4
-
- created  24 Nov 2010
- modified 9 Apr 2012
- by Tom Igoe
-
- This example code is in the public domain.
-
- */
-
-#include <SPI.h>
-#include <SD.h>
-
-// On the Ethernet Shield, CS is pin 4. Note that even if it's not
-// used as the CS pin, the hardware CS pin (10 on most Arduino boards,
-// 53 on the Mega) must be left as an output or the SD library
-// functions will not work.
-const int chipSelect = 10;
-
-void setup()
-{
-  // Open serial communications and wait for port to open:
-  Serial.begin(115200);
-  while (!Serial) {
-    ; // wait for serial port to connect. Needed for Leonardo only
-  }
-
-  Serial.print("Initializing SD card...");
-  // make sure that the default chip select pin is set to
-  // output, even if you don't use it:
-  // pinMode(10, OUTPUT);
-
-  // see if the card is present and can be initialized:
-  if (!SD.begin(chipSelect)) {
-    Serial.println("Card failed, or not present");
-    // don't do anything more:
-    return;
-  }
-  Serial.println("card initialized.");
-
-  if (SD.remove("datalog.txt")) {
-    Serial.println("Delete datalog.txt");
-  }    
-}
-
-void loop()
-{
-  // make a string for assembling the data to log:
-  String dataString = "";
-
-  // read three sensors and append to the string:
-  for (int analogPin = 0; analogPin < 3; analogPin++) {
-    int sensor = analogRead(analogPin);
-    dataString += String(sensor);
-    if (analogPin < 2) {
-      dataString += ",";
-    }
-  }
-
-  File dataFile = SD.open("datalog.txt");
-  if (dataFile) {    
-    Serial.println("=== data from file ===");
-    while (dataFile.available()) {
-      Serial.write(dataFile.read());
-    }
-    dataFile.close();
-  }
-    
-  // open the file. note that only one file can be open at a time,
-  // so you have to close this one before opening another.
-  dataFile = SD.open("datalog.txt", FILE_WRITE);
-
-  // if the file is available, write to it:
-  if (dataFile) {
-    dataFile.println(dataString);
-    dataFile.close();
-    // print to the serial port too:
-    Serial.println("=== new data to file ===");      
-    Serial.println(dataString);
-  }
-  // if the file isn't open, pop up an error:
-  else {
-    Serial.println("error opening datalog.txt");
-  }
-  delay(4000);  
-}
-#endif /* SD_CARD */
-
-
Index: rtos_arduino/trunk/examples/Basic/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/Basic/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 0
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/BlueMix_basic/Makefile
===================================================================
--- rtos_arduino/trunk/examples/BlueMix_basic/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/BlueMix_basic/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -32,7 +32,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -49,12 +49,12 @@
 
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT/
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT/
 APPL_CXXOBJS += ESP8266.o
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ArduinoJson/ $(RCA_DIR)/arduino_lib/libraries/ArduinoJson/include $(RCA_DIR)/arduino_lib/libraries/ArduinoJson/include/ArduinoJson  $(RCA_DIR)/arduino_lib/libraries/ArduinoJson/include/ArduinoJson/Arduino $(RCA_DIR)/arduino_lib/libraries/ArduinoJson/include/ArduinoJson/Internals $(RCA_DIR)/arduino_lib/libraries/ArduinoJson/include/ArduinoJson/TypeTraits $(RCA_DIR)/arduino_lib/libraries/ArduinoJson/src $(RCA_DIR)/arduino_lib/libraries/ArduinoJson/src/Internals
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/ArduinoJson/ $(R2CA_DIR)/arduino_lib/libraries/ArduinoJson/include $(R2CA_DIR)/arduino_lib/libraries/ArduinoJson/include/ArduinoJson  $(R2CA_DIR)/arduino_lib/libraries/ArduinoJson/include/ArduinoJson/Arduino $(R2CA_DIR)/arduino_lib/libraries/ArduinoJson/include/ArduinoJson/Internals $(R2CA_DIR)/arduino_lib/libraries/ArduinoJson/include/ArduinoJson/TypeTraits $(R2CA_DIR)/arduino_lib/libraries/ArduinoJson/src $(R2CA_DIR)/arduino_lib/libraries/ArduinoJson/src/Internals
 APPL_CXXOBJS += JsonArray.o JsonBuffer.o JsonObject.o JsonVariant.o Comments.o Encoding.o IndentedPrint.o JsonParser.o List.o Prettyfier.o  StaticStringBuilder.o
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/pubsubclient-2.6/src
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/pubsubclient-2.6/src
 APPL_CXXOBJS += PubSubClient.o
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/BlueMix_basic/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/BlueMix_basic/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/BlueMix_basic/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/BlueMix_basic/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/BlueMix_basic/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/BlueMix_basic/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/BlueMix_basic/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/BlueMix_basic/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/BlueMix_basic/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/BlueMix_basic/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/BlueMix_basic/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/BlueMix_basic/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,6 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+INCLUDE("r2ca_lib.cfg");
+
Index: rtos_arduino/trunk/examples/BlueMix_basic/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/BlueMix_basic/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/BlueMix_basic/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,133 @@
+#include "r2ca.h"
+#include "ESP8266.h"
+#include "Client_ESP8266.h"
+#include <PubSubClient.h>
+#include <ArduinoJson.h>
+
+#include "../examples_gdef.h"
+
+char serverName[] = BLUEMIX_ORGANIZATION ".messaging.internetofthings.ibmcloud.com";
+String clientName = String("d:") + String(BLUEMIX_ORGANIZATION) + String(":") + String(BLUEMIX_DEVICE_TYPE) + String(":") + String(BLUEMIX_DEVICE_ID);
+String topicName = String("iot-2/evt/status/fmt/json");
+char username[] = "use-token-auth";
+char password[] = BLUEMIX_PASSWORD;
+
+ESP8266Client wifi_client;
+PubSubClient client(serverName, 1883, 0, wifi_client);
+
+void MqttConnect()
+{
+  while(!client.connected())
+  {
+    char clientStr[128];
+    clientName.toCharArray(clientStr,sizeof(clientStr));
+
+    Serial.print("Trying to connect to: ");
+    Serial.println(clientStr);
+    client.connect(clientStr,username,password);
+  }
+}
+
+void MqttRequest(int level)
+{
+  MqttConnect();
+
+  if(client.connected())
+  {
+    char topicStr[128];
+    topicName.toCharArray(topicStr,sizeof(topicStr));
+    char jsonStr[200];
+    DynamicJsonBuffer jsonBuffer;
+    JsonObject& root = jsonBuffer.createObject();
+    JsonObject& d = root.createNestedObject("d");
+    d["cds"] = level;
+    root.printTo(jsonStr, sizeof(jsonStr));
+
+    boolean pubresult = client.publish(topicStr,jsonStr);
+
+    Serial.print("attempt to send ");
+    Serial.println(jsonStr);
+    Serial.print("to ");
+    Serial.println(topicStr);
+
+    if(pubresult)
+      Serial.println("successfully sent");
+    else
+      Serial.println("unsuccessfully sent");
+  }
+  else
+  {
+      Serial.println("connect error");
+  }
+}
+
+void setup()
+{
+    int ret;
+    
+    Serial.println("Echo Server : Start!");
+    
+    ret = WiFi.begin(Serial5, 115200);
+
+    if(ret == 1) {
+        Serial.print("Cannot communicate with ESP8266.");
+        while(1);        
+    } else if(ret == 2) {
+        Serial.println("FW Version mismatch.");
+        Serial.print("FW Version:");
+        Serial.println(WiFi.getVersion().c_str());
+        Serial.print("Supported FW Version:");
+        Serial.println(ESP8266_SUPPORT_VERSION);
+        while(1);
+    } else {
+        Serial.print("begin ok\r\n");
+    }
+
+    Serial.print("FW Version:");
+    Serial.println(WiFi.getVersion().c_str());
+    
+    if (WiFi.setOprToStation()) {
+        Serial.print("to station ok\r\n");
+    } else {
+        Serial.print("to station err\r\n");
+    }
+    
+    if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
+        Serial.print("Join AP success\r\n");
+        Serial.print("IP: ");
+        Serial.println(WiFi.getLocalIP().c_str());    
+    } else {
+        Serial.print("Join AP failure\r\n");
+    }
+    
+    if (WiFi.stopServer()) {
+        Serial.print("Stop server ok\r\n");
+    } else {
+        Serial.print("Stop server err\r\n");
+    }        
+    
+    if (WiFi.disableMUX()) {
+        Serial.print("single ok\r\n");
+    } else {
+        Serial.print("single err\r\n");
+    }
+
+    MqttConnect();
+    Serial.println("MQTT set up");
+}
+
+int cnt = 0;
+void loop()
+{    
+    MqttRequest(cnt++);
+    delay(1000);
+    client.loop();
+
+    if (Serial.available() > 0) {
+        Serial.read();
+        Serial.print("Pause  : Input any char to continue.\n\r");
+        while(!(Serial.available() > 0));
+        Serial.print("Resume.\n\r");
+        Serial.read();
+    }
+}
Index: rtos_arduino/trunk/examples/BlueMix_basic/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/BlueMix_basic/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/BlueMix_basic/r2ca_app.h	(revision 260)
@@ -0,0 +1,12 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+//#define MULTI_ECHO_SERVER
+
+#ifndef MULTI_ECHO_SERVER
+#define R2CA_NUM_TASK 0
+#else /* MULTI_ECHO_SERVER */
+#define R2CA_NUM_TASK 1
+#endif /* MULTI_ECHO_SERVER */
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/BlueMix_basic/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/BlueMix_basic/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/BlueMix_basic/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/BlueMix_basic/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/BlueMix_basic/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/BlueMix_basic/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/BlueMix_basic/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/BlueMix_basic/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-INCLUDE("rca_lib.cfg");
-
Index: rtos_arduino/trunk/examples/BlueMix_basic/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/BlueMix_basic/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,133 +1,0 @@
-#include "rca.h"
-#include "ESP8266.h"
-#include "Client_ESP8266.h"
-#include <PubSubClient.h>
-#include <ArduinoJson.h>
-
-#include "../examples_gdef.h"
-
-char serverName[] = BLUEMIX_ORGANIZATION ".messaging.internetofthings.ibmcloud.com";
-String clientName = String("d:") + String(BLUEMIX_ORGANIZATION) + String(":") + String(BLUEMIX_DEVICE_TYPE) + String(":") + String(BLUEMIX_DEVICE_ID);
-String topicName = String("iot-2/evt/status/fmt/json");
-char username[] = "use-token-auth";
-char password[] = BLUEMIX_PASSWORD;
-
-ESP8266Client wifi_client;
-PubSubClient client(serverName, 1883, 0, wifi_client);
-
-void MqttConnect()
-{
-  while(!client.connected())
-  {
-    char clientStr[128];
-    clientName.toCharArray(clientStr,sizeof(clientStr));
-
-    Serial.print("Trying to connect to: ");
-    Serial.println(clientStr);
-    client.connect(clientStr,username,password);
-  }
-}
-
-void MqttRequest(int level)
-{
-  MqttConnect();
-
-  if(client.connected())
-  {
-    char topicStr[128];
-    topicName.toCharArray(topicStr,sizeof(topicStr));
-    char jsonStr[200];
-    DynamicJsonBuffer jsonBuffer;
-    JsonObject& root = jsonBuffer.createObject();
-    JsonObject& d = root.createNestedObject("d");
-    d["cds"] = level;
-    root.printTo(jsonStr, sizeof(jsonStr));
-
-    boolean pubresult = client.publish(topicStr,jsonStr);
-
-    Serial.print("attempt to send ");
-    Serial.println(jsonStr);
-    Serial.print("to ");
-    Serial.println(topicStr);
-
-    if(pubresult)
-      Serial.println("successfully sent");
-    else
-      Serial.println("unsuccessfully sent");
-  }
-  else
-  {
-      Serial.println("connect error");
-  }
-}
-
-void setup()
-{
-    int ret;
-    
-    Serial.println("Echo Server : Start!");
-    
-    ret = WiFi.begin(Serial5, 115200);
-
-    if(ret == 1) {
-        Serial.print("Cannot communicate with ESP8266.");
-        while(1);        
-    } else if(ret == 2) {
-        Serial.println("FW Version mismatch.");
-        Serial.print("FW Version:");
-        Serial.println(WiFi.getVersion().c_str());
-        Serial.print("Supported FW Version:");
-        Serial.println(ESP8266_SUPPORT_VERSION);
-        while(1);
-    } else {
-        Serial.print("begin ok\r\n");
-    }
-
-    Serial.print("FW Version:");
-    Serial.println(WiFi.getVersion().c_str());
-    
-    if (WiFi.setOprToStation()) {
-        Serial.print("to station ok\r\n");
-    } else {
-        Serial.print("to station err\r\n");
-    }
-    
-    if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
-        Serial.print("Join AP success\r\n");
-        Serial.print("IP: ");
-        Serial.println(WiFi.getLocalIP().c_str());    
-    } else {
-        Serial.print("Join AP failure\r\n");
-    }
-    
-    if (WiFi.stopServer()) {
-        Serial.print("Stop server ok\r\n");
-    } else {
-        Serial.print("Stop server err\r\n");
-    }        
-    
-    if (WiFi.disableMUX()) {
-        Serial.print("single ok\r\n");
-    } else {
-        Serial.print("single err\r\n");
-    }
-
-    MqttConnect();
-    Serial.println("MQTT set up");
-}
-
-int cnt = 0;
-void loop()
-{    
-    MqttRequest(cnt++);
-    delay(1000);
-    client.loop();
-
-    if (Serial.available() > 0) {
-        Serial.read();
-        Serial.print("Pause  : Input any char to continue.\n\r");
-        while(!(Serial.available() > 0));
-        Serial.print("Resume.\n\r");
-        Serial.read();
-    }
-}
Index: rtos_arduino/trunk/examples/BlueMix_basic/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/BlueMix_basic/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,12 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-//#define MULTI_ECHO_SERVER
-
-#ifndef MULTI_ECHO_SERVER
-#define RCA_NUM_TASK 0
-#else /* MULTI_ECHO_SERVER */
-#define RCA_NUM_TASK 1
-#endif /* MULTI_ECHO_SERVER */
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/CompositeExample/Makefile
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/CompositeExample/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -32,7 +32,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -61,6 +61,6 @@
 APPL_CXXOBJS += Adafruit_VCNL4000.o
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT/
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT/
 APPL_CXXOBJS += ESP8266.o
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/CompositeExample/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/CompositeExample/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/CompositeExample/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/CompositeExample/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/CompositeExample/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/CompositeExample/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/CompositeExample/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/CompositeExample/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,6 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+INCLUDE("r2ca_lib.cfg");
+
Index: rtos_arduino/trunk/examples/CompositeExample/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/CompositeExample/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,888 @@
+#include "r2ca.h"
+#include "i2c_lcd.h"
+
+#define LED1_PORT 2
+#define LED2_PORT 3
+
+#define SSID       "XXXXX"
+#define PASSWORD   "YYYYY"
+
+#define AP_SSID       "M0_AP"
+#define AP_PASSWORD   "none"
+
+//#define Serial SerialUSB
+
+/////////////////////////////////////////////////////////////////////
+//                    Inter Task Variable
+/////////////////////////////////////////////////////////////////////
+#define LED_MODE_ONOFF 0
+#define LED_MODE_BLINK 1
+#define LED_BLINK_CYC_INIT 500
+
+bool gled1_state = false;
+bool gled2_state = false;
+uint8_t led_mode = LED_MODE_ONOFF;
+uint32_t led_blink_cyc = LED_BLINK_CYC_INIT;
+
+/////////////////////////////////////////////////////////////////////
+//                    Command  Task 
+/////////////////////////////////////////////////////////////////////
+const char *usage = " \
+1 : Select Sensor Task.\n\
+2 : Select Web Task. \n\
+3 : Select LED Task. \n\
+4 : Select TFT Task. \n\
+5 : Select Processing Task. \n\
+";
+
+extern void task1_setup();
+extern void task2_setup();
+extern void task3_setup();
+extern void task4_setup();
+extern void task5_setup();
+
+void setup(){
+    Serial.begin(115200);    
+    while(!Serial){
+        delay(1);
+    }
+    Serial.println("Main Task : setup start!");
+    Serial.println(usage);
+
+    task1_setup();
+    task2_setup();
+    task3_setup();
+    task4_setup();
+    task5_setup();
+}
+
+
+/*
+ *  T[rXR[ÌG[ÌOoÍ
+ */
+Inline void
+svc_perror(const char *file, int_t line, const char *expr, ER ercd)
+{
+	if (ercd < 0) {
+		t_perror(LOG_ERROR, file, line, expr, ercd);
+	}
+}
+
+#define	SVC_PERROR(expr)	svc_perror(__FILE__, __LINE__, #expr, (expr))
+
+ID		tskid = R2CA_TASK1;
+int_t	tskno = 1;
+
+#define HIGH_PRIORITY  4
+#define MID_PRIORITY   5
+#define LOW_PRIORITY   6
+
+void loop(){
+    char c;
+    ER_UINT	ercd;
+    PRI		tskpri;
+    SYSUTM	utime1, utime2;
+    
+    if (Serial.available()){
+        c = Serial.read();
+        switch (c) {
+        case '1':
+            tskno = 1;
+            tskid = R2CA_TASK1;
+            syslog(LOG_INFO, "Select Sensor Task.");
+            break;
+        case '2':
+            tskno = 2;
+            tskid = R2CA_TASK2;
+            syslog(LOG_INFO, "Select Web Task.");
+            break;
+        case '3':
+            tskno = 3;
+            tskid = R2CA_TASK3;
+            syslog(LOG_INFO, "Select LED Task.");
+            break;
+        case '4':
+            tskno = 4;
+            tskid = R2CA_TASK4;
+            syslog(LOG_INFO, "Select TFT Task.");
+            break;
+        case '5':
+            tskno = 5;
+            tskid = R2CA_TASK5;
+            syslog(LOG_INFO, "Select Processing Task.");
+            break;
+        case 'a':
+            syslog(LOG_INFO, "#act_tsk(%d)", tskno);
+            SVC_PERROR(act_tsk(tskid));
+            break;
+        case 'A':
+            syslog(LOG_INFO, "#can_act(%d)", tskno);
+            SVC_PERROR(ercd = can_act(tskid));
+            if (ercd >= 0) {
+                syslog(LOG_NOTICE, "can_act(%d) returns %d", tskno, ercd);
+            }
+            break;
+        case 't':
+            syslog(LOG_INFO, "#ter_tsk(%d)", tskno);
+            SVC_PERROR(ter_tsk(tskid));
+            break;
+        case '>':
+            syslog(LOG_INFO, "#chg_pri(%d, HIGH_PRIORITY)", tskno);
+            SVC_PERROR(chg_pri(tskid, HIGH_PRIORITY));
+            break;
+        case '=':
+            syslog(LOG_INFO, "#chg_pri(%d, MID_PRIORITY)", tskno);
+            SVC_PERROR(chg_pri(tskid, MID_PRIORITY));
+            break;
+        case '<':
+            syslog(LOG_INFO, "#chg_pri(%d, LOW_PRIORITY)", tskno);
+            SVC_PERROR(chg_pri(tskid, LOW_PRIORITY));
+            break;
+        case 'G':
+            syslog(LOG_INFO, "#get_pri(%d, &tskpri)", tskno);
+            SVC_PERROR(ercd = get_pri(tskid, &tskpri));
+            if (ercd >= 0) {
+                syslog(LOG_NOTICE, "priority of task %d is %d", tskno, tskpri);
+            }
+            break;
+        case 'w':
+            syslog(LOG_INFO, "#wup_tsk(%d)", tskno);
+            SVC_PERROR(wup_tsk(tskid));
+            break;
+        case 'W':
+            syslog(LOG_INFO, "#can_wup(%d)", tskno);
+            SVC_PERROR(ercd = can_wup(tskid));
+            if (ercd >= 0) {
+                syslog(LOG_NOTICE, "can_wup(%d) returns %d", tskno, ercd);
+            }
+            break;
+        case 'l':
+            syslog(LOG_INFO, "#rel_wai(%d)", tskno);
+            SVC_PERROR(rel_wai(tskid));
+            break;
+        case 'u':
+            syslog(LOG_INFO, "#sus_tsk(%d)", tskno);
+            SVC_PERROR(sus_tsk(tskid));
+            break;
+        case 'm':
+            syslog(LOG_INFO, "#rsm_tsk(%d)", tskno);
+            SVC_PERROR(rsm_tsk(tskid));
+            break;
+        case 'x':
+            syslog(LOG_INFO, "#ras_tex(%d, 0x0001U)", tskno);
+            SVC_PERROR(ras_tex(tskid, 0x0001U));
+            break;
+        case 'X':
+            syslog(LOG_INFO, "#ras_tex(%d, 0x0002U)", tskno);
+            SVC_PERROR(ras_tex(tskid, 0x0002U));
+            break;
+        case 'r':
+            syslog(LOG_INFO, "#rot_rdq(three priorities)");
+            SVC_PERROR(rot_rdq(HIGH_PRIORITY));
+            SVC_PERROR(rot_rdq(MID_PRIORITY));
+            SVC_PERROR(rot_rdq(LOW_PRIORITY));
+            break;
+        case 'V':
+            SVC_PERROR(get_utm(&utime1));
+            SVC_PERROR(get_utm(&utime2));
+            syslog(LOG_NOTICE, "utime1 = %ld, utime2 = %ld",
+                                        (ulong_t) utime1, (ulong_t) utime2);
+            break;
+        }
+    }
+    delay(10);
+}
+
+/////////////////////////////////////////////////////////////////////
+//
+//                       Sensor Task
+//
+/////////////////////////////////////////////////////////////////////
+//#define SENSOR_DEBUG_PRINT
+
+float tmp007_objt;
+float tmp007_diet;
+float tsl2591_light;
+uint16_t vcnl4000_proximity;
+
+#include <Wire.h>
+#include <Adafruit_Sensor.h>
+
+#define USE_TMP007
+#define USE_TSL2591
+#define USE_VCNL4000
+#define USE_I2CLCD
+
+#ifdef USE_TMP007
+#include "Adafruit_TMP007.h"
+Adafruit_TMP007 tmp007;
+#endif /*  USE_TMP007 */
+
+#ifdef USE_TSL2591
+#include "Adafruit_TSL2591.h"
+Adafruit_TSL2591 tsl2591(2591);
+#endif /* USE_TSL2591 */
+
+#ifdef USE_VCNL4000
+#include "Adafruit_VCNL4000.h"
+Adafruit_VCNL4000 vcnl4000;
+#endif /* USE_VCNL4000 */
+
+#define SENSOR_DELAY_MS     10
+
+#define TMP007_CYCLE_MS   1000
+uint32_t tmp007_cycle;
+
+#define TSL2591_CYCLE_MS  100
+uint32_t tsl2591_cycle;
+
+#define VCNL4000_CYCLE_MS 100
+uint32_t vcnl4000_cycle;
+
+#define I2CLCD_CYCLE_MS 100
+uint32_t i2clcd_cycle;
+
+uint32_t led_cycle;
+
+#ifdef USE_TSL2591
+/**************************************************************************/
+/*
+    Displays some basic information on this sensor from the unified
+    sensor API sensor_t type (see Adafruit_Sensor for more information)
+*/
+/**************************************************************************/
+void tsl2591_displaySensorDetails(void)
+{
+  sensor_t sensor;
+  tsl2591.getSensor(&sensor);
+  Serial.println("------------------------------------");
+  Serial.print  ("Sensor:       "); Serial.println(sensor.name);
+  Serial.print  ("Driver Ver:   "); Serial.println(sensor.version);
+  Serial.print  ("Unique ID:    "); Serial.println(sensor.sensor_id);
+  Serial.print  ("Max Value:    "); Serial.print(sensor.max_value); Serial.println(" lux");
+  Serial.print  ("Min Value:    "); Serial.print(sensor.min_value); Serial.println(" lux");
+  Serial.print  ("Resolution:   "); Serial.print(sensor.resolution); Serial.println(" lux");  
+  Serial.println("------------------------------------");
+  Serial.println("");
+  delay(500);
+}
+
+/**************************************************************************/
+/*
+    Configures the gain and integration time for the TSL2591
+*/
+/**************************************************************************/
+void tsl2591_configureSensor(void)
+{
+  // You can change the gain on the fly, to adapt to brighter/dimmer light situations
+  //tsl.setGain(TSL2591_GAIN_LOW);    // 1x gain (bright light)
+  tsl2591.setGain(TSL2591_GAIN_MED);      // 25x gain
+  //tsl.setGain(TSL2591_GAIN_HIGH);   // 428x gain
+  
+  // Changing the integration time gives you a longer time over which to sense light
+  // longer timelines are slower, but are good in very low light situtations!
+  tsl2591.setTiming(TSL2591_INTEGRATIONTIME_100MS);  // shortest integration time (bright light)
+  //tsl.setTiming(TSL2591_INTEGRATIONTIME_200MS);
+  //tsl.setTiming(TSL2591_INTEGRATIONTIME_300MS);
+  //tsl.setTiming(TSL2591_INTEGRATIONTIME_400MS);
+  //tsl.setTiming(TSL2591_INTEGRATIONTIME_500MS);
+  //tsl.setTiming(TSL2591_INTEGRATIONTIME_600MS);  // longest integration time (dim light)
+
+  /* Display the gain and integration time for reference sake */  
+  Serial.println("------------------------------------");
+  Serial.print  ("Gain:         ");
+  tsl2591Gain_t gain = tsl2591.getGain();
+  switch(gain)
+  {
+    case TSL2591_GAIN_LOW:
+      Serial.println("1x (Low)");
+      break;
+    case TSL2591_GAIN_MED:
+      Serial.println("25x (Medium)");
+      break;
+    case TSL2591_GAIN_HIGH:
+      Serial.println("428x (High)");
+      break;
+    case TSL2591_GAIN_MAX:
+      Serial.println("9876x (Max)");
+      break;
+  }
+  Serial.print  ("Timing:       ");
+  Serial.print((tsl2591.getTiming() + 1) * 100, DEC); 
+  Serial.println(" ms");
+  Serial.println("------------------------------------");
+  Serial.println("");
+}
+#endif /* USE_TSL2591 */
+
+void task1_setup() {
+    Serial.println("Sensor Task : setup start!");
+
+#ifdef USE_TMP007    
+    if (tmp007.begin()) {
+        Serial.println("Found a TMP007 sensor.");
+    } else {
+        Serial.println("No TMP007 found!");
+        while (1);
+    }
+    tmp007_cycle = 0;
+#endif /*  USE_TMP007 */
+    
+#ifdef USE_TSL2591
+    if (tsl2591.begin()) {
+        Serial.println("Found a TSL2591 sensor");
+    } else {
+        Serial.println("No TSL2591 found.");
+        while (1);
+    }
+    
+    /* Display some basic information on this sensor */
+    tsl2591_displaySensorDetails();
+  
+    /* Configure the sensor */
+    tsl2591_configureSensor();
+#endif /* USE_TSL2591 */
+
+#ifdef USE_VCNL4000
+    if (vcnl4000.begin()) {
+        Serial.println("Found a VCNL4000 sensor");
+    } else {
+        Serial.println("No VCNL4000 found.");
+        while (1);
+    }
+#endif /* USE_VCNL4000 */
+
+#ifdef USE_I2CLCD    
+    i2clcd_begin();
+#endif /* USE_I2CLCD */    
+}
+
+void loop1() {
+    static uint32_t sensor_cyc_tim = 0;
+
+    if ((millis() - sensor_cyc_tim) < SENSOR_DELAY_MS){
+        delay(1);
+        return;
+    }else{
+        sensor_cyc_tim = millis();
+    }
+    
+#ifdef USE_TMP007
+    /* TMP007 */
+    if((++tmp007_cycle) == (TMP007_CYCLE_MS/SENSOR_DELAY_MS)) {
+        tmp007_cycle = 0;
+        tmp007_objt = tmp007.readObjTempC();
+        tmp007_diet = tmp007.readDieTempC();
+#ifdef SENSOR_DEBUG_PRINT        
+        Serial.print("Object Temperature: "); Serial.print(tmp007_objt); Serial.println("*C");
+        Serial.print("Die Temperature:    "); Serial.print(tmp007_diet); Serial.println("*C");
+#endif /* SENSOR_DEBUG_PRINT */        
+    }
+#endif /*  USE_TMP007 */
+    
+#ifdef USE_TSL2591
+    /* TSL2591 */
+    if((++tsl2591_cycle) == (TSL2591_CYCLE_MS/SENSOR_DELAY_MS)) {
+        tsl2591_cycle = 0;
+        /* Get a new sensor event */ 
+        sensors_event_t event;
+        tsl2591.getEvent(&event);
+        tsl2591_light = event.light;
+#ifdef SENSOR_DEBUG_PRINT
+        /* Display the results (light is measured in lux) */
+        if ((event.light == 0) |
+            (event.light > 4294966000.0) | 
+            (event.light <-4294966000.0)) {
+            /* If event.light = 0 lux the sensor is probably saturated */
+            /* and no reliable data could be generated! */
+            /* if event.light is +/- 4294967040 there was a float over/underflow */
+            Serial.println("Invalid data (adjust gain or timing)");
+        } else {
+            Serial.print(event.light); Serial.println(" lux");
+        }
+#endif /* SENSOR_DEBUG_PRINT */
+    }
+#endif /* USE_TSL2591 */
+    
+#ifdef USE_VCNL4000    
+    /* VCNL4000 */
+    if((++vcnl4000_cycle) == (VCNL4000_CYCLE_MS/SENSOR_DELAY_MS)) {
+        vcnl4000_cycle = 0;
+        vcnl4000_proximity = vcnl4000.readProximity();
+#ifdef SENSOR_DEBUG_PRINT        
+        Serial.print("Ambient: "); Serial.println(vcnl4000.readAmbient());
+        Serial.print("Proimity: "); Serial.println(vcnl4000_proximity);
+#endif /* SENSOR_DEBUG_PRINT */        
+    }
+#endif /* USE_VCNL4000 */
+
+#ifdef USE_I2CLCD    
+    if((++i2clcd_cycle) == (I2CLCD_CYCLE_MS/SENSOR_DELAY_MS)) {
+        i2clcd_cycle = 0;
+        i2clcd_clear();
+        i2clcd_setCursor(0, 0);
+        i2clcd_printfloat(tmp007_objt);
+        i2clcd_printStr("*C");
+        i2clcd_setCursor(0, 1);
+        i2clcd_printInt(tsl2591_light);
+        i2clcd_printStr("lux");
+    }
+#endif /* USE_I2CLCD */    
+}
+
+/////////////////////////////////////////////////////////////////////
+//
+//                       Web Server Task
+//
+/////////////////////////////////////////////////////////////////////
+#include "ESP8266.h"
+
+ESP8266 wifi;
+
+void task2_setup()
+{
+    Serial.println("Web Server Task : Start!");
+    
+    wifi.begin(Serial5, 115200);
+    
+    Serial.print("FW Version:");
+    Serial.println(wifi.getVersion().c_str());
+    
+#if 0
+    if (wifi.setOprToStation()) {
+        Serial.print("to station ok\r\n");
+    } else {
+        Serial.print("to station err\r\n");
+    }
+    
+    if (wifi.joinAP(SSID, PASSWORD)) {
+        Serial.print("Join AP success\r\n");
+        Serial.print("IP: ");
+        Serial.println(wifi.getLocalIP().c_str());    
+    } else {
+        Serial.print("Join AP failure\r\n");
+    }
+#else
+    if (wifi.setOprToSoftAP()) {
+        Serial.print("to softap ok\r\n");
+    } else {
+        Serial.print("to softap err\r\n");
+    }
+    
+    if(wifi.setSoftAPParam(AP_SSID, AP_PASSWORD, 7, 0)){
+        Serial.print("Set SoftAP success\r\n");
+        Serial.print("IP: ");
+        Serial.println(wifi.getLocalIP().c_str());            
+    }
+    else {
+        Serial.print("Set SoftAP failure\r\n");
+    }
+#endif
+    if (wifi.enableMUX()) {
+        Serial.print("multiple ok\r\n");
+    } else {
+        Serial.print("multiple err\r\n");
+    }
+    
+    if (wifi.startTCPServer(80)) {
+        Serial.print("start tcp server ok\r\n");
+    } else {
+        Serial.print("start tcp server err\r\n");
+    }
+    
+    if (wifi.setTCPServerTimeout(10)) { 
+        Serial.print("set tcp server timout 10 seconds\r\n");
+    } else {
+        Serial.print("set tcp server timout err\r\n");
+    }
+    
+    Serial.print("setup end\r\n");
+}
+
+
+const char *web_led_control = " \
+HTTP/1.0 200 OK \r\n\
+Content-Type: text/html \r\n\
+\r\n\
+<html> \r\n\
+<head> \r\n\
+<script language=javascript> \r\n\
+function connecttext( textid, ischecked ) { \r\n\
+   document.getElementById(textid).disabled = !ischecked; \r\n\
+}  \r\n\
+</script> \r\n\
+</head> \r\n\
+<body><font size=\"7\"> \r\n\
+<form method=get> \r\n\
+ \r\n\
+<p> \r\n\
+<h3>LED</h3> \r\n\
+<input type=\"checkbox\" name=\"LED2_ONOFF\" value=\"on\" onChange=\"this.form.submit()\" LED2_ISCHECKED /> LED2 \r\n\
+<input type=\"checkbox\" name=\"LED1_ONOFF\" value=\"on\" onChange=\"this.form.submit()\" LED1_ISCHECKED /> LED1 \r\n\
+</p> \r\n\
+ \r\n\
+<p> \r\n\
+<h3>Mode</h3> \r\n\
+OnOff<INPUT type=\"radio\" name=\"led_mode\" value=\"onoff\" onclick=\"connecttext('textforscb3', false);\" onChange=\"this.form.submit()\" LED_MODE_ONOFF > \r\n\
+Blink<INPUT type=\"radio\" name=\"led_mode\" value=\"blink\" onclick=\"connecttext('textforscb3', true);\" onChange=\"this.form.submit()\" LED_MODE_BLINK > \r\n\
+</p> \r\n\
+ \r\n\
+<p> \r\n\
+<INPUT style=\"font-size:24px;\" type=\"text\" name=\"led_cycle\" id=\"textforscb3\" size=\"10\" value=\"LED_BLINK_CYC\" LED_BLINK_CYC_DISABLE> ms \r\n\
+<input style=\"font-size:24px;\" type=\"submit\" value=\"Update\"> \r\n\
+</p> \r\n\
+</form> \r\n\
+</body> \r\n\
+</html> \r\n\
+";
+
+
+const char *web_sensormonitor = " \
+HTTP/1.1 200 OK\r\n\
+Content-Type: text/html\r\n\
+Connection: close\r\n\
+Refresh: 2\r\n\
+\r\n\
+<!DOCTYPE HTML>\r\n\
+<html>\r\n \
+<body><font size=\"7\"> \r\n\
+<p>Die Temperature      : DIE_TEMP_I.DIE_TEMP_D *C</p>\r\n\
+<p>Object Temperature   : OBJ_TEMP_I.OBJ_TEMP_D *C</p>\r\n\
+<p>Illuminance          : TSL2591_LIGHT_I.TSL2591_LIGHT_D Lux</p>\r\n\
+<p>Proximity            : VCNL4000_PROXIMITY</p>\r\n\
+</body></html> ";
+
+const char *web_top = " \
+HTTP/1.0 200 OK \r\n\
+Content-Type: text/html \r\n\
+\r\n\
+<html> \r\n\
+<body><font size=\"7\"> \r\n\
+<ul> \r\n\
+<li><a href=\"./ledcontrol\">LED Control</a><br></li> \r\n\
+<li><a href=\"./sensormonitor\">Sensor Monitor</a><br></li> \r\n\
+</ul> \r\n\
+</body></html> ";
+
+
+void loop2()
+{
+    uint8_t buffer[128] = {0};
+    uint8_t mux_id;
+    uint32_t len = wifi.recv(&mux_id, buffer, sizeof(buffer));
+    String cmd;
+    
+    if(len == 0) {
+        return;
+    }
+    
+    Serial.println("Web Server Task : Recive Request");
+    String buf_string((char*)buffer);
+//    Serial.println(buf_string);
+
+    if((buf_string.indexOf("/ledcontrol") != -1)) {    
+        gled1_state = (buf_string.indexOf("LED1_ONOFF=on") != -1);
+        gled2_state = (buf_string.indexOf("LED2_ONOFF=on") != -1);
+        led_mode = (buf_string.indexOf("led_mode=blink") != -1)? LED_MODE_BLINK : LED_MODE_ONOFF;
+        int index = buf_string.indexOf("led_cycle=");
+        if(index != -1){
+            index += sizeof("led_cycle=") - 1;
+            int last_index = buf_string.indexOf(" ", index);
+            String sub_string = buf_string.substring(index, last_index);
+            led_blink_cyc = 0;
+            for(int i=0; i < sub_string.length(); i++){
+                led_blink_cyc = led_blink_cyc * 10 + (sub_string.charAt(i) - '0');
+            }
+        }      
+        cmd = web_led_control;
+        cmd.replace("LED1_ISCHECKED", (gled1_state)?"checked":"");
+        cmd.replace("LED2_ISCHECKED", (gled2_state)?"checked":"");
+        cmd.replace("LED_MODE_ONOFF", (led_mode == LED_MODE_ONOFF)?"checked":"");
+        cmd.replace("LED_MODE_BLINK", (led_mode == LED_MODE_BLINK)?"checked":"");      
+        String led_blink_cyc_str(led_blink_cyc);
+        cmd.replace("LED_BLINK_CYC_DISABLE",  (led_mode != LED_MODE_BLINK)?"disabled":"");      
+        cmd.replace("LED_BLINK_CYC",  led_blink_cyc_str);
+    }
+    else if((buf_string.indexOf("/sensormonitor") != -1)) {
+        cmd = web_sensormonitor;
+        cmd.replace("OBJ_TEMP_I", String((int)tmp007_objt));
+        cmd.replace("OBJ_TEMP_D", String((int)((tmp007_objt - (int)tmp007_objt) * 100)));
+        cmd.replace("DIE_TEMP_I", String((int)tmp007_diet));
+        cmd.replace("DIE_TEMP_D", String((int)((tmp007_diet - (int)tmp007_diet) * 100)));
+        cmd.replace("TSL2591_LIGHT_I", String((int)tsl2591_light));
+        cmd.replace("TSL2591_LIGHT_D", String((int)((tsl2591_light - (int)tsl2591_light) * 100)));
+        cmd.replace("VCNL4000_PROXIMITY", String(vcnl4000_proximity));      
+    }else {
+        cmd = web_top;
+    }
+        
+    wifi.send(mux_id, cmd);
+    wifi.releaseTCP(mux_id);
+}
+
+/////////////////////////////////////////////////////////////////////
+//
+//                       LED Task
+//
+/////////////////////////////////////////////////////////////////////
+void task3_setup() {
+    Serial.println("LED Task : setup start!");
+    pinMode(LED1_PORT, OUTPUT);
+    digitalWrite(LED1_PORT, LOW);
+    pinMode(LED2_PORT, OUTPUT);
+    digitalWrite(LED2_PORT, LOW);        
+}
+
+void loop3() {
+    static bool gled1_blink_state = false;
+    static bool gled2_blink_state = false;
+    static uint32_t analog_cnt = 0;
+    static bool     analog_cnt_mode = true;
+    
+    if(led_mode == LED_MODE_ONOFF) {
+        digitalWrite(LED1_PORT, (gled1_state)?HIGH:LOW);
+        digitalWrite(LED2_PORT, (gled2_state)?HIGH:LOW);
+    }
+    else {
+        if((++led_cycle) > (led_blink_cyc/2)) {
+            led_cycle = 0;            
+            if(gled1_state){
+                if(gled1_blink_state){
+                    gled1_blink_state = false;
+                    digitalWrite(LED1_PORT,LOW);
+                }else{
+                    gled1_blink_state = true;
+                    digitalWrite(LED1_PORT,HIGH);
+                }                
+            }
+            else {
+                digitalWrite(LED1_PORT, LOW);
+            }            
+            if(gled2_state){
+                if(gled2_blink_state){
+                    gled2_blink_state = false;
+                    digitalWrite(LED2_PORT,LOW);
+                }else{
+                    gled2_blink_state = true;
+                    digitalWrite(LED2_PORT,HIGH);
+                }                
+            }
+            else {
+                digitalWrite(LED2_PORT,LOW);
+            }            
+        }
+    }
+
+    if(analog_cnt_mode){
+        analog_cnt++;
+        if(analog_cnt > 255*5){
+            analog_cnt_mode = false;
+        }
+    }else{
+        analog_cnt--;
+        if(analog_cnt == 0){
+            analog_cnt_mode = true;
+        }
+    }
+    
+    analogWrite(13,analog_cnt/5);
+
+    delay(1);
+}
+
+/////////////////////////////////////////////////////////////////////
+//
+//                       TFT Task
+//
+/////////////////////////////////////////////////////////////////////
+/*
+
+ Arduino TFT Bitmap Logo example
+
+ This example reads an image file from a micro-SD card
+ and draws it on the screen, at random locations.
+
+ In this sketch, the Arduino logo is read from a micro-SD card.
+ There is a .bmp file included with this sketch.
+ - open the sketch folder (Ctrl-K or Cmd-K)
+ - copy the "arduino.bmp" file to a micro-SD
+ - put the SD into the SD slot of the Arduino TFT module.
+
+ This example code is in the public domain.
+
+ Created 19 April 2013 by Enrico Gueli
+
+ http://arduino.cc/en/Tutorial/TFTBitmapLogo
+
+ */
+
+// include the necessary libraries
+#include <SPI.h>
+#include <SD.h>
+#include <TFT.h>  // Arduino LCD library
+
+// pin definition for the Uno
+#define sd_cs  7
+#define lcd_cs 10
+#define dc     9
+#define rst    8
+
+// pin definition for the Leonardo
+//#define sd_cs  8
+//#define lcd_cs 7
+//#define dc     0
+//#define rst    1
+
+TFT TFTscreen = TFT(lcd_cs, dc, rst);
+
+// this variable represents the image to be drawn on screen
+PImage logo;
+
+void task4_setup() {
+  Serial.println(F("TFT Task : start!"));
+    
+  // initialize the GLCD and show a message
+  // asking the user to open the serial line
+  TFTscreen.begin();
+  TFTscreen.setRotation(0);
+  TFTscreen.background(255, 255, 255);
+
+  TFTscreen.stroke(0, 0, 255);
+  TFTscreen.println();
+  TFTscreen.println(F("Arduino TFT Bitmap Example"));
+  TFTscreen.stroke(0, 0, 0);
+  TFTscreen.println(F("Open serial monitor"));
+  TFTscreen.println(F("to run the sketch"));
+
+  delay(1000);
+    
+  // clear the GLCD screen before starting
+  TFTscreen.background(255, 255, 255);
+
+  // try to access the SD card. If that fails (e.g.
+  // no card present), the setup process will stop.
+  Serial.print(F("Initializing SD card..."));
+  if (!SD.begin(sd_cs)) {
+    Serial.println(F("failed!"));
+    return;
+  }
+  Serial.println(F("OK!"));
+
+  // initialize and clear the GLCD screen
+  TFTscreen.begin();
+  TFTscreen.setRotation(0);    
+  TFTscreen.background(255, 255, 255);
+
+  // now that the SD card can be access, try to load the
+  // image file.
+  logo = TFTscreen.loadImage("topame.bmp");
+  if (!logo.isValid()) {
+    Serial.println(F("error while loading arduino.bmp"));
+  }
+}
+
+int loop_cnt = 0;;
+
+void loop4() {    
+  // don't do anything if the image wasn't loaded correctly.
+  if (logo.isValid() == false) {
+    return;
+  }
+    
+  TFTscreen.setCursor(0, 30);
+  TFTscreen.print(F("loop() is running "));
+  TFTscreen.print(loop_cnt++);
+  TFTscreen.print(F("."));    
+  delay(1000);
+  TFTscreen.background(255, 255, 255);
+
+  // get a random location where to draw the image.
+  // To avoid the image to be draw outside the screen,
+  // take into account the image size.
+  int x = random(TFTscreen.width() - logo.width());
+  int y = random(TFTscreen.height() - logo.height());
+
+  // draw the image to the screen
+  TFTscreen.image(logo, x, y);
+
+  // wait a little bit before drawing again    
+  delay(2000);
+  TFTscreen.background(255, 255, 255);    
+}
+
+/////////////////////////////////////////////////////////////////////
+//
+//                       Processing Task
+//
+/////////////////////////////////////////////////////////////////////
+//#undef Serial 
+#define PSERIAL Serial3
+#define OSERIAL Serial
+
+bool processing_connected = false;
+
+void establishContact() {
+    while (!PSERIAL.available()) {
+        PSERIAL.print('A'); // send a capital A
+        delay(300);
+    }
+    OSERIAL.println("Processing Task : Connect!");
+    processing_connected = true;
+}
+
+void task5_setup()
+{
+    PSERIAL.begin(115200);
+    while(!PSERIAL){
+        delay(1);
+    }
+    OSERIAL.println("Processing Task : Start!");
+}
+
+int inByte = 0;
+int last_connect = 0;
+
+#define TIMEOUT_MS  3000
+
+void loop5()
+{
+    if(!processing_connected){
+        establishContact();        
+    }else{
+        if((millis() - last_connect) > TIMEOUT_MS){
+            processing_connected = false;
+            OSERIAL.println("Processing Task : Disconnect!");
+        }              
+    }
+    
+    uint16_t load;
+    uint16_t isr_cnt;
+    uint16_t dispatch_cnt;
+
+    load = 100 - map(r2ca_idle_result, 0, IDLE_TASK_IDLE_LOOP_10MS/10, 0, 100);
+    isr_cnt = (r2ca_isr_result > 0xffff)? 0xffff : r2ca_isr_result;
+    dispatch_cnt = (r2ca_dispatch_result > 0xffff)? 0xffff : r2ca_dispatch_result;
+    
+    if (PSERIAL.available()){
+        inByte = PSERIAL.read();        
+        last_connect = millis();
+#if 0                
+        uint8_t buf[10];
+        buf[0] = (uint8_t)(load >> 8);
+        buf[1] = (uint8_t)load;
+        buf[2] = (uint8_t)(isr_cnt >> 8);
+        buf[3] = (uint8_t)isr_cnt;
+        buf[4] = (uint8_t)(dispatch_cnt >> 8);
+        buf[5] = dispatch_cnt;
+        PSERIAL.write(buf, 6);
+#endif        
+        PSERIAL.write((uint8_t)(load >> 8));
+        PSERIAL.write((uint8_t)load);
+        PSERIAL.write((uint8_t)(isr_cnt >> 8));                
+        PSERIAL.write((uint8_t)isr_cnt);        
+        PSERIAL.write((uint8_t)(dispatch_cnt >> 8));
+        PSERIAL.write((uint8_t)dispatch_cnt);
+
+    }
+    delay(1);
+}
Index: rtos_arduino/trunk/examples/CompositeExample/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/CompositeExample/r2ca_app.h	(revision 260)
@@ -0,0 +1,19 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 5
+
+/*
+ *  Use Serial3
+ */
+#define R2CA_USE_SERIAL3
+
+#define  R2CA_TASK2_LOOP_PRI  4 //Web
+#define  R2CA_TASK3_LOOP_PRI  3 //LED
+#define  R2CA_TASK4_LOOP_PRI  7 //TFT
+#define  R2CA_TASK5_LOOP_PRI  6 //Processing
+
+#define R2CA_ENABLE_PROFILING
+#define R2CA_PROFILING_CYC_MS  1
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/CompositeExample/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/CompositeExample/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/CompositeExample/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/CompositeExample/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-INCLUDE("rca_lib.cfg");
-
Index: rtos_arduino/trunk/examples/CompositeExample/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,876 +1,0 @@
-#include "rca.h"
-#include "i2c_lcd.h"
-
-#define LED1_PORT 2
-#define LED2_PORT 3
-
-#define SSID       "XXXXX"
-#define PASSWORD   "YYYYY"
-
-#define AP_SSID       "M0_AP"
-#define AP_PASSWORD   "none"
-
-//#define Serial SerialUSB
-
-/////////////////////////////////////////////////////////////////////
-//                    Inter Task Variable
-/////////////////////////////////////////////////////////////////////
-#define LED_MODE_ONOFF 0
-#define LED_MODE_BLINK 1
-#define LED_BLINK_CYC_INIT 500
-
-bool gled1_state = false;
-bool gled2_state = false;
-uint8_t led_mode = LED_MODE_ONOFF;
-uint32_t led_blink_cyc = LED_BLINK_CYC_INIT;
-
-/////////////////////////////////////////////////////////////////////
-//                    Command  Task 
-/////////////////////////////////////////////////////////////////////
-const char *usage = " \
-1 : Select Sensor Task.\n\
-2 : Select Web Task. \n\
-3 : Select LED Task. \n\
-4 : Select TFT Task. \n\
-5 : Select Processing Task. \n\
-";
-
-void setup(){
-    Serial.begin(115200);    
-    while(!Serial){
-        delay(1);
-    }
-    Serial.println("Main Task : setup start!");
-    Serial.println(usage);
-}
-
-
-/*
- *  T[rXR[ÌG[ÌOoÍ
- */
-Inline void
-svc_perror(const char *file, int_t line, const char *expr, ER ercd)
-{
-	if (ercd < 0) {
-		t_perror(LOG_ERROR, file, line, expr, ercd);
-	}
-}
-
-#define	SVC_PERROR(expr)	svc_perror(__FILE__, __LINE__, #expr, (expr))
-
-ID		tskid = RCA_TASK1;
-int_t	tskno = 1;
-
-#define HIGH_PRIORITY  4
-#define MID_PRIORITY   5
-#define LOW_PRIORITY   6
-
-void loop(){
-    char c;
-    ER_UINT	ercd;
-    PRI		tskpri;
-    SYSUTM	utime1, utime2;
-    
-    if (Serial.available()){
-        c = Serial.read();
-        switch (c) {
-        case '1':
-            tskno = 1;
-            tskid = RCA_TASK1;
-            syslog(LOG_INFO, "Select Sensor Task.");
-            break;
-        case '2':
-            tskno = 2;
-            tskid = RCA_TASK2;
-            syslog(LOG_INFO, "Select Web Task.");
-            break;
-        case '3':
-            tskno = 3;
-            tskid = RCA_TASK3;
-            syslog(LOG_INFO, "Select LED Task.");
-            break;
-        case '4':
-            tskno = 4;
-            tskid = RCA_TASK4;
-            syslog(LOG_INFO, "Select TFT Task.");
-            break;
-        case '5':
-            tskno = 5;
-            tskid = RCA_TASK5;
-            syslog(LOG_INFO, "Select Processing Task.");
-            break;
-        case 'a':
-            syslog(LOG_INFO, "#act_tsk(%d)", tskno);
-            SVC_PERROR(act_tsk(tskid));
-            break;
-        case 'A':
-            syslog(LOG_INFO, "#can_act(%d)", tskno);
-            SVC_PERROR(ercd = can_act(tskid));
-            if (ercd >= 0) {
-                syslog(LOG_NOTICE, "can_act(%d) returns %d", tskno, ercd);
-            }
-            break;
-        case 't':
-            syslog(LOG_INFO, "#ter_tsk(%d)", tskno);
-            SVC_PERROR(ter_tsk(tskid));
-            break;
-        case '>':
-            syslog(LOG_INFO, "#chg_pri(%d, HIGH_PRIORITY)", tskno);
-            SVC_PERROR(chg_pri(tskid, HIGH_PRIORITY));
-            break;
-        case '=':
-            syslog(LOG_INFO, "#chg_pri(%d, MID_PRIORITY)", tskno);
-            SVC_PERROR(chg_pri(tskid, MID_PRIORITY));
-            break;
-        case '<':
-            syslog(LOG_INFO, "#chg_pri(%d, LOW_PRIORITY)", tskno);
-            SVC_PERROR(chg_pri(tskid, LOW_PRIORITY));
-            break;
-        case 'G':
-            syslog(LOG_INFO, "#get_pri(%d, &tskpri)", tskno);
-            SVC_PERROR(ercd = get_pri(tskid, &tskpri));
-            if (ercd >= 0) {
-                syslog(LOG_NOTICE, "priority of task %d is %d", tskno, tskpri);
-            }
-            break;
-        case 'w':
-            syslog(LOG_INFO, "#wup_tsk(%d)", tskno);
-            SVC_PERROR(wup_tsk(tskid));
-            break;
-        case 'W':
-            syslog(LOG_INFO, "#can_wup(%d)", tskno);
-            SVC_PERROR(ercd = can_wup(tskid));
-            if (ercd >= 0) {
-                syslog(LOG_NOTICE, "can_wup(%d) returns %d", tskno, ercd);
-            }
-            break;
-        case 'l':
-            syslog(LOG_INFO, "#rel_wai(%d)", tskno);
-            SVC_PERROR(rel_wai(tskid));
-            break;
-        case 'u':
-            syslog(LOG_INFO, "#sus_tsk(%d)", tskno);
-            SVC_PERROR(sus_tsk(tskid));
-            break;
-        case 'm':
-            syslog(LOG_INFO, "#rsm_tsk(%d)", tskno);
-            SVC_PERROR(rsm_tsk(tskid));
-            break;
-        case 'x':
-            syslog(LOG_INFO, "#ras_tex(%d, 0x0001U)", tskno);
-            SVC_PERROR(ras_tex(tskid, 0x0001U));
-            break;
-        case 'X':
-            syslog(LOG_INFO, "#ras_tex(%d, 0x0002U)", tskno);
-            SVC_PERROR(ras_tex(tskid, 0x0002U));
-            break;
-        case 'r':
-            syslog(LOG_INFO, "#rot_rdq(three priorities)");
-            SVC_PERROR(rot_rdq(HIGH_PRIORITY));
-            SVC_PERROR(rot_rdq(MID_PRIORITY));
-            SVC_PERROR(rot_rdq(LOW_PRIORITY));
-            break;
-        case 'V':
-            SVC_PERROR(get_utm(&utime1));
-            SVC_PERROR(get_utm(&utime2));
-            syslog(LOG_NOTICE, "utime1 = %ld, utime2 = %ld",
-                                        (ulong_t) utime1, (ulong_t) utime2);
-            break;
-        }
-    }
-    delay(10);
-}
-
-/////////////////////////////////////////////////////////////////////
-//
-//                       Sensor Task
-//
-/////////////////////////////////////////////////////////////////////
-//#define SENSOR_DEBUG_PRINT
-
-float tmp007_objt;
-float tmp007_diet;
-float tsl2591_light;
-uint16_t vcnl4000_proximity;
-
-#include <Wire.h>
-#include <Adafruit_Sensor.h>
-
-#define USE_TMP007
-#define USE_TSL2591
-#define USE_VCNL4000
-#define USE_I2CLCD
-
-#ifdef USE_TMP007
-#include "Adafruit_TMP007.h"
-Adafruit_TMP007 tmp007;
-#endif /*  USE_TMP007 */
-
-#ifdef USE_TSL2591
-#include "Adafruit_TSL2591.h"
-Adafruit_TSL2591 tsl2591(2591);
-#endif /* USE_TSL2591 */
-
-#ifdef USE_VCNL4000
-#include "Adafruit_VCNL4000.h"
-Adafruit_VCNL4000 vcnl4000;
-#endif /* USE_VCNL4000 */
-
-#define SENSOR_DELAY_MS     10
-
-#define TMP007_CYCLE_MS   1000
-uint32_t tmp007_cycle;
-
-#define TSL2591_CYCLE_MS  100
-uint32_t tsl2591_cycle;
-
-#define VCNL4000_CYCLE_MS 100
-uint32_t vcnl4000_cycle;
-
-#define I2CLCD_CYCLE_MS 100
-uint32_t i2clcd_cycle;
-
-uint32_t led_cycle;
-
-#ifdef USE_TSL2591
-/**************************************************************************/
-/*
-    Displays some basic information on this sensor from the unified
-    sensor API sensor_t type (see Adafruit_Sensor for more information)
-*/
-/**************************************************************************/
-void tsl2591_displaySensorDetails(void)
-{
-  sensor_t sensor;
-  tsl2591.getSensor(&sensor);
-  Serial.println("------------------------------------");
-  Serial.print  ("Sensor:       "); Serial.println(sensor.name);
-  Serial.print  ("Driver Ver:   "); Serial.println(sensor.version);
-  Serial.print  ("Unique ID:    "); Serial.println(sensor.sensor_id);
-  Serial.print  ("Max Value:    "); Serial.print(sensor.max_value); Serial.println(" lux");
-  Serial.print  ("Min Value:    "); Serial.print(sensor.min_value); Serial.println(" lux");
-  Serial.print  ("Resolution:   "); Serial.print(sensor.resolution); Serial.println(" lux");  
-  Serial.println("------------------------------------");
-  Serial.println("");
-  delay(500);
-}
-
-/**************************************************************************/
-/*
-    Configures the gain and integration time for the TSL2591
-*/
-/**************************************************************************/
-void tsl2591_configureSensor(void)
-{
-  // You can change the gain on the fly, to adapt to brighter/dimmer light situations
-  //tsl.setGain(TSL2591_GAIN_LOW);    // 1x gain (bright light)
-  tsl2591.setGain(TSL2591_GAIN_MED);      // 25x gain
-  //tsl.setGain(TSL2591_GAIN_HIGH);   // 428x gain
-  
-  // Changing the integration time gives you a longer time over which to sense light
-  // longer timelines are slower, but are good in very low light situtations!
-  tsl2591.setTiming(TSL2591_INTEGRATIONTIME_100MS);  // shortest integration time (bright light)
-  //tsl.setTiming(TSL2591_INTEGRATIONTIME_200MS);
-  //tsl.setTiming(TSL2591_INTEGRATIONTIME_300MS);
-  //tsl.setTiming(TSL2591_INTEGRATIONTIME_400MS);
-  //tsl.setTiming(TSL2591_INTEGRATIONTIME_500MS);
-  //tsl.setTiming(TSL2591_INTEGRATIONTIME_600MS);  // longest integration time (dim light)
-
-  /* Display the gain and integration time for reference sake */  
-  Serial.println("------------------------------------");
-  Serial.print  ("Gain:         ");
-  tsl2591Gain_t gain = tsl2591.getGain();
-  switch(gain)
-  {
-    case TSL2591_GAIN_LOW:
-      Serial.println("1x (Low)");
-      break;
-    case TSL2591_GAIN_MED:
-      Serial.println("25x (Medium)");
-      break;
-    case TSL2591_GAIN_HIGH:
-      Serial.println("428x (High)");
-      break;
-    case TSL2591_GAIN_MAX:
-      Serial.println("9876x (Max)");
-      break;
-  }
-  Serial.print  ("Timing:       ");
-  Serial.print((tsl2591.getTiming() + 1) * 100, DEC); 
-  Serial.println(" ms");
-  Serial.println("------------------------------------");
-  Serial.println("");
-}
-#endif /* USE_TSL2591 */
-
-void task1_setup() {
-    Serial.println("Sensor Task : setup start!");
-
-#ifdef USE_TMP007    
-    if (tmp007.begin()) {
-        Serial.println("Found a TMP007 sensor.");
-    } else {
-        Serial.println("No TMP007 found!");
-        while (1);
-    }
-    tmp007_cycle = 0;
-#endif /*  USE_TMP007 */
-    
-#ifdef USE_TSL2591
-    if (tsl2591.begin()) {
-        Serial.println("Found a TSL2591 sensor");
-    } else {
-        Serial.println("No TSL2591 found.");
-        while (1);
-    }
-    
-    /* Display some basic information on this sensor */
-    tsl2591_displaySensorDetails();
-  
-    /* Configure the sensor */
-    tsl2591_configureSensor();
-#endif /* USE_TSL2591 */
-
-#ifdef USE_VCNL4000
-    if (vcnl4000.begin()) {
-        Serial.println("Found a VCNL4000 sensor");
-    } else {
-        Serial.println("No VCNL4000 found.");
-        while (1);
-    }
-#endif /* USE_VCNL4000 */
-
-#ifdef USE_I2CLCD    
-    i2clcd_begin();
-#endif /* USE_I2CLCD */    
-}
-
-void task1_loop() {
-    static uint32_t sensor_cyc_tim = 0;
-
-    if ((millis() - sensor_cyc_tim) < SENSOR_DELAY_MS){
-        delay(1);
-        return;
-    }else{
-        sensor_cyc_tim = millis();
-    }
-    
-#ifdef USE_TMP007
-    /* TMP007 */
-    if((++tmp007_cycle) == (TMP007_CYCLE_MS/SENSOR_DELAY_MS)) {
-        tmp007_cycle = 0;
-        tmp007_objt = tmp007.readObjTempC();
-        tmp007_diet = tmp007.readDieTempC();
-#ifdef SENSOR_DEBUG_PRINT        
-        Serial.print("Object Temperature: "); Serial.print(tmp007_objt); Serial.println("*C");
-        Serial.print("Die Temperature:    "); Serial.print(tmp007_diet); Serial.println("*C");
-#endif /* SENSOR_DEBUG_PRINT */        
-    }
-#endif /*  USE_TMP007 */
-    
-#ifdef USE_TSL2591
-    /* TSL2591 */
-    if((++tsl2591_cycle) == (TSL2591_CYCLE_MS/SENSOR_DELAY_MS)) {
-        tsl2591_cycle = 0;
-        /* Get a new sensor event */ 
-        sensors_event_t event;
-        tsl2591.getEvent(&event);
-        tsl2591_light = event.light;
-#ifdef SENSOR_DEBUG_PRINT
-        /* Display the results (light is measured in lux) */
-        if ((event.light == 0) |
-            (event.light > 4294966000.0) | 
-            (event.light <-4294966000.0)) {
-            /* If event.light = 0 lux the sensor is probably saturated */
-            /* and no reliable data could be generated! */
-            /* if event.light is +/- 4294967040 there was a float over/underflow */
-            Serial.println("Invalid data (adjust gain or timing)");
-        } else {
-            Serial.print(event.light); Serial.println(" lux");
-        }
-#endif /* SENSOR_DEBUG_PRINT */
-    }
-#endif /* USE_TSL2591 */
-    
-#ifdef USE_VCNL4000    
-    /* VCNL4000 */
-    if((++vcnl4000_cycle) == (VCNL4000_CYCLE_MS/SENSOR_DELAY_MS)) {
-        vcnl4000_cycle = 0;
-        vcnl4000_proximity = vcnl4000.readProximity();
-#ifdef SENSOR_DEBUG_PRINT        
-        Serial.print("Ambient: "); Serial.println(vcnl4000.readAmbient());
-        Serial.print("Proimity: "); Serial.println(vcnl4000_proximity);
-#endif /* SENSOR_DEBUG_PRINT */        
-    }
-#endif /* USE_VCNL4000 */
-
-#ifdef USE_I2CLCD    
-    if((++i2clcd_cycle) == (I2CLCD_CYCLE_MS/SENSOR_DELAY_MS)) {
-        i2clcd_cycle = 0;
-        i2clcd_clear();
-        i2clcd_setCursor(0, 0);
-        i2clcd_printfloat(tmp007_objt);
-        i2clcd_printStr("*C");
-        i2clcd_setCursor(0, 1);
-        i2clcd_printInt(tsl2591_light);
-        i2clcd_printStr("lux");
-    }
-#endif /* USE_I2CLCD */    
-}
-
-/////////////////////////////////////////////////////////////////////
-//
-//                       Web Server Task
-//
-/////////////////////////////////////////////////////////////////////
-#include "ESP8266.h"
-
-ESP8266 wifi;
-
-void task2_setup()
-{
-    Serial.println("Web Server Task : Start!");
-    
-    wifi.begin(Serial5, 115200);
-    
-    Serial.print("FW Version:");
-    Serial.println(wifi.getVersion().c_str());
-    
-#if 0
-    if (wifi.setOprToStation()) {
-        Serial.print("to station ok\r\n");
-    } else {
-        Serial.print("to station err\r\n");
-    }
-    
-    if (wifi.joinAP(SSID, PASSWORD)) {
-        Serial.print("Join AP success\r\n");
-        Serial.print("IP: ");
-        Serial.println(wifi.getLocalIP().c_str());    
-    } else {
-        Serial.print("Join AP failure\r\n");
-    }
-#else
-    if (wifi.setOprToSoftAP()) {
-        Serial.print("to softap ok\r\n");
-    } else {
-        Serial.print("to softap err\r\n");
-    }
-    
-    if(wifi.setSoftAPParam(AP_SSID, AP_PASSWORD, 7, 0)){
-        Serial.print("Set SoftAP success\r\n");
-        Serial.print("IP: ");
-        Serial.println(wifi.getLocalIP().c_str());            
-    }
-    else {
-        Serial.print("Set SoftAP failure\r\n");
-    }
-#endif
-    if (wifi.enableMUX()) {
-        Serial.print("multiple ok\r\n");
-    } else {
-        Serial.print("multiple err\r\n");
-    }
-    
-    if (wifi.startTCPServer(80)) {
-        Serial.print("start tcp server ok\r\n");
-    } else {
-        Serial.print("start tcp server err\r\n");
-    }
-    
-    if (wifi.setTCPServerTimeout(10)) { 
-        Serial.print("set tcp server timout 10 seconds\r\n");
-    } else {
-        Serial.print("set tcp server timout err\r\n");
-    }
-    
-    Serial.print("setup end\r\n");
-}
-
-
-const char *web_led_control = " \
-HTTP/1.0 200 OK \r\n\
-Content-Type: text/html \r\n\
-\r\n\
-<html> \r\n\
-<head> \r\n\
-<script language=javascript> \r\n\
-function connecttext( textid, ischecked ) { \r\n\
-   document.getElementById(textid).disabled = !ischecked; \r\n\
-}  \r\n\
-</script> \r\n\
-</head> \r\n\
-<body><font size=\"7\"> \r\n\
-<form method=get> \r\n\
- \r\n\
-<p> \r\n\
-<h3>LED</h3> \r\n\
-<input type=\"checkbox\" name=\"LED2_ONOFF\" value=\"on\" onChange=\"this.form.submit()\" LED2_ISCHECKED /> LED2 \r\n\
-<input type=\"checkbox\" name=\"LED1_ONOFF\" value=\"on\" onChange=\"this.form.submit()\" LED1_ISCHECKED /> LED1 \r\n\
-</p> \r\n\
- \r\n\
-<p> \r\n\
-<h3>Mode</h3> \r\n\
-OnOff<INPUT type=\"radio\" name=\"led_mode\" value=\"onoff\" onclick=\"connecttext('textforscb3', false);\" onChange=\"this.form.submit()\" LED_MODE_ONOFF > \r\n\
-Blink<INPUT type=\"radio\" name=\"led_mode\" value=\"blink\" onclick=\"connecttext('textforscb3', true);\" onChange=\"this.form.submit()\" LED_MODE_BLINK > \r\n\
-</p> \r\n\
- \r\n\
-<p> \r\n\
-<INPUT style=\"font-size:24px;\" type=\"text\" name=\"led_cycle\" id=\"textforscb3\" size=\"10\" value=\"LED_BLINK_CYC\" LED_BLINK_CYC_DISABLE> ms \r\n\
-<input style=\"font-size:24px;\" type=\"submit\" value=\"Update\"> \r\n\
-</p> \r\n\
-</form> \r\n\
-</body> \r\n\
-</html> \r\n\
-";
-
-
-const char *web_sensormonitor = " \
-HTTP/1.1 200 OK\r\n\
-Content-Type: text/html\r\n\
-Connection: close\r\n\
-Refresh: 2\r\n\
-\r\n\
-<!DOCTYPE HTML>\r\n\
-<html>\r\n \
-<body><font size=\"7\"> \r\n\
-<p>Die Temperature      : DIE_TEMP_I.DIE_TEMP_D *C</p>\r\n\
-<p>Object Temperature   : OBJ_TEMP_I.OBJ_TEMP_D *C</p>\r\n\
-<p>Illuminance          : TSL2591_LIGHT_I.TSL2591_LIGHT_D Lux</p>\r\n\
-<p>Proximity            : VCNL4000_PROXIMITY</p>\r\n\
-</body></html> ";
-
-const char *web_top = " \
-HTTP/1.0 200 OK \r\n\
-Content-Type: text/html \r\n\
-\r\n\
-<html> \r\n\
-<body><font size=\"7\"> \r\n\
-<ul> \r\n\
-<li><a href=\"./ledcontrol\">LED Control</a><br></li> \r\n\
-<li><a href=\"./sensormonitor\">Sensor Monitor</a><br></li> \r\n\
-</ul> \r\n\
-</body></html> ";
-
-
-void task2_loop()
-{
-    uint8_t buffer[128] = {0};
-    uint8_t mux_id;
-    uint32_t len = wifi.recv(&mux_id, buffer, sizeof(buffer));
-    String cmd;
-    
-    if(len == 0) {
-        return;
-    }
-    
-    Serial.println("Web Server Task : Recive Request");
-    String buf_string((char*)buffer);
-//    Serial.println(buf_string);
-
-    if((buf_string.indexOf("/ledcontrol") != -1)) {    
-        gled1_state = (buf_string.indexOf("LED1_ONOFF=on") != -1);
-        gled2_state = (buf_string.indexOf("LED2_ONOFF=on") != -1);
-        led_mode = (buf_string.indexOf("led_mode=blink") != -1)? LED_MODE_BLINK : LED_MODE_ONOFF;
-        int index = buf_string.indexOf("led_cycle=");
-        if(index != -1){
-            index += sizeof("led_cycle=") - 1;
-            int last_index = buf_string.indexOf(" ", index);
-            String sub_string = buf_string.substring(index, last_index);
-            led_blink_cyc = 0;
-            for(int i=0; i < sub_string.length(); i++){
-                led_blink_cyc = led_blink_cyc * 10 + (sub_string.charAt(i) - '0');
-            }
-        }      
-        cmd = web_led_control;
-        cmd.replace("LED1_ISCHECKED", (gled1_state)?"checked":"");
-        cmd.replace("LED2_ISCHECKED", (gled2_state)?"checked":"");
-        cmd.replace("LED_MODE_ONOFF", (led_mode == LED_MODE_ONOFF)?"checked":"");
-        cmd.replace("LED_MODE_BLINK", (led_mode == LED_MODE_BLINK)?"checked":"");      
-        String led_blink_cyc_str(led_blink_cyc);
-        cmd.replace("LED_BLINK_CYC_DISABLE",  (led_mode != LED_MODE_BLINK)?"disabled":"");      
-        cmd.replace("LED_BLINK_CYC",  led_blink_cyc_str);
-    }
-    else if((buf_string.indexOf("/sensormonitor") != -1)) {
-        cmd = web_sensormonitor;
-        cmd.replace("OBJ_TEMP_I", String((int)tmp007_objt));
-        cmd.replace("OBJ_TEMP_D", String((int)((tmp007_objt - (int)tmp007_objt) * 100)));
-        cmd.replace("DIE_TEMP_I", String((int)tmp007_diet));
-        cmd.replace("DIE_TEMP_D", String((int)((tmp007_diet - (int)tmp007_diet) * 100)));
-        cmd.replace("TSL2591_LIGHT_I", String((int)tsl2591_light));
-        cmd.replace("TSL2591_LIGHT_D", String((int)((tsl2591_light - (int)tsl2591_light) * 100)));
-        cmd.replace("VCNL4000_PROXIMITY", String(vcnl4000_proximity));      
-    }else {
-        cmd = web_top;
-    }
-        
-    wifi.send(mux_id, cmd);
-    wifi.releaseTCP(mux_id);
-}
-
-/////////////////////////////////////////////////////////////////////
-//
-//                       LED Task
-//
-/////////////////////////////////////////////////////////////////////
-void task3_setup() {
-    Serial.println("LED Task : setup start!");
-    pinMode(LED1_PORT, OUTPUT);
-    digitalWrite(LED1_PORT, LOW);
-    pinMode(LED2_PORT, OUTPUT);
-    digitalWrite(LED2_PORT, LOW);        
-}
-
-void task3_loop() {
-    static bool gled1_blink_state = false;
-    static bool gled2_blink_state = false;
-    static uint32_t analog_cnt = 0;
-    static bool     analog_cnt_mode = true;
-    
-    if(led_mode == LED_MODE_ONOFF) {
-        digitalWrite(LED1_PORT, (gled1_state)?HIGH:LOW);
-        digitalWrite(LED2_PORT, (gled2_state)?HIGH:LOW);
-    }
-    else {
-        if((++led_cycle) > (led_blink_cyc/2)) {
-            led_cycle = 0;            
-            if(gled1_state){
-                if(gled1_blink_state){
-                    gled1_blink_state = false;
-                    digitalWrite(LED1_PORT,LOW);
-                }else{
-                    gled1_blink_state = true;
-                    digitalWrite(LED1_PORT,HIGH);
-                }                
-            }
-            else {
-                digitalWrite(LED1_PORT, LOW);
-            }            
-            if(gled2_state){
-                if(gled2_blink_state){
-                    gled2_blink_state = false;
-                    digitalWrite(LED2_PORT,LOW);
-                }else{
-                    gled2_blink_state = true;
-                    digitalWrite(LED2_PORT,HIGH);
-                }                
-            }
-            else {
-                digitalWrite(LED2_PORT,LOW);
-            }            
-        }
-    }
-
-    if(analog_cnt_mode){
-        analog_cnt++;
-        if(analog_cnt > 255*5){
-            analog_cnt_mode = false;
-        }
-    }else{
-        analog_cnt--;
-        if(analog_cnt == 0){
-            analog_cnt_mode = true;
-        }
-    }
-    
-    analogWrite(13,analog_cnt/5);
-
-    delay(1);
-}
-
-/////////////////////////////////////////////////////////////////////
-//
-//                       TFT Task
-//
-/////////////////////////////////////////////////////////////////////
-/*
-
- Arduino TFT Bitmap Logo example
-
- This example reads an image file from a micro-SD card
- and draws it on the screen, at random locations.
-
- In this sketch, the Arduino logo is read from a micro-SD card.
- There is a .bmp file included with this sketch.
- - open the sketch folder (Ctrl-K or Cmd-K)
- - copy the "arduino.bmp" file to a micro-SD
- - put the SD into the SD slot of the Arduino TFT module.
-
- This example code is in the public domain.
-
- Created 19 April 2013 by Enrico Gueli
-
- http://arduino.cc/en/Tutorial/TFTBitmapLogo
-
- */
-
-// include the necessary libraries
-#include <SPI.h>
-#include <SD.h>
-#include <TFT.h>  // Arduino LCD library
-
-// pin definition for the Uno
-#define sd_cs  7
-#define lcd_cs 10
-#define dc     9
-#define rst    8
-
-// pin definition for the Leonardo
-//#define sd_cs  8
-//#define lcd_cs 7
-//#define dc     0
-//#define rst    1
-
-TFT TFTscreen = TFT(lcd_cs, dc, rst);
-
-// this variable represents the image to be drawn on screen
-PImage logo;
-
-void task4_setup() {
-  Serial.println(F("TFT Task : start!"));
-    
-  // initialize the GLCD and show a message
-  // asking the user to open the serial line
-  TFTscreen.begin();
-  TFTscreen.setRotation(0);
-  TFTscreen.background(255, 255, 255);
-
-  TFTscreen.stroke(0, 0, 255);
-  TFTscreen.println();
-  TFTscreen.println(F("Arduino TFT Bitmap Example"));
-  TFTscreen.stroke(0, 0, 0);
-  TFTscreen.println(F("Open serial monitor"));
-  TFTscreen.println(F("to run the sketch"));
-
-  delay(1000);
-    
-  // clear the GLCD screen before starting
-  TFTscreen.background(255, 255, 255);
-
-  // try to access the SD card. If that fails (e.g.
-  // no card present), the setup process will stop.
-  Serial.print(F("Initializing SD card..."));
-  if (!SD.begin(sd_cs)) {
-    Serial.println(F("failed!"));
-    return;
-  }
-  Serial.println(F("OK!"));
-
-  // initialize and clear the GLCD screen
-  TFTscreen.begin();
-  TFTscreen.setRotation(0);    
-  TFTscreen.background(255, 255, 255);
-
-  // now that the SD card can be access, try to load the
-  // image file.
-  logo = TFTscreen.loadImage("topame.bmp");
-  if (!logo.isValid()) {
-    Serial.println(F("error while loading arduino.bmp"));
-  }
-}
-
-int loop_cnt = 0;;
-
-void task4_loop() {    
-  // don't do anything if the image wasn't loaded correctly.
-  if (logo.isValid() == false) {
-    return;
-  }
-    
-  TFTscreen.setCursor(0, 30);
-  TFTscreen.print(F("loop() is running "));
-  TFTscreen.print(loop_cnt++);
-  TFTscreen.print(F("."));    
-  delay(1000);
-  TFTscreen.background(255, 255, 255);
-
-  // get a random location where to draw the image.
-  // To avoid the image to be draw outside the screen,
-  // take into account the image size.
-  int x = random(TFTscreen.width() - logo.width());
-  int y = random(TFTscreen.height() - logo.height());
-
-  // draw the image to the screen
-  TFTscreen.image(logo, x, y);
-
-  // wait a little bit before drawing again    
-  delay(2000);
-  TFTscreen.background(255, 255, 255);    
-}
-
-/////////////////////////////////////////////////////////////////////
-//
-//                       Processing Task
-//
-/////////////////////////////////////////////////////////////////////
-//#undef Serial 
-#define PSERIAL Serial3
-#define OSERIAL Serial
-
-bool processing_connected = false;
-
-void establishContact() {
-    while (!PSERIAL.available()) {
-        PSERIAL.print('A'); // send a capital A
-        delay(300);
-    }
-    OSERIAL.println("Processing Task : Connect!");
-    processing_connected = true;
-}
-
-void task5_setup()
-{
-    PSERIAL.begin(115200);
-    while(!PSERIAL){
-        delay(1);
-    }
-    OSERIAL.println("Processing Task : Start!");
-}
-
-int inByte = 0;
-int last_connect = 0;
-
-#define TIMEOUT_MS  3000
-
-void task5_loop()
-{
-    if(!processing_connected){
-        establishContact();        
-    }else{
-        if((millis() - last_connect) > TIMEOUT_MS){
-            processing_connected = false;
-            OSERIAL.println("Processing Task : Disconnect!");
-        }              
-    }
-    
-    uint16_t load;
-    uint16_t isr_cnt;
-    uint16_t dispatch_cnt;
-
-    load = 100 - map(rca_idle_result, 0, IDLE_TASK_IDLE_LOOP_10MS/10, 0, 100);
-    isr_cnt = (rca_isr_result > 0xffff)? 0xffff : rca_isr_result;
-    dispatch_cnt = (rca_dispatch_result > 0xffff)? 0xffff : rca_dispatch_result;
-    
-    if (PSERIAL.available()){
-        inByte = PSERIAL.read();        
-        last_connect = millis();
-#if 0                
-        uint8_t buf[10];
-        buf[0] = (uint8_t)(load >> 8);
-        buf[1] = (uint8_t)load;
-        buf[2] = (uint8_t)(isr_cnt >> 8);
-        buf[3] = (uint8_t)isr_cnt;
-        buf[4] = (uint8_t)(dispatch_cnt >> 8);
-        buf[5] = dispatch_cnt;
-        PSERIAL.write(buf, 6);
-#endif        
-        PSERIAL.write((uint8_t)(load >> 8));
-        PSERIAL.write((uint8_t)load);
-        PSERIAL.write((uint8_t)(isr_cnt >> 8));                
-        PSERIAL.write((uint8_t)isr_cnt);        
-        PSERIAL.write((uint8_t)(dispatch_cnt >> 8));
-        PSERIAL.write((uint8_t)dispatch_cnt);
-
-    }
-    delay(1);
-}
Index: rtos_arduino/trunk/examples/CompositeExample/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,19 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 5
-
-/*
- *  Use Serial3
- */
-#define RCA_USE_SERIAL3
-
-#define  RCA_TASK2_LOOP_PRI  4 //Web
-#define  RCA_TASK3_LOOP_PRI  3 //LED
-#define  RCA_TASK4_LOOP_PRI  7 //TFT
-#define  RCA_TASK5_LOOP_PRI  6 //Processing
-
-#define RCA_ENABLE_PROFILING
-#define RCA_PROFILING_CYC_MS  1
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/IotText/sample1/Makefile
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample1/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/IotText/sample1/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -32,12 +32,12 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../../..
+R2CA_DIR = ../../..
 
 #
 #  ASPã®ã½ã¼ã¹ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-SRCDIR = $(RCA_DIR)/asp_1.9.2
+SRCDIR = $(R2CA_DIR)/asp_1.9.2
 
 #
@@ -48,20 +48,20 @@
 APPL_DIR     += 
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT
 APPL_CXXOBJS += ESP8266.o
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/aJson
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/aJson
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/Adafruit
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/aJson
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/aJson
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/Adafruit
 APPL_CXXOBJS += aJSON.o Milkcocoa.o Adafruit_MQTT.o Adafruit_MQTT_Client.o
 APPL_COBJS   += stringbuffer.o 
 
-APPL_DIR     += $(RCA_DIR)/examples/MultiTaskText/libraries/OLED_Display12864
+APPL_DIR     += $(R2CA_DIR)/examples/MultiTaskText/libraries/OLED_Display12864
 APPL_CXXOBJS += SeeedOLED.o
 APPL_COBJS   += 
 
-APPL_DIR     += $(RCA_DIR)/examples/MultiTaskText/libraries/Grove_Digital_Light_Sensor
+APPL_DIR     += $(R2CA_DIR)/examples/MultiTaskText/libraries/Grove_Digital_Light_Sensor
 APPL_CXXOBJS += Digital_Light_TSL2561.o
 APPL_COBJS   += 
@@ -69,3 +69,3 @@
 APPL_DIR     += ..
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/IotText/sample1/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample1/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/IotText/sample1/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,6 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+INCLUDE("r2ca_lib.cfg");
+
Index: rtos_arduino/trunk/examples/IotText/sample1/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample1/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/IotText/sample1/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,138 @@
+#include "r2ca.h"
+
+#include "ESP8266.h"
+#include "Milkcocoa.h"
+#include "Client_ESP8266.h"
+#include "../../examples_gdef.h"
+
+#include <Wire.h>
+#include <SeeedOLED.h>
+
+#define MILKCOCOA_SERVERPORT  1883
+
+ESP8266Client wifi_client;
+
+const char MQTT_SERVER[] PROGMEM	= MILKCOCOA_APP_ID ".mlkcca.com";
+const char MQTT_CLIENTID[] PROGMEM	= __TIME__ MILKCOCOA_APP_ID;
+
+Milkcocoa milkcocoa = Milkcocoa(&wifi_client, MQTT_SERVER, MILKCOCOA_SERVERPORT, MILKCOCOA_APP_ID, MQTT_CLIENTID);
+
+extern void onpush(DataElement *elem);
+
+void setup()
+{
+	int ret;
+
+	Serial.begin(115200);
+	Serial.print("Milkcocoa SDK demo");
+
+	// Connect to WiFi access point.
+	Serial.println(); Serial.println();
+	Serial.print("Connecting to ");
+	Serial.println(STA_SSID);
+
+	ret = WiFi.begin(Serial5, 115200);
+
+	if(ret == 1) {
+		Serial.print("Cannot communicate with ESP8266.");
+		while(1);
+	} else if(ret == 2) {
+		Serial.println("FW Version mismatch.");
+		Serial.print("FW Version:");
+		Serial.println(WiFi.getVersion().c_str());
+		Serial.print("Supported FW Version:");
+		Serial.println(ESP8266_SUPPORT_VERSION);
+		while(1);
+	} else {
+		Serial.print("begin ok\r\n");
+	}
+
+	Serial.print("FW Version:");
+	Serial.println(WiFi.getVersion().c_str());
+
+	if (WiFi.setOprToStation()) {
+		Serial.print("to station ok\r\n");
+	} else {
+		Serial.print("to station err\r\n");
+	}
+
+	if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
+		Serial.print("Join AP success\r\n");
+		Serial.print("IP: ");
+		Serial.println(WiFi.getLocalIP().c_str());
+	} else {
+		Serial.print("Join AP failure\r\n");
+	}
+
+	if (WiFi.stopServer()) {
+		Serial.print("Stop server ok\r\n");
+	} else {
+		Serial.print("Stop server err\r\n");
+	}
+
+	if (WiFi.disableMUX()) {
+		Serial.print("single ok\r\n");
+	} else {
+		Serial.print("single err\r\n");
+	}
+
+	if (milkcocoa.on(MILKCOCOA_DATASTORE, "push", onpush)){
+//	if (milkcocoa.on(MILKCOCOA_DATASTORE, "send", onpush)){
+		Serial.println("milkcocoa on sucesss");
+	}
+	else {
+		Serial.println("milkcocoa on failure");
+	}
+
+	Wire.begin();
+	SeeedOled.init();
+
+	SeeedOled.clearDisplay();
+	SeeedOled.setNormalDisplay();
+	SeeedOled.setPageMode();
+	SeeedOled.setTextXY(0,0);
+	SeeedOled.putString("Hello World!");
+
+	Serial.println("setup end\r\n");
+}
+
+void loop()
+{
+	int8_t ret;
+	int8_t push_ret;
+
+	while((ret = milkcocoa.loop(1)) != 0) {
+		Serial.println("Milkcocoa.loop() connection error.");
+		Serial.println(milkcocoa.connectErrorString(ret));
+		Serial.println(ret);
+		Serial.println("Retrying MQTT connection in 5 seconds...");
+		delay(5000);
+	}
+	Serial.print(".");
+
+	if (Serial.available() > 0) {
+		Serial.read();
+		Serial.print("Pause  : Input any char to continue.\n\r");
+		while(!(Serial.available() > 0));
+		Serial.print("Resume.\n\r");
+		Serial.read();
+	}
+}
+
+void onpush(DataElement *pelem)
+{
+	char *data;
+	static int ln = 1;
+
+	if(!pelem->getString("TEXT", &data)) {
+		Serial.print("onpush : key TEXT is not found.");
+		return;
+	};
+
+	Serial.print("onpush : {TEXT, ");
+	Serial.write(data);
+	Serial.println("}.");
+
+	SeeedOled.setTextXY(ln++%7,0);
+	SeeedOled.putString(data);
+}
Index: rtos_arduino/trunk/examples/IotText/sample1/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample1/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/IotText/sample1/r2ca_app.h	(revision 260)
@@ -0,0 +1,14 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 0
+
+/*
+ *  Use Serial3
+ */
+#define R2CA_USE_SERIAL3
+
+#define R2CA_ENABLE_PROFILING
+#define R2CA_PROFILING_CYC_MS  1
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/IotText/sample1/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample1/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-INCLUDE("rca_lib.cfg");
-
Index: rtos_arduino/trunk/examples/IotText/sample1/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample1/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,138 +1,0 @@
-#include "rca.h"
-
-#include "ESP8266.h"
-#include "Milkcocoa.h"
-#include "Client_ESP8266.h"
-#include "../../examples_gdef.h"
-
-#include <Wire.h>
-#include <SeeedOLED.h>
-
-#define MILKCOCOA_SERVERPORT  1883
-
-ESP8266Client wifi_client;
-
-const char MQTT_SERVER[] PROGMEM	= MILKCOCOA_APP_ID ".mlkcca.com";
-const char MQTT_CLIENTID[] PROGMEM	= __TIME__ MILKCOCOA_APP_ID;
-
-Milkcocoa milkcocoa = Milkcocoa(&wifi_client, MQTT_SERVER, MILKCOCOA_SERVERPORT, MILKCOCOA_APP_ID, MQTT_CLIENTID);
-
-extern void onpush(DataElement *elem);
-
-void setup()
-{
-	int ret;
-
-	Serial.begin(115200);
-	Serial.print("Milkcocoa SDK demo");
-
-	// Connect to WiFi access point.
-	Serial.println(); Serial.println();
-	Serial.print("Connecting to ");
-	Serial.println(STA_SSID);
-
-	ret = WiFi.begin(Serial5, 115200);
-
-	if(ret == 1) {
-		Serial.print("Cannot communicate with ESP8266.");
-		while(1);
-	} else if(ret == 2) {
-		Serial.println("FW Version mismatch.");
-		Serial.print("FW Version:");
-		Serial.println(WiFi.getVersion().c_str());
-		Serial.print("Supported FW Version:");
-		Serial.println(ESP8266_SUPPORT_VERSION);
-		while(1);
-	} else {
-		Serial.print("begin ok\r\n");
-	}
-
-	Serial.print("FW Version:");
-	Serial.println(WiFi.getVersion().c_str());
-
-	if (WiFi.setOprToStation()) {
-		Serial.print("to station ok\r\n");
-	} else {
-		Serial.print("to station err\r\n");
-	}
-
-	if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
-		Serial.print("Join AP success\r\n");
-		Serial.print("IP: ");
-		Serial.println(WiFi.getLocalIP().c_str());
-	} else {
-		Serial.print("Join AP failure\r\n");
-	}
-
-	if (WiFi.stopServer()) {
-		Serial.print("Stop server ok\r\n");
-	} else {
-		Serial.print("Stop server err\r\n");
-	}
-
-	if (WiFi.disableMUX()) {
-		Serial.print("single ok\r\n");
-	} else {
-		Serial.print("single err\r\n");
-	}
-
-	if (milkcocoa.on(MILKCOCOA_DATASTORE, "push", onpush)){
-//	if (milkcocoa.on(MILKCOCOA_DATASTORE, "send", onpush)){
-		Serial.println("milkcocoa on sucesss");
-	}
-	else {
-		Serial.println("milkcocoa on failure");
-	}
-
-	Wire.begin();
-	SeeedOled.init();
-
-	SeeedOled.clearDisplay();
-	SeeedOled.setNormalDisplay();
-	SeeedOled.setPageMode();
-	SeeedOled.setTextXY(0,0);
-	SeeedOled.putString("Hello World!");
-
-	Serial.println("setup end\r\n");
-}
-
-void loop()
-{
-	int8_t ret;
-	int8_t push_ret;
-
-	while((ret = milkcocoa.loop(1)) != 0) {
-		Serial.println("Milkcocoa.loop() connection error.");
-		Serial.println(milkcocoa.connectErrorString(ret));
-		Serial.println(ret);
-		Serial.println("Retrying MQTT connection in 5 seconds...");
-		delay(5000);
-	}
-	Serial.print(".");
-
-	if (Serial.available() > 0) {
-		Serial.read();
-		Serial.print("Pause  : Input any char to continue.\n\r");
-		while(!(Serial.available() > 0));
-		Serial.print("Resume.\n\r");
-		Serial.read();
-	}
-}
-
-void onpush(DataElement *pelem)
-{
-	char *data;
-	static int ln = 1;
-
-	if(!pelem->getString("TEXT", &data)) {
-		Serial.print("onpush : key TEXT is not found.");
-		return;
-	};
-
-	Serial.print("onpush : {TEXT, ");
-	Serial.write(data);
-	Serial.println("}.");
-
-	SeeedOled.setTextXY(ln++%7,0);
-	SeeedOled.putString(data);
-}
Index: rtos_arduino/trunk/examples/IotText/sample1/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample1/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 0
-
-/*
- *  Use Serial3
- */
-#define RCA_USE_SERIAL3
-
-#define RCA_ENABLE_PROFILING
-#define RCA_PROFILING_CYC_MS  1
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/IotText/sample2/Makefile
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample2/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/IotText/sample2/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -32,12 +32,12 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../../..
+R2CA_DIR = ../../..
 
 #
 #  ASPã®ã½ã¼ã¹ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-SRCDIR = $(RCA_DIR)/asp_1.9.2
+SRCDIR = $(R2CA_DIR)/asp_1.9.2
 
 #
@@ -48,20 +48,20 @@
 APPL_DIR     += 
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT
 APPL_CXXOBJS += ESP8266.o
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/aJson
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/aJson
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/Adafruit
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/aJson
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/aJson
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/Adafruit
 APPL_CXXOBJS += aJSON.o Milkcocoa.o Adafruit_MQTT.o Adafruit_MQTT_Client.o
 APPL_COBJS   += stringbuffer.o 
 
-APPL_DIR     += $(RCA_DIR)/examples/MultiTaskText/libraries/OLED_Display12864
+APPL_DIR     += $(R2CA_DIR)/examples/MultiTaskText/libraries/OLED_Display12864
 APPL_CXXOBJS += SeeedOLED.o
 APPL_COBJS   += 
 
-APPL_DIR     += $(RCA_DIR)/examples/MultiTaskText/libraries/Grove_Digital_Light_Sensor
+APPL_DIR     += $(R2CA_DIR)/examples/MultiTaskText/libraries/Grove_Digital_Light_Sensor
 APPL_CXXOBJS += Digital_Light_TSL2561.o
 APPL_COBJS   += 
@@ -69,3 +69,3 @@
 APPL_DIR     += ..
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/IotText/sample2/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample2/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/IotText/sample2/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,6 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+INCLUDE("r2ca_lib.cfg");
+
Index: rtos_arduino/trunk/examples/IotText/sample2/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample2/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/IotText/sample2/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,198 @@
+#include "r2ca.h"
+
+#include "ESP8266.h"
+#include "Milkcocoa.h"
+#include "Client_ESP8266.h"
+#include "../../examples_gdef.h"
+
+#define LED_RED 2
+#define TOUCH_SW 3
+
+#define MILKCOCOA_PUSH
+//#define MILKCOCOA_ON
+
+#define MILKCOCOA_SERVERPORT  1883
+
+ESP8266Client wifi_client;
+
+const char MQTT_SERVER[] PROGMEM	= MILKCOCOA_APP_ID ".mlkcca.com";
+const char MQTT_CLIENTID[] PROGMEM	= __TIME__ MILKCOCOA_APP_ID;
+
+Milkcocoa milkcocoa = Milkcocoa(&wifi_client, MQTT_SERVER, MILKCOCOA_SERVERPORT, MILKCOCOA_APP_ID, MQTT_CLIENTID);
+
+extern void onpush(DataElement *elem);
+
+void setup()
+{
+	int ret;
+
+	Serial.begin(115200);
+	Serial.print("Milkcocoa SDK demo");
+
+	// Connect to WiFi access point.
+	Serial.println(); Serial.println();
+	Serial.print("Connecting to ");
+	Serial.println(STA_SSID);
+
+	ret = WiFi.begin(Serial5, 115200);
+
+	if(ret == 1) {
+		Serial.print("Cannot communicate with ESP8266.");
+		while(1);
+	} else if(ret == 2) {
+		Serial.println("FW Version mismatch.");
+		Serial.print("FW Version:");
+		Serial.println(WiFi.getVersion().c_str());
+		Serial.print("Supported FW Version:");
+		Serial.println(ESP8266_SUPPORT_VERSION);
+		while(1);
+	} else {
+		Serial.print("begin ok\r\n");
+	}
+
+	Serial.print("FW Version:");
+	Serial.println(WiFi.getVersion().c_str());
+
+	if (WiFi.setOprToStation()) {
+		Serial.print("to station ok\r\n");
+	} else {
+		Serial.print("to station err\r\n");
+	}
+
+	if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
+		Serial.print("Join AP success\r\n");
+		Serial.print("IP: ");
+		Serial.println(WiFi.getLocalIP().c_str());
+	} else {
+		Serial.print("Join AP failure\r\n");
+	}
+
+	if (WiFi.stopServer()) {
+		Serial.print("Stop server ok\r\n");
+	} else {
+		Serial.print("Stop server err\r\n");
+	}
+
+	if (WiFi.disableMUX()) {
+		Serial.print("single ok\r\n");
+	} else {
+		Serial.print("single err\r\n");
+	}
+
+#ifdef MILKCOCOA_ON
+	if (milkcocoa.on(MILKCOCOA_DATASTORE, "push", onpush)){
+//	if (milkcocoa.on(MILKCOCOA_DATASTORE, "send", onpush)){
+		Serial.println("milkcocoa on sucesss");
+	}
+	else {
+		Serial.println("milkcocoa on failure");
+	}
+
+	pinMode(LED_RED, OUTPUT);
+	digitalWrite(LED_RED, LOW);
+#endif /* MILKCOCOA_ON  */
+
+	pinMode(TOUCH_SW, INPUT);
+
+	Serial.println("setup end\r\n");
+}
+
+void loop()
+{
+#ifdef MILKCOCOA_ON
+	int8_t ret;
+
+	while((ret = milkcocoa.loop(1)) != 0) {
+		Serial.println("Milkcocoa.loop() connection error.");
+		Serial.println(milkcocoa.connectErrorString(ret));
+		Serial.println(ret);
+		Serial.println("Retrying MQTT connection in 5 seconds...");
+		delay(5000);
+	}
+	Serial.print(".");
+#endif /* MILKCOCOA_ON  */
+
+#ifdef MILKCOCOA_PUSH
+	int8_t push_ret;
+	int sw_push = 0;
+	static int sw_st = 1;
+
+	switch(sw_st)
+	{
+	case 0:
+		if(digitalRead(TOUCH_SW))
+		{
+			sw_push = 1;
+			sw_st = 1;
+		}
+		break;
+	default:
+		if(!digitalRead(TOUCH_SW))
+		{
+			sw_push = 1;
+			sw_st = 0;
+		}
+		break;
+	}
+
+	if(sw_push)
+	{
+		DataElement elem = DataElement();
+
+		if(sw_st) {
+			Serial.println("Push data to Milkcocoa : Key:LED, Value:ON");
+			elem.setValue("LED", "ON");
+		}else {
+			Serial.println("Push data to Milkcocoa : Key:LED, Value:OFF");
+			elem.setValue("LED", "OFF");
+		}
+
+		do {
+			push_ret = milkcocoa.push(MILKCOCOA_DATASTORE, &elem);
+			if (push_ret != 0) {
+				Serial.println("Milkcocoa.push() error.");
+				Serial.println(milkcocoa.pushErrorString(push_ret));
+				Serial.println(push_ret);
+				Serial.println("Retrying MQTT push in 5 seconds...");
+				delay(5000);
+			}
+		}while(push_ret != 0);
+
+		Serial.println("Push success.");
+	}
+#endif /* MILKCOCOA_PUSH */
+
+	if (Serial.available() > 0) {
+		Serial.read();
+		Serial.print("Pause  : Input any char to continue.\n\r");
+		while(!(Serial.available() > 0));
+		Serial.print("Resume.\n\r");
+		Serial.read();
+	}
+}
+
+#ifdef MILKCOCOA_ON
+void onpush(DataElement *pelem)
+{
+	char *data;
+	static int ln = 0;
+
+	if(!pelem->getString("LED", &data)) {
+		Serial.print("onpush : key LED is not found.");
+		return;
+	};
+
+	Serial.print("onpush : {LED, ");
+	Serial.write(data);
+	Serial.println("}.");
+
+	if (strcmp(data, "ON") == 0) {
+		Serial.println("LED : ON!");
+		digitalWrite(LED_RED, HIGH);
+	}
+	else if(strcmp(data, "OFF") == 0) {
+		Serial.println("LED : OFF!");
+		digitalWrite(LED_RED, LOW);
+	}
+}
+#endif /* MILKCOCOA_ON */
Index: rtos_arduino/trunk/examples/IotText/sample2/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample2/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/IotText/sample2/r2ca_app.h	(revision 260)
@@ -0,0 +1,14 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 0
+
+/*
+ *  Use Serial3
+ */
+#define R2CA_USE_SERIAL3
+
+#define R2CA_ENABLE_PROFILING
+#define R2CA_PROFILING_CYC_MS  1
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/IotText/sample2/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample2/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-INCLUDE("rca_lib.cfg");
-
Index: rtos_arduino/trunk/examples/IotText/sample2/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample2/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,198 +1,0 @@
-#include "rca.h"
-
-#include "ESP8266.h"
-#include "Milkcocoa.h"
-#include "Client_ESP8266.h"
-#include "../../examples_gdef.h"
-
-#define LED_RED 2
-#define TOUCH_SW 3
-
-#define MILKCOCOA_PUSH
-//#define MILKCOCOA_ON
-
-#define MILKCOCOA_SERVERPORT  1883
-
-ESP8266Client wifi_client;
-
-const char MQTT_SERVER[] PROGMEM	= MILKCOCOA_APP_ID ".mlkcca.com";
-const char MQTT_CLIENTID[] PROGMEM	= __TIME__ MILKCOCOA_APP_ID;
-
-Milkcocoa milkcocoa = Milkcocoa(&wifi_client, MQTT_SERVER, MILKCOCOA_SERVERPORT, MILKCOCOA_APP_ID, MQTT_CLIENTID);
-
-extern void onpush(DataElement *elem);
-
-void setup()
-{
-	int ret;
-
-	Serial.begin(115200);
-	Serial.print("Milkcocoa SDK demo");
-
-	// Connect to WiFi access point.
-	Serial.println(); Serial.println();
-	Serial.print("Connecting to ");
-	Serial.println(STA_SSID);
-
-	ret = WiFi.begin(Serial5, 115200);
-
-	if(ret == 1) {
-		Serial.print("Cannot communicate with ESP8266.");
-		while(1);
-	} else if(ret == 2) {
-		Serial.println("FW Version mismatch.");
-		Serial.print("FW Version:");
-		Serial.println(WiFi.getVersion().c_str());
-		Serial.print("Supported FW Version:");
-		Serial.println(ESP8266_SUPPORT_VERSION);
-		while(1);
-	} else {
-		Serial.print("begin ok\r\n");
-	}
-
-	Serial.print("FW Version:");
-	Serial.println(WiFi.getVersion().c_str());
-
-	if (WiFi.setOprToStation()) {
-		Serial.print("to station ok\r\n");
-	} else {
-		Serial.print("to station err\r\n");
-	}
-
-	if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
-		Serial.print("Join AP success\r\n");
-		Serial.print("IP: ");
-		Serial.println(WiFi.getLocalIP().c_str());
-	} else {
-		Serial.print("Join AP failure\r\n");
-	}
-
-	if (WiFi.stopServer()) {
-		Serial.print("Stop server ok\r\n");
-	} else {
-		Serial.print("Stop server err\r\n");
-	}
-
-	if (WiFi.disableMUX()) {
-		Serial.print("single ok\r\n");
-	} else {
-		Serial.print("single err\r\n");
-	}
-
-#ifdef MILKCOCOA_ON
-	if (milkcocoa.on(MILKCOCOA_DATASTORE, "push", onpush)){
-//	if (milkcocoa.on(MILKCOCOA_DATASTORE, "send", onpush)){
-		Serial.println("milkcocoa on sucesss");
-	}
-	else {
-		Serial.println("milkcocoa on failure");
-	}
-
-	pinMode(LED_RED, OUTPUT);
-	digitalWrite(LED_RED, LOW);
-#endif /* MILKCOCOA_ON  */
-
-	pinMode(TOUCH_SW, INPUT);
-
-	Serial.println("setup end\r\n");
-}
-
-void loop()
-{
-#ifdef MILKCOCOA_ON
-	int8_t ret;
-
-	while((ret = milkcocoa.loop(1)) != 0) {
-		Serial.println("Milkcocoa.loop() connection error.");
-		Serial.println(milkcocoa.connectErrorString(ret));
-		Serial.println(ret);
-		Serial.println("Retrying MQTT connection in 5 seconds...");
-		delay(5000);
-	}
-	Serial.print(".");
-#endif /* MILKCOCOA_ON  */
-
-#ifdef MILKCOCOA_PUSH
-	int8_t push_ret;
-	int sw_push = 0;
-	static int sw_st = 1;
-
-	switch(sw_st)
-	{
-	case 0:
-		if(digitalRead(TOUCH_SW))
-		{
-			sw_push = 1;
-			sw_st = 1;
-		}
-		break;
-	default:
-		if(!digitalRead(TOUCH_SW))
-		{
-			sw_push = 1;
-			sw_st = 0;
-		}
-		break;
-	}
-
-	if(sw_push)
-	{
-		DataElement elem = DataElement();
-
-		if(sw_st) {
-			Serial.println("Push data to Milkcocoa : Key:LED, Value:ON");
-			elem.setValue("LED", "ON");
-		}else {
-			Serial.println("Push data to Milkcocoa : Key:LED, Value:OFF");
-			elem.setValue("LED", "OFF");
-		}
-
-		do {
-			push_ret = milkcocoa.push(MILKCOCOA_DATASTORE, &elem);
-			if (push_ret != 0) {
-				Serial.println("Milkcocoa.push() error.");
-				Serial.println(milkcocoa.pushErrorString(push_ret));
-				Serial.println(push_ret);
-				Serial.println("Retrying MQTT push in 5 seconds...");
-				delay(5000);
-			}
-		}while(push_ret != 0);
-
-		Serial.println("Push success.");
-	}
-#endif /* MILKCOCOA_PUSH */
-
-	if (Serial.available() > 0) {
-		Serial.read();
-		Serial.print("Pause  : Input any char to continue.\n\r");
-		while(!(Serial.available() > 0));
-		Serial.print("Resume.\n\r");
-		Serial.read();
-	}
-}
-
-#ifdef MILKCOCOA_ON
-void onpush(DataElement *pelem)
-{
-	char *data;
-	static int ln = 0;
-
-	if(!pelem->getString("LED", &data)) {
-		Serial.print("onpush : key LED is not found.");
-		return;
-	};
-
-	Serial.print("onpush : {LED, ");
-	Serial.write(data);
-	Serial.println("}.");
-
-	if (strcmp(data, "ON") == 0) {
-		Serial.println("LED : ON!");
-		digitalWrite(LED_RED, HIGH);
-	}
-	else if(strcmp(data, "OFF") == 0) {
-		Serial.println("LED : OFF!");
-		digitalWrite(LED_RED, LOW);
-	}
-}
-#endif /* MILKCOCOA_ON */
Index: rtos_arduino/trunk/examples/IotText/sample2/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample2/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 0
-
-/*
- *  Use Serial3
- */
-#define RCA_USE_SERIAL3
-
-#define RCA_ENABLE_PROFILING
-#define RCA_PROFILING_CYC_MS  1
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/IotText/sample3/Makefile
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample3/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/IotText/sample3/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -32,12 +32,12 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../../..
+R2CA_DIR = ../../..
 
 #
 #  ASPã®ã½ã¼ã¹ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-SRCDIR = $(RCA_DIR)/asp_1.9.2
+SRCDIR = $(R2CA_DIR)/asp_1.9.2
 
 #
@@ -48,20 +48,20 @@
 APPL_DIR     += 
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT
 APPL_CXXOBJS += ESP8266.o
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/aJson
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/aJson
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/Adafruit
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/aJson
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/aJson
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/Adafruit
 APPL_CXXOBJS += aJSON.o Milkcocoa.o Adafruit_MQTT.o Adafruit_MQTT_Client.o
 APPL_COBJS   += stringbuffer.o 
 
-APPL_DIR     += $(RCA_DIR)/examples/MultiTaskText/libraries/OLED_Display12864
+APPL_DIR     += $(R2CA_DIR)/examples/MultiTaskText/libraries/OLED_Display12864
 APPL_CXXOBJS += SeeedOLED.o
 APPL_COBJS   += 
 
-APPL_DIR     += $(RCA_DIR)/examples/MultiTaskText/libraries/Grove_Digital_Light_Sensor
+APPL_DIR     += $(R2CA_DIR)/examples/MultiTaskText/libraries/Grove_Digital_Light_Sensor
 APPL_CXXOBJS += Digital_Light_TSL2561.o
 APPL_COBJS   += 
@@ -69,3 +69,3 @@
 APPL_DIR     += ..
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/IotText/sample3/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample3/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/IotText/sample3/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,6 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+INCLUDE("r2ca_lib.cfg");
+
Index: rtos_arduino/trunk/examples/IotText/sample3/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample3/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/IotText/sample3/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,118 @@
+#include "r2ca.h"
+
+#include "ESP8266.h"
+#include "Milkcocoa.h"
+#include "Client_ESP8266.h"
+#include "../../examples_gdef.h"
+
+#include <Wire.h>
+#include <Digital_Light_TSL2561.h>
+
+#define MILKCOCOA_SERVERPORT  1883
+
+ESP8266Client wifi_client;
+
+const char MQTT_SERVER[] PROGMEM	= MILKCOCOA_APP_ID ".mlkcca.com";
+const char MQTT_CLIENTID[] PROGMEM	= __TIME__ MILKCOCOA_APP_ID;
+
+Milkcocoa milkcocoa = Milkcocoa(&wifi_client, MQTT_SERVER, MILKCOCOA_SERVERPORT, MILKCOCOA_APP_ID, MQTT_CLIENTID);
+
+extern void onpush(DataElement *elem);
+
+void setup()
+{
+	int ret;
+
+	Serial.begin(115200);
+	Serial.print("Milkcocoa SDK demo");
+
+	// Connect to WiFi access point.
+	Serial.println(); Serial.println();
+	Serial.print("Connecting to ");
+	Serial.println(STA_SSID);
+
+	ret = WiFi.begin(Serial5, 115200);
+
+	if(ret == 1) {
+		Serial.print("Cannot communicate with ESP8266.");
+		while(1);
+	} else if(ret == 2) {
+		Serial.println("FW Version mismatch.");
+		Serial.print("FW Version:");
+		Serial.println(WiFi.getVersion().c_str());
+		Serial.print("Supported FW Version:");
+		Serial.println(ESP8266_SUPPORT_VERSION);
+		while(1);
+	} else {
+		Serial.print("begin ok\r\n");
+	}
+
+	Serial.print("FW Version:");
+	Serial.println(WiFi.getVersion().c_str());
+
+	if (WiFi.setOprToStation()) {
+		Serial.print("to station ok\r\n");
+	} else {
+		Serial.print("to station err\r\n");
+	}
+
+	if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
+		Serial.print("Join AP success\r\n");
+		Serial.print("IP: ");
+		Serial.println(WiFi.getLocalIP().c_str());
+	} else {
+		Serial.print("Join AP failure\r\n");
+	}
+
+	if (WiFi.stopServer()) {
+		Serial.print("Stop server ok\r\n");
+	} else {
+		Serial.print("Stop server err\r\n");
+	}
+
+	if (WiFi.disableMUX()) {
+		Serial.print("single ok\r\n");
+	} else {
+		Serial.print("single err\r\n");
+	}
+
+	Wire.begin();
+	TSL2561.init();
+
+	Serial.println("setup end\r\n");
+}
+
+void loop()
+{
+	int8_t ret;
+	int8_t push_ret;
+
+	DataElement elem = DataElement();
+
+	Serial.print("Push data to Milkcocoa : Key:LUX, Value:");
+	int lux = (int)TSL2561.readVisibleLux();
+	Serial.println(lux);
+	elem.setValue("LUX", lux);
+
+	do {
+		push_ret = milkcocoa.push(MILKCOCOA_DATASTORE, &elem);
+		if (push_ret != 0) {
+			Serial.println("Milkcocoa.push() error.");
+			Serial.println(milkcocoa.pushErrorString(push_ret));
+			Serial.println(push_ret);
+			Serial.println("Retrying MQTT push in 5 seconds...");
+			delay(5000);
+		}
+	}while(push_ret != 0);
+
+	Serial.println("Push success.");
+	delay(2000);
+
+	if (Serial.available() > 0) {
+		Serial.read();
+		Serial.print("Pause  : Input any char to continue.\n\r");
+		while(!(Serial.available() > 0));
+		Serial.print("Resume.\n\r");
+		Serial.read();
+	}
+}
Index: rtos_arduino/trunk/examples/IotText/sample3/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample3/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/IotText/sample3/r2ca_app.h	(revision 260)
@@ -0,0 +1,14 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 0
+
+/*
+ *  Use Serial3
+ */
+#define R2CA_USE_SERIAL3
+
+#define R2CA_ENABLE_PROFILING
+#define R2CA_PROFILING_CYC_MS  1
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/IotText/sample3/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample3/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-INCLUDE("rca_lib.cfg");
-
Index: rtos_arduino/trunk/examples/IotText/sample3/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample3/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,118 +1,0 @@
-#include "rca.h"
-
-#include "ESP8266.h"
-#include "Milkcocoa.h"
-#include "Client_ESP8266.h"
-#include "../../examples_gdef.h"
-
-#include <Wire.h>
-#include <Digital_Light_TSL2561.h>
-
-#define MILKCOCOA_SERVERPORT  1883
-
-ESP8266Client wifi_client;
-
-const char MQTT_SERVER[] PROGMEM	= MILKCOCOA_APP_ID ".mlkcca.com";
-const char MQTT_CLIENTID[] PROGMEM	= __TIME__ MILKCOCOA_APP_ID;
-
-Milkcocoa milkcocoa = Milkcocoa(&wifi_client, MQTT_SERVER, MILKCOCOA_SERVERPORT, MILKCOCOA_APP_ID, MQTT_CLIENTID);
-
-extern void onpush(DataElement *elem);
-
-void setup()
-{
-	int ret;
-
-	Serial.begin(115200);
-	Serial.print("Milkcocoa SDK demo");
-
-	// Connect to WiFi access point.
-	Serial.println(); Serial.println();
-	Serial.print("Connecting to ");
-	Serial.println(STA_SSID);
-
-	ret = WiFi.begin(Serial5, 115200);
-
-	if(ret == 1) {
-		Serial.print("Cannot communicate with ESP8266.");
-		while(1);
-	} else if(ret == 2) {
-		Serial.println("FW Version mismatch.");
-		Serial.print("FW Version:");
-		Serial.println(WiFi.getVersion().c_str());
-		Serial.print("Supported FW Version:");
-		Serial.println(ESP8266_SUPPORT_VERSION);
-		while(1);
-	} else {
-		Serial.print("begin ok\r\n");
-	}
-
-	Serial.print("FW Version:");
-	Serial.println(WiFi.getVersion().c_str());
-
-	if (WiFi.setOprToStation()) {
-		Serial.print("to station ok\r\n");
-	} else {
-		Serial.print("to station err\r\n");
-	}
-
-	if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
-		Serial.print("Join AP success\r\n");
-		Serial.print("IP: ");
-		Serial.println(WiFi.getLocalIP().c_str());
-	} else {
-		Serial.print("Join AP failure\r\n");
-	}
-
-	if (WiFi.stopServer()) {
-		Serial.print("Stop server ok\r\n");
-	} else {
-		Serial.print("Stop server err\r\n");
-	}
-
-	if (WiFi.disableMUX()) {
-		Serial.print("single ok\r\n");
-	} else {
-		Serial.print("single err\r\n");
-	}
-
-	Wire.begin();
-	TSL2561.init();
-
-	Serial.println("setup end\r\n");
-}
-
-void loop()
-{
-	int8_t ret;
-	int8_t push_ret;
-
-	DataElement elem = DataElement();
-
-	Serial.print("Push data to Milkcocoa : Key:LUX, Value:");
-	int lux = (int)TSL2561.readVisibleLux();
-	Serial.println(lux);
-	elem.setValue("LUX", lux);
-
-	do {
-		push_ret = milkcocoa.push(MILKCOCOA_DATASTORE, &elem);
-		if (push_ret != 0) {
-			Serial.println("Milkcocoa.push() error.");
-			Serial.println(milkcocoa.pushErrorString(push_ret));
-			Serial.println(push_ret);
-			Serial.println("Retrying MQTT push in 5 seconds...");
-			delay(5000);
-		}
-	}while(push_ret != 0);
-
-	Serial.println("Push success.");
-	delay(2000);
-
-	if (Serial.available() > 0) {
-		Serial.read();
-		Serial.print("Pause  : Input any char to continue.\n\r");
-		while(!(Serial.available() > 0));
-		Serial.print("Resume.\n\r");
-		Serial.read();
-	}
-}
Index: rtos_arduino/trunk/examples/IotText/sample3/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample3/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 0
-
-/*
- *  Use Serial3
- */
-#define RCA_USE_SERIAL3
-
-#define RCA_ENABLE_PROFILING
-#define RCA_PROFILING_CYC_MS  1
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/IotText/sample4/Makefile
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample4/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/IotText/sample4/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -32,12 +32,12 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../../..
+R2CA_DIR = ../../..
 
 #
 #  ASPã®ã½ã¼ã¹ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-SRCDIR = $(RCA_DIR)/asp_1.9.2
+SRCDIR = $(R2CA_DIR)/asp_1.9.2
 
 #
@@ -48,20 +48,20 @@
 APPL_DIR     += 
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT
 APPL_CXXOBJS += ESP8266.o
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/aJson
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/aJson
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/Adafruit
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/aJson
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/aJson
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/Adafruit
 APPL_CXXOBJS += aJSON.o Milkcocoa.o Adafruit_MQTT.o Adafruit_MQTT_Client.o
 APPL_COBJS   += stringbuffer.o 
 
-APPL_DIR     += $(RCA_DIR)/examples/MultiTaskText/libraries/OLED_Display12864
+APPL_DIR     += $(R2CA_DIR)/examples/MultiTaskText/libraries/OLED_Display12864
 APPL_CXXOBJS += SeeedOLED.o
 APPL_COBJS   += 
 
-APPL_DIR     += $(RCA_DIR)/examples/MultiTaskText/libraries/Grove_Digital_Light_Sensor
+APPL_DIR     += $(R2CA_DIR)/examples/MultiTaskText/libraries/Grove_Digital_Light_Sensor
 APPL_CXXOBJS += Digital_Light_TSL2561.o
 APPL_COBJS   += 
@@ -69,3 +69,3 @@
 APPL_DIR     += ..
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/IotText/sample4/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample4/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/IotText/sample4/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,6 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+INCLUDE("r2ca_lib.cfg");
+
Index: rtos_arduino/trunk/examples/IotText/sample4/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample4/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/IotText/sample4/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,124 @@
+#include "r2ca.h"
+
+#include "ESP8266.h"
+#include "../../examples_gdef.h"
+
+#define IFTTT_KEY	""
+#define EVENT_NAME	""
+
+#define HOST_NAME	"maker.ifttt.com"
+#define HOST_PORT	(80)
+
+#define WiFi wifi
+#define TOUCH_SW 2
+
+ESP8266 WiFi;
+
+void setup()
+{
+	int ret;
+
+	Serial.begin(115200);
+	Serial.print("IFTTT demo");
+
+	// Connect to WiFi access point.
+	Serial.println(); Serial.println();
+	Serial.print("Connecting to ");
+	Serial.println(STA_SSID);
+
+	ret = WiFi.begin(Serial5, 115200);
+
+	if(ret == 1) {
+		Serial.print("Cannot communicate with ESP8266.");
+		while(1);
+	} else if(ret == 2) {
+		Serial.println("FW Version mismatch.");
+		Serial.print("FW Version:");
+		Serial.println(WiFi.getVersion().c_str());
+		Serial.print("Supported FW Version:");
+		Serial.println(ESP8266_SUPPORT_VERSION);
+		while(1);
+	} else {
+		Serial.print("begin ok\r\n");
+	}
+
+	Serial.print("FW Version:");
+	Serial.println(WiFi.getVersion().c_str());
+
+	if (WiFi.setOprToStation()) {
+		Serial.print("to station ok\r\n");
+	} else {
+		Serial.print("to station err\r\n");
+	}
+
+	if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
+		Serial.print("Join AP success\r\n");
+		Serial.print("IP: ");
+		Serial.println(WiFi.getLocalIP().c_str());
+	} else {
+		Serial.print("Join AP failure\r\n");
+	}
+
+	if (WiFi.stopServer()) {
+		Serial.print("Stop server ok\r\n");
+	} else {
+		Serial.print("Stop server err\r\n");
+	}
+
+	if (WiFi.disableMUX()) {
+		Serial.print("single ok\r\n");
+	} else {
+		Serial.print("single err\r\n");
+	}
+
+	Serial.println("setup end\r\n");
+}
+
+char buffer[1024];
+const char request1[] = "GET /trigger/" EVENT_NAME "/with/key/" IFTTT_KEY "/";
+const char request2[] = " HTTP/1.1\r\nHost: " HOST_NAME "\r\nConnection: close\r\n\r\n";
+
+void loop()
+{
+	static int value1 = 0, value2 = 1, value3 = 2;
+	int sw_push = 0;
+	static int sw_st = 1;
+
+	switch(sw_st) {
+	  case 0:
+		if(digitalRead(TOUCH_SW)) {
+			sw_push = 1;
+			sw_st = 1;
+		}
+		break;
+	  default:
+		if(!digitalRead(TOUCH_SW)) {
+			sw_st = 0;
+		}
+		break;
+	}
+
+	if(sw_push) {
+		value1++; value2++; value3++;
+
+		Serial.print("Send Touch Event and Extra Data ");
+		Serial.print(value1); Serial.print(", ");
+		Serial.print(value2); Serial.print(", ");
+		Serial.println(value3);
+
+		if (!WiFi.createTCP(HOST_NAME, HOST_PORT)) {
+			Serial.println("create tcp err");
+			return;
+		}
+
+		sprintf(buffer, "%s?value1=%d&value2=%d&value3=%d%s", request1, value1, value2, value3, request2);
+
+		WiFi.send((const uint8_t*)buffer, strlen(buffer));
+
+		uint32_t len = WiFi.recv((uint8_t*)buffer, sizeof(buffer), 10000);
+
+		if (!WiFi.releaseTCP()) {
+			Serial.println("release tcp err");
+		}
+	}
+}
Index: rtos_arduino/trunk/examples/IotText/sample4/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample4/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/IotText/sample4/r2ca_app.h	(revision 260)
@@ -0,0 +1,14 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 0
+
+/*
+ *  Use Serial3
+ */
+#define R2CA_USE_SERIAL3
+
+#define R2CA_ENABLE_PROFILING
+#define R2CA_PROFILING_CYC_MS  1
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/IotText/sample4/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample4/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-INCLUDE("rca_lib.cfg");
-
Index: rtos_arduino/trunk/examples/IotText/sample4/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample4/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,124 +1,0 @@
-#include "rca.h"
-
-#include "ESP8266.h"
-#include "../../examples_gdef.h"
-
-#define IFTTT_KEY	""
-#define EVENT_NAME	""
-
-#define HOST_NAME	"maker.ifttt.com"
-#define HOST_PORT	(80)
-
-#define WiFi wifi
-#define TOUCH_SW 2
-
-ESP8266 WiFi;
-
-void setup()
-{
-	int ret;
-
-	Serial.begin(115200);
-	Serial.print("IFTTT demo");
-
-	// Connect to WiFi access point.
-	Serial.println(); Serial.println();
-	Serial.print("Connecting to ");
-	Serial.println(STA_SSID);
-
-	ret = WiFi.begin(Serial5, 115200);
-
-	if(ret == 1) {
-		Serial.print("Cannot communicate with ESP8266.");
-		while(1);
-	} else if(ret == 2) {
-		Serial.println("FW Version mismatch.");
-		Serial.print("FW Version:");
-		Serial.println(WiFi.getVersion().c_str());
-		Serial.print("Supported FW Version:");
-		Serial.println(ESP8266_SUPPORT_VERSION);
-		while(1);
-	} else {
-		Serial.print("begin ok\r\n");
-	}
-
-	Serial.print("FW Version:");
-	Serial.println(WiFi.getVersion().c_str());
-
-	if (WiFi.setOprToStation()) {
-		Serial.print("to station ok\r\n");
-	} else {
-		Serial.print("to station err\r\n");
-	}
-
-	if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
-		Serial.print("Join AP success\r\n");
-		Serial.print("IP: ");
-		Serial.println(WiFi.getLocalIP().c_str());
-	} else {
-		Serial.print("Join AP failure\r\n");
-	}
-
-	if (WiFi.stopServer()) {
-		Serial.print("Stop server ok\r\n");
-	} else {
-		Serial.print("Stop server err\r\n");
-	}
-
-	if (WiFi.disableMUX()) {
-		Serial.print("single ok\r\n");
-	} else {
-		Serial.print("single err\r\n");
-	}
-
-	Serial.println("setup end\r\n");
-}
-
-char buffer[1024];
-const char request1[] = "GET /trigger/" EVENT_NAME "/with/key/" IFTTT_KEY "/";
-const char request2[] = " HTTP/1.1\r\nHost: " HOST_NAME "\r\nConnection: close\r\n\r\n";
-
-void loop()
-{
-	static int value1 = 0, value2 = 1, value3 = 2;
-	int sw_push = 0;
-	static int sw_st = 1;
-
-	switch(sw_st) {
-	  case 0:
-		if(digitalRead(TOUCH_SW)) {
-			sw_push = 1;
-			sw_st = 1;
-		}
-		break;
-	  default:
-		if(!digitalRead(TOUCH_SW)) {
-			sw_st = 0;
-		}
-		break;
-	}
-
-	if(sw_push) {
-		value1++; value2++; value3++;
-
-		Serial.print("Send Touch Event and Extra Data ");
-		Serial.print(value1); Serial.print(", ");
-		Serial.print(value2); Serial.print(", ");
-		Serial.println(value3);
-
-		if (!WiFi.createTCP(HOST_NAME, HOST_PORT)) {
-			Serial.println("create tcp err");
-			return;
-		}
-
-		sprintf(buffer, "%s?value1=%d&value2=%d&value3=%d%s", request1, value1, value2, value3, request2);
-
-		WiFi.send((const uint8_t*)buffer, strlen(buffer));
-
-		uint32_t len = WiFi.recv((uint8_t*)buffer, sizeof(buffer), 10000);
-
-		if (!WiFi.releaseTCP()) {
-			Serial.println("release tcp err");
-		}
-	}
-}
Index: rtos_arduino/trunk/examples/IotText/sample4/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/IotText/sample4/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 0
-
-/*
- *  Use Serial3
- */
-#define RCA_USE_SERIAL3
-
-#define RCA_ENABLE_PROFILING
-#define RCA_PROFILING_CYC_MS  1
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/Makefile
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -32,7 +32,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -49,16 +49,16 @@
 
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT
 APPL_CXXOBJS += ESP8266.o
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/aJson
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/aJson
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/Adafruit
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/aJson
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/aJson
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/Adafruit
 APPL_CXXOBJS += aJSON.o Milkcocoa.o Adafruit_MQTT.o Adafruit_MQTT_Client.o
 APPL_COBJS   += stringbuffer.o 
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Servo/src/ $(RCA_DIR)/arduino_lib/libraries/Servo/src/samd
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Servo/src/ $(R2CA_DIR)/arduino_lib/libraries/Servo/src/samd
 APPL_CXXOBJS += Servo.o
 APPL_COBJS   += 
@@ -68,3 +68,3 @@
 APPL_COBJS   += 
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,6 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+INCLUDE("r2ca_lib.cfg");
+
Index: rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,156 @@
+#include "r2ca.h"
+#include "ESP8266.h"
+#include "Milkcocoa.h"
+#include "Client_ESP8266.h"
+
+#include "../examples_gdef.h"
+
+#define MILKCOCOA_SERVERPORT  1883
+
+ESP8266Client wifi_client;
+
+const char MQTT_SERVER[] PROGMEM    = MILKCOCOA_APP_ID ".mlkcca.com";
+const char MQTT_CLIENTID[] PROGMEM  = __TIME__ MILKCOCOA_APP_ID;
+
+Milkcocoa milkcocoa = Milkcocoa(&wifi_client, MQTT_SERVER, MILKCOCOA_SERVERPORT, MILKCOCOA_APP_ID, MQTT_CLIENTID);
+
+#include <Servo.h> 
+Servo myservo; 
+
+#include "Ultrasonic.h"
+Ultrasonic ultrasonic(3);
+
+extern void onpush(DataElement *elem);
+
+void setup()
+{
+    int ret;
+    
+    Serial.begin(115200);
+    Serial.print("Milkcocoa NCES IoT demo");
+
+    // Connect to WiFi access point.
+    Serial.println(); Serial.println();
+    Serial.print("Connecting to ");
+    Serial.println(STA_SSID);
+
+    ret = WiFi.begin(Serial5, 115200);
+
+    if(ret == 1) {
+        Serial.print("Cannot communicate with ESP8266.");
+        while(1);        
+    } else if(ret == 2) {
+        Serial.println("FW Version mismatch.");
+        Serial.print("FW Version:");
+        Serial.println(WiFi.getVersion().c_str());
+        Serial.print("Supported FW Version:");
+        Serial.println(ESP8266_SUPPORT_VERSION);
+        while(1);
+    } else {
+        Serial.print("begin ok\r\n");
+    }
+
+    Serial.print("FW Version:");
+    Serial.println(WiFi.getVersion().c_str());
+    
+    if (WiFi.setOprToStation()) {
+        Serial.print("to station ok\r\n");
+    } else {
+        Serial.print("to station err\r\n");
+    }
+    
+    if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
+        Serial.print("Join AP success\r\n");
+        Serial.print("IP: ");
+        Serial.println(WiFi.getLocalIP().c_str());    
+    } else {
+        Serial.print("Join AP failure\r\n");
+    }
+
+    if (WiFi.stopServer()) {
+        Serial.print("Stop server ok\r\n");
+    } else {
+        Serial.print("Stop server err\r\n");
+    }        
+    
+    if (WiFi.disableMUX()) {
+        Serial.print("single ok\r\n");
+    } else {
+        Serial.print("single err\r\n");
+    }
+    
+    if (milkcocoa.on(MILKCOCOA_DATASTORE, "push", onpush)){
+        Serial.println("milkcocoa on sucesss");   
+    }
+    else {
+        Serial.println("milkcocoa on failure");   
+    }
+
+    myservo.attach(2);
+    
+    Serial.println("setup end\r\n");
+}
+
+void loop() {
+    int8_t ret;
+    int8_t push_ret;
+    
+    long RangeInCentimeters;
+    RangeInCentimeters = ultrasonic.MeasureInCentimeters();
+    Serial.print(RangeInCentimeters);//0~400cm
+    Serial.println(" cm");
+    
+    DataElement elem = DataElement();
+    elem.setValue("RangeInCentimeters", (int)RangeInCentimeters);
+    
+    do {
+        push_ret = milkcocoa.push(MILKCOCOA_DATASTORE, &elem);
+        if (push_ret != 0) {
+            Serial.println("Milkcocoa.push() error.");
+            Serial.println(milkcocoa.pushErrorString(push_ret));
+            Serial.println(push_ret);
+            Serial.println("Retrying MQTT push in 5 seconds...");
+            delay(5000);
+        }        
+    }while(push_ret != 0);
+    
+    Serial.println("Push success.");
+    delay(2000);
+    
+    if (Serial.available() > 0) {
+        Serial.read();
+        Serial.print("Pause  : Input any char to continue.\n\r");
+        while(!(Serial.available() > 0));
+        Serial.print("Resume.\n\r");
+        Serial.read();
+    }    
+}
+
+void onpush(DataElement *pelem) {
+    char *data;
+    int  pos;
+    if(!pelem->getString("SERVO", &data)) {
+        return;
+    };
+    
+    pos = atoi(data);
+
+    if ((pos >=  0) && (pos <= 180))  {
+        myservo.write(pos);
+        Serial.print("Ser Servo : ");
+        Serial.println(pos);
+    }
+}
+
+
+void loop1() {
+    int8_t ret;
+    while((ret = milkcocoa.loop(1)) != 0) {
+        Serial.println("Milkcocoa.loop() connection error.");
+        Serial.println(milkcocoa.connectErrorString(ret));
+        Serial.println(ret);
+        Serial.println("Retrying MQTT connection in 5 seconds...");
+        delay(5000);
+    }
+    delay(100);
+}
Index: rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/r2ca_app.h	(revision 260)
@@ -0,0 +1,6 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 1
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-INCLUDE("rca_lib.cfg");
-
Index: rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-#include "rca.h"
-#include "ESP8266.h"
-#include "Milkcocoa.h"
-#include "Client_ESP8266.h"
-
-#include "../examples_gdef.h"
-
-#define MILKCOCOA_SERVERPORT  1883
-
-ESP8266Client wifi_client;
-
-const char MQTT_SERVER[] PROGMEM    = MILKCOCOA_APP_ID ".mlkcca.com";
-const char MQTT_CLIENTID[] PROGMEM  = __TIME__ MILKCOCOA_APP_ID;
-
-Milkcocoa milkcocoa = Milkcocoa(&wifi_client, MQTT_SERVER, MILKCOCOA_SERVERPORT, MILKCOCOA_APP_ID, MQTT_CLIENTID);
-
-#include <Servo.h> 
-Servo myservo; 
-
-#include "Ultrasonic.h"
-Ultrasonic ultrasonic(3);
-
-extern void onpush(DataElement *elem);
-
-bool setup_done = false;
-
-void setup()
-{
-    int ret;
-    
-    Serial.begin(115200);
-    Serial.print("Milkcocoa NCES IoT demo");
-
-    // Connect to WiFi access point.
-    Serial.println(); Serial.println();
-    Serial.print("Connecting to ");
-    Serial.println(STA_SSID);
-
-    ret = WiFi.begin(Serial5, 115200);
-
-    if(ret == 1) {
-        Serial.print("Cannot communicate with ESP8266.");
-        while(1);        
-    } else if(ret == 2) {
-        Serial.println("FW Version mismatch.");
-        Serial.print("FW Version:");
-        Serial.println(WiFi.getVersion().c_str());
-        Serial.print("Supported FW Version:");
-        Serial.println(ESP8266_SUPPORT_VERSION);
-        while(1);
-    } else {
-        Serial.print("begin ok\r\n");
-    }
-
-    Serial.print("FW Version:");
-    Serial.println(WiFi.getVersion().c_str());
-    
-    if (WiFi.setOprToStation()) {
-        Serial.print("to station ok\r\n");
-    } else {
-        Serial.print("to station err\r\n");
-    }
-    
-    if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
-        Serial.print("Join AP success\r\n");
-        Serial.print("IP: ");
-        Serial.println(WiFi.getLocalIP().c_str());    
-    } else {
-        Serial.print("Join AP failure\r\n");
-    }
-
-    if (WiFi.stopServer()) {
-        Serial.print("Stop server ok\r\n");
-    } else {
-        Serial.print("Stop server err\r\n");
-    }        
-    
-    if (WiFi.disableMUX()) {
-        Serial.print("single ok\r\n");
-    } else {
-        Serial.print("single err\r\n");
-    }
-    
-    if (milkcocoa.on(MILKCOCOA_DATASTORE, "push", onpush)){
-        Serial.println("milkcocoa on sucesss");   
-    }
-    else {
-        Serial.println("milkcocoa on failure");   
-    }
-
-    myservo.attach(2);
-    
-    setup_done = true;
-    Serial.println("setup end\r\n");
-}
-
-void loop() {
-    int8_t ret;
-    int8_t push_ret;
-    
-    long RangeInCentimeters;
-    RangeInCentimeters = ultrasonic.MeasureInCentimeters();
-    Serial.print(RangeInCentimeters);//0~400cm
-    Serial.println(" cm");
-    
-    DataElement elem = DataElement();
-    elem.setValue("RangeInCentimeters", (int)RangeInCentimeters);
-    
-    do {
-        push_ret = milkcocoa.push(MILKCOCOA_DATASTORE, &elem);
-        if (push_ret != 0) {
-            Serial.println("Milkcocoa.push() error.");
-            Serial.println(milkcocoa.pushErrorString(push_ret));
-            Serial.println(push_ret);
-            Serial.println("Retrying MQTT push in 5 seconds...");
-            delay(5000);
-        }        
-    }while(push_ret != 0);
-    
-    Serial.println("Push success.");
-    delay(2000);
-    
-    if (Serial.available() > 0) {
-        Serial.read();
-        Serial.print("Pause  : Input any char to continue.\n\r");
-        while(!(Serial.available() > 0));
-        Serial.print("Resume.\n\r");
-        Serial.read();
-    }    
-}
-
-void onpush(DataElement *pelem) {
-    char *data;
-    int  pos;
-    if(!pelem->getString("SERVO", &data)) {
-        return;
-    };
-    
-    pos = atoi(data);
-
-    if ((pos >=  0) && (pos <= 180))  {
-        myservo.write(pos);
-        Serial.print("Ser Servo : ");
-        Serial.println(pos);
-    }
-}
-
-
-/*
- *  For TASK1
- */
-void task1_setup() {
-    while(!setup_done) {
-        delay(1);
-    }
-    Serial.println("Servo Task : start");
-}
-
-void task1_loop() {
-    int8_t ret;
-    while((ret = milkcocoa.loop(1)) != 0) {
-        Serial.println("Milkcocoa.loop() connection error.");
-        Serial.println(milkcocoa.connectErrorString(ret));
-        Serial.println(ret);
-        Serial.println("Retrying MQTT connection in 5 seconds...");
-        delay(5000);
-    }
-    delay(100);
-}
Index: rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_NCESIoT/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 1
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/Milkcocoa_basic/Makefile
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_basic/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/Milkcocoa_basic/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -32,7 +32,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -49,14 +49,14 @@
 
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT
 APPL_CXXOBJS += ESP8266.o
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/aJson
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/aJson
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/Adafruit
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/aJson
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/aJson
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Milkcocoa_Arduino_SDK/include/Adafruit
 APPL_CXXOBJS += aJSON.o Milkcocoa.o Adafruit_MQTT.o Adafruit_MQTT_Client.o
 APPL_COBJS   += stringbuffer.o 
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,6 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+INCLUDE("r2ca_lib.cfg");
+
Index: rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,168 @@
+#include "r2ca.h"
+#include "ESP8266.h"
+#include "Milkcocoa.h"
+#include "Client_ESP8266.h"
+
+#include "../examples_gdef.h"
+
+//#define MILKCOCOA_PUSH
+#define MILKCOCOA_ON
+
+#define MILKCOCOA_SERVERPORT  1883
+
+ESP8266Client wifi_client;
+
+const char MQTT_SERVER[] PROGMEM    = MILKCOCOA_APP_ID ".mlkcca.com";
+const char MQTT_CLIENTID[] PROGMEM  = __TIME__ MILKCOCOA_APP_ID;
+
+Milkcocoa milkcocoa = Milkcocoa(&wifi_client, MQTT_SERVER, MILKCOCOA_SERVERPORT, MILKCOCOA_APP_ID, MQTT_CLIENTID);
+
+extern void onpush(DataElement *elem);
+
+void setup()
+{
+    int ret;
+    
+    Serial.begin(115200);
+    Serial.print("Milkcocoa SDK demo");
+
+    // Connect to WiFi access point.
+    Serial.println(); Serial.println();
+    Serial.print("Connecting to ");
+    Serial.println(STA_SSID);
+
+    ret = WiFi.begin(Serial5, 115200);
+
+    if(ret == 1) {
+        Serial.print("Cannot communicate with ESP8266.");
+        while(1);        
+    } else if(ret == 2) {
+        Serial.println("FW Version mismatch.");
+        Serial.print("FW Version:");
+        Serial.println(WiFi.getVersion().c_str());
+        Serial.print("Supported FW Version:");
+        Serial.println(ESP8266_SUPPORT_VERSION);
+        while(1);
+    } else {
+        Serial.print("begin ok\r\n");
+    }
+
+    Serial.print("FW Version:");
+    Serial.println(WiFi.getVersion().c_str());
+    
+    if (WiFi.setOprToStation()) {
+        Serial.print("to station ok\r\n");
+    } else {
+        Serial.print("to station err\r\n");
+    }
+    
+    if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
+        Serial.print("Join AP success\r\n");
+        Serial.print("IP: ");
+        Serial.println(WiFi.getLocalIP().c_str());    
+    } else {
+        Serial.print("Join AP failure\r\n");
+    }
+
+    if (WiFi.stopServer()) {
+        Serial.print("Stop server ok\r\n");
+    } else {
+        Serial.print("Stop server err\r\n");
+    }        
+    
+    if (WiFi.disableMUX()) {
+        Serial.print("single ok\r\n");
+    } else {
+        Serial.print("single err\r\n");
+    }
+    
+#ifdef MILKCOCOA_ON
+    if (milkcocoa.on(MILKCOCOA_DATASTORE, "push", onpush)){
+        Serial.println("milkcocoa on sucesss");   
+    }
+    else {
+        Serial.println("milkcocoa on failure");   
+    }
+
+    pinMode(13, OUTPUT);
+    digitalWrite(13, LOW);   
+#endif /* MILKCOCOA_ON  */
+
+    Serial.println("setup end\r\n");
+}
+
+#ifdef MILKCOCOA_PUSH
+bool req_led_on = false;
+#endif /* MILKCOCOA_PUSH */
+
+void loop() {
+    int8_t ret;
+    int8_t push_ret;
+    
+#ifdef MILKCOCOA_ON
+    while((ret = milkcocoa.loop(1)) != 0) {
+        Serial.println("Milkcocoa.loop() connection error.");
+        Serial.println(milkcocoa.connectErrorString(ret));
+        Serial.println(ret);
+        Serial.println("Retrying MQTT connection in 5 seconds...");
+        delay(5000);
+    }
+    Serial.print(".");
+#endif /* MILKCOCOA_ON */
+    
+#ifdef MILKCOCOA_PUSH
+    DataElement elem = DataElement();
+    
+    if(req_led_on) {
+        Serial.println("Push data to Milkcocoa : Key:LED, Value:ON");
+        elem.setValue("LED", "ON");
+    }else {
+        Serial.println("Push data to Milkcocoa : Key:LED, Value:OFF");        
+        elem.setValue("LED", "OFF");
+    }
+    
+    do {
+        push_ret = milkcocoa.push(MILKCOCOA_DATASTORE, &elem);
+        if (push_ret != 0) {
+            Serial.println("Milkcocoa.push() error.");
+            Serial.println(milkcocoa.pushErrorString(push_ret));
+            Serial.println(push_ret);
+            Serial.println("Retrying MQTT push in 5 seconds...");
+            delay(5000);
+        }        
+    }while(push_ret != 0);
+    
+    Serial.println("Push success.");
+    req_led_on = (req_led_on)? false : true;
+    delay(2000);    
+#endif /* MILKCOCOA_PUSH */
+    
+    if (Serial.available() > 0) {
+        Serial.read();
+        Serial.print("Pause  : Input any char to continue.\n\r");
+        while(!(Serial.available() > 0));
+        Serial.print("Resume.\n\r");
+        Serial.read();
+    }    
+}
+
+#ifdef MILKCOCOA_ON
+void onpush(DataElement *pelem) {
+    char *data;
+    if(!pelem->getString("LED", &data)) {
+        Serial.print("onpush : key LED is not found.");
+        return;
+    };
+    Serial.print("onpush : {LED, ");
+    Serial.write(data);
+    Serial.println("}.");
+    if (strcmp(data, "ON") == 0) {
+        Serial.println("LED : ON!");
+        digitalWrite(13, HIGH);
+    }
+    else if(strcmp(data, "OFF") == 0) {
+        Serial.println("LED : OFF!");
+        digitalWrite(13, LOW);
+    }
+}
+#endif /* MILKCOCOA_ON */
Index: rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/Milkcocoa_basic/r2ca_app.h	(revision 260)
@@ -0,0 +1,19 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 0
+
+/*
+ *  Use Serial3
+ */
+#define R2CA_USE_SERIAL3
+
+#define  R2CA_TASK2_LOOP_PRI  4 //Web
+#define  R2CA_TASK3_LOOP_PRI  3 //LED
+#define  R2CA_TASK4_LOOP_PRI  7 //TFT
+#define  R2CA_TASK5_LOOP_PRI  6 //Processing
+
+#define R2CA_ENABLE_PROFILING
+#define R2CA_PROFILING_CYC_MS  1
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/Milkcocoa_basic/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_basic/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/Milkcocoa_basic/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_basic/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/Milkcocoa_basic/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_basic/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/Milkcocoa_basic/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_basic/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-INCLUDE("rca_lib.cfg");
-
Index: rtos_arduino/trunk/examples/Milkcocoa_basic/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_basic/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-#include "rca.h"
-#include "ESP8266.h"
-#include "Milkcocoa.h"
-#include "Client_ESP8266.h"
-
-#include "../examples_gdef.h"
-
-//#define MILKCOCOA_PUSH
-#define MILKCOCOA_ON
-
-#define MILKCOCOA_SERVERPORT  1883
-
-ESP8266Client wifi_client;
-
-const char MQTT_SERVER[] PROGMEM    = MILKCOCOA_APP_ID ".mlkcca.com";
-const char MQTT_CLIENTID[] PROGMEM  = __TIME__ MILKCOCOA_APP_ID;
-
-Milkcocoa milkcocoa = Milkcocoa(&wifi_client, MQTT_SERVER, MILKCOCOA_SERVERPORT, MILKCOCOA_APP_ID, MQTT_CLIENTID);
-
-extern void onpush(DataElement *elem);
-
-void setup()
-{
-    int ret;
-    
-    Serial.begin(115200);
-    Serial.print("Milkcocoa SDK demo");
-
-    // Connect to WiFi access point.
-    Serial.println(); Serial.println();
-    Serial.print("Connecting to ");
-    Serial.println(STA_SSID);
-
-    ret = WiFi.begin(Serial5, 115200);
-
-    if(ret == 1) {
-        Serial.print("Cannot communicate with ESP8266.");
-        while(1);        
-    } else if(ret == 2) {
-        Serial.println("FW Version mismatch.");
-        Serial.print("FW Version:");
-        Serial.println(WiFi.getVersion().c_str());
-        Serial.print("Supported FW Version:");
-        Serial.println(ESP8266_SUPPORT_VERSION);
-        while(1);
-    } else {
-        Serial.print("begin ok\r\n");
-    }
-
-    Serial.print("FW Version:");
-    Serial.println(WiFi.getVersion().c_str());
-    
-    if (WiFi.setOprToStation()) {
-        Serial.print("to station ok\r\n");
-    } else {
-        Serial.print("to station err\r\n");
-    }
-    
-    if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
-        Serial.print("Join AP success\r\n");
-        Serial.print("IP: ");
-        Serial.println(WiFi.getLocalIP().c_str());    
-    } else {
-        Serial.print("Join AP failure\r\n");
-    }
-
-    if (WiFi.stopServer()) {
-        Serial.print("Stop server ok\r\n");
-    } else {
-        Serial.print("Stop server err\r\n");
-    }        
-    
-    if (WiFi.disableMUX()) {
-        Serial.print("single ok\r\n");
-    } else {
-        Serial.print("single err\r\n");
-    }
-    
-#ifdef MILKCOCOA_ON
-    if (milkcocoa.on(MILKCOCOA_DATASTORE, "push", onpush)){
-        Serial.println("milkcocoa on sucesss");   
-    }
-    else {
-        Serial.println("milkcocoa on failure");   
-    }
-
-    pinMode(13, OUTPUT);
-    digitalWrite(13, LOW);   
-#endif /* MILKCOCOA_ON  */
-
-    Serial.println("setup end\r\n");
-}
-
-#ifdef MILKCOCOA_PUSH
-bool req_led_on = false;
-#endif /* MILKCOCOA_PUSH */
-
-void loop() {
-    int8_t ret;
-    int8_t push_ret;
-    
-#ifdef MILKCOCOA_ON
-    while((ret = milkcocoa.loop(1)) != 0) {
-        Serial.println("Milkcocoa.loop() connection error.");
-        Serial.println(milkcocoa.connectErrorString(ret));
-        Serial.println(ret);
-        Serial.println("Retrying MQTT connection in 5 seconds...");
-        delay(5000);
-    }
-    Serial.print(".");
-#endif /* MILKCOCOA_ON */
-    
-#ifdef MILKCOCOA_PUSH
-    DataElement elem = DataElement();
-    
-    if(req_led_on) {
-        Serial.println("Push data to Milkcocoa : Key:LED, Value:ON");
-        elem.setValue("LED", "ON");
-    }else {
-        Serial.println("Push data to Milkcocoa : Key:LED, Value:OFF");        
-        elem.setValue("LED", "OFF");
-    }
-    
-    do {
-        push_ret = milkcocoa.push(MILKCOCOA_DATASTORE, &elem);
-        if (push_ret != 0) {
-            Serial.println("Milkcocoa.push() error.");
-            Serial.println(milkcocoa.pushErrorString(push_ret));
-            Serial.println(push_ret);
-            Serial.println("Retrying MQTT push in 5 seconds...");
-            delay(5000);
-        }        
-    }while(push_ret != 0);
-    
-    Serial.println("Push success.");
-    req_led_on = (req_led_on)? false : true;
-    delay(2000);    
-#endif /* MILKCOCOA_PUSH */
-    
-    if (Serial.available() > 0) {
-        Serial.read();
-        Serial.print("Pause  : Input any char to continue.\n\r");
-        while(!(Serial.available() > 0));
-        Serial.print("Resume.\n\r");
-        Serial.read();
-    }    
-}
-
-#ifdef MILKCOCOA_ON
-void onpush(DataElement *pelem) {
-    char *data;
-    if(!pelem->getString("LED", &data)) {
-        Serial.print("onpush : key LED is not found.");
-        return;
-    };
-    Serial.print("onpush : {LED, ");
-    Serial.write(data);
-    Serial.println("}.");
-    if (strcmp(data, "ON") == 0) {
-        Serial.println("LED : ON!");
-        digitalWrite(13, HIGH);
-    }
-    else if(strcmp(data, "OFF") == 0) {
-        Serial.println("LED : OFF!");
-        digitalWrite(13, LOW);
-    }
-}
-#endif /* MILKCOCOA_ON */
Index: rtos_arduino/trunk/examples/Milkcocoa_basic/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/Milkcocoa_basic/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,19 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 0
-
-/*
- *  Use Serial3
- */
-#define RCA_USE_SERIAL3
-
-#define  RCA_TASK2_LOOP_PRI  4 //Web
-#define  RCA_TASK3_LOOP_PRI  3 //LED
-#define  RCA_TASK4_LOOP_PRI  7 //TFT
-#define  RCA_TASK5_LOOP_PRI  6 //Processing
-
-#define RCA_ENABLE_PROFILING
-#define RCA_PROFILING_CYC_MS  1
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/MultiTask/Makefile
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/MultiTask/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -25,7 +25,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -41,3 +41,3 @@
 APPL_DIR = 
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/MultiTask/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTask/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/MultiTask/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTask/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/MultiTask/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTask/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/MultiTask/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTask/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,8 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("r2ca_lib.cfg");
Index: rtos_arduino/trunk/examples/MultiTask/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTask/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,67 @@
+#include "r2ca.h"
+
+/*
+ *  For MAINTASK
+ */ 
+void setup() {
+    Serial.begin(115200);
+    Serial.println("setup() : running ");
+
+    pinMode(13, OUTPUT);
+}
+
+int loop_cnt = 0;
+
+void loop() {
+    Serial.print("loop() : running ");
+    Serial.print(loop_cnt++);
+    Serial.println(" .");
+    delay(1000);
+}
+
+/*
+ *  For TASK1
+ */
+void loop1() {
+    digitalWrite(13, HIGH);
+    delay(1000);           
+    digitalWrite(13, LOW); 
+    delay(1000);           
+}
+
+int task2_loop_cnt = 0;
+
+/*
+ *  For TASK2
+ */
+void loop2() {
+    Serial.print("task2_loop() : running ");
+    Serial.print(task2_loop_cnt++);
+    Serial.println(" .");
+    delay(2000);
+}
+
+int task3_loop_cnt = 0;
+
+/*
+ *  For TASK3
+ */
+void loop3() {
+    Serial.print("task3_loop() : running ");
+    Serial.print(task3_loop_cnt++);
+    Serial.println(" .");
+    delay(2000);
+}
+
+int task4_loop_cnt = 0;
+
+/*
+ *  For TASK4
+ */
+void loop4() {
+    Serial.print("task4_loop() : running ");
+    Serial.print(task4_loop_cnt++);
+    Serial.println(" .");    
+    delay(2000);
+}
+
Index: rtos_arduino/trunk/examples/MultiTask/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTask/r2ca_app.h	(revision 260)
@@ -0,0 +1,6 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 4
+
+#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/MultiTask/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/MultiTask/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/MultiTask/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/MultiTask/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,8 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-/*
- *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
- */
-INCLUDE("rca_lib.cfg");
Index: rtos_arduino/trunk/examples/MultiTask/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,92 +1,0 @@
-#include "rca.h"
-
-/*
- *  For MAINTASK
- */ 
-void setup() {
-    Serial.begin(115200);
-    Serial.println("setup() : running");
-    delay(1);        
-}
-
-int loop_cnt = 0;
-
-void loop() {
-    Serial.print("loop() : running");
-    Serial.print(loop_cnt++);
-    Serial.println(" .");
-    delay(1000);
-}
-
-/*
- *  For TASK1
- */
-void task1_setup() {
-    pinMode(13, OUTPUT);
-    Serial.println("task1_setup() : running");    
-}
-
-void task1_loop() {
-    digitalWrite(13, HIGH);
-    delay(1000);           
-    digitalWrite(13, LOW); 
-    delay(1000);           
-}
-
-
-int task2_loop_cnt = 0;
-
-/*
- *  For TASK2
- */
-void task2_setup() {
-    Serial.println("task2_setup() : running");    
-    SerialUSB.begin(115200);
-    while(!SerialUSB){ ; }
-    SerialUSB.println("task2_setup() : running");
-}
-
-void task2_loop() {
-    Serial.print("task2_loop() : running");
-    Serial.print(task2_loop_cnt);
-    Serial.println(" .");
-    SerialUSB.print("task2_loop() : running");
-    SerialUSB.print(task2_loop_cnt++);
-    SerialUSB.println(" .");    
-    delay(2000);
-}
-
-int task3_loop_cnt = 0;
-
-/*
- *  For TASK3
- */
-void task3_setup() {
-    Serial.println("task3_setup() : running");
-    delay(1);
-}
-
-void task3_loop() {
-    Serial.print("task3_loop() : running");
-    Serial.print(task3_loop_cnt++);
-    Serial.println(" .");
-    delay(2000);
-}
-
-int task4_loop_cnt = 0;
-
-/*
- *  For TASK4
- */
-void task4_setup() {
-    Serial.println("task4_setup() : running");
-    delay(1);
-}
-
-void task4_loop() {
-    Serial.print("task4_loop() : running");
-    Serial.print(task4_loop_cnt++);
-    Serial.println(" .");    
-    delay(2000);
-}
-
Index: rtos_arduino/trunk/examples/MultiTask/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,8 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 4
-
-#define RCA_TASK2_SETUP_PRI  6
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/MultiTaskText/Exclusion/Makefile
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Exclusion/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/MultiTaskText/Exclusion/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -37,7 +37,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../../../
+R2CA_DIR = ../../../
 
 #
@@ -66,3 +66,3 @@
 APPL_COBJS   += 
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,10 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("r2ca_lib.cfg");
+
+CRE_SEM(COUNT_SEM, { TA_TPRI, 1, 1 });
Index: rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,81 @@
+#include "r2ca.h"
+
+#include <Wire.h>
+#include <Digital_Light_TSL2561.h>
+#include <SeeedOLED.h>
+
+#define TOUCH_PIN 3
+#define LED_PIN  4
+
+int PreTouchValue = 0;
+int TouchState = 0;
+int LEDState = 0;
+
+extern void CheckTouch(void);
+    
+void setup() {
+  Wire.begin();
+  TSL2561.init();
+  SeeedOled.init();
+  SeeedOled.deactivateScroll();
+  SeeedOled.setNormalDisplay();
+  SeeedOled.clearDisplay();
+  
+  pinMode(TOUCH_PIN, INPUT_PULLUP);
+  pinMode(LED_PIN, OUTPUT);
+  digitalWrite(LED_PIN, LOW);    
+  attachInterrupt(TOUCH_PIN, CheckTouch, CHANGE);
+}
+
+int OLEDCount = 0;
+
+void CheckTouch(){
+   int TouchValue = digitalRead(TOUCH_PIN);
+
+  if ((PreTouchValue == 0) && (TouchValue == 1) && (TouchState == 0)) {
+    TouchState = 1;
+  }
+
+  if ((PreTouchValue == 1) && (TouchValue == 0) && (TouchState == 1)) {
+      TouchState = 0;
+      iwup_tsk(R2CA_TASK1);
+  }
+  PreTouchValue = TouchValue; 
+}
+
+void loop() {
+  int lux;
+  int lcount;
+
+//  wai_sem(COUNT_SEM);
+  lcount = OLEDCount;        
+  lux = TSL2561.readVisibleLux();
+    
+  SeeedOled.setTextXY(0, 0);
+  SeeedOled.putString("Digital Light");
+  SeeedOled.setTextXY(1, 0);
+  SeeedOled.putString("Sensor Value is");
+  SeeedOled.setTextXY(2, 0);
+  SeeedOled.putNumber(lux);
+  SeeedOled.putString(" lux      ");
+  SeeedOled.setTextXY(4, 0);
+  SeeedOled.putString("Count is");
+  SeeedOled.setTextXY(5, 0);
+  SeeedOled.putNumber(lcount++);
+  SeeedOled.putString("         "); 
+  OLEDCount = lcount;
+//  sig_sem(COUNT_SEM);
+}
+
+
+void loop1() {
+    slp_tsk();
+    
+//    wai_sem(COUNT_SEM);
+    OLEDCount = 0;
+//    sig_sem(COUNT_SEM);
+    
+    digitalWrite(LED_PIN, HIGH);
+    dly_tsk(2000);
+    digitalWrite(LED_PIN, LOW);
+}
Index: rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/Exclusion/r2ca_app.h	(revision 260)
@@ -0,0 +1,6 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 1
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/MultiTaskText/Exclusion/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Exclusion/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/MultiTaskText/Exclusion/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Exclusion/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/MultiTaskText/Exclusion/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Exclusion/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/MultiTaskText/Exclusion/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Exclusion/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,10 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-/*
- *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
- */
-INCLUDE("rca_lib.cfg");
-
-CRE_SEM(COUNT_SEM, { TA_TPRI, 1, 1 });
Index: rtos_arduino/trunk/examples/MultiTaskText/Exclusion/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Exclusion/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,84 +1,0 @@
-#include "rca.h"
-
-#include <Wire.h>
-#include <Digital_Light_TSL2561.h>
-#include <SeeedOLED.h>
-
-#define TOUCH_PIN 3
-#define LED_PIN  4
-
-int PreTouchValue = 0;
-int TouchState = 0;
-int LEDState = 0;
-
-extern void CheckTouch(void);
-    
-void setup() {
-  Wire.begin();
-  TSL2561.init();
-  SeeedOled.init();
-  SeeedOled.deactivateScroll();
-  SeeedOled.setNormalDisplay();
-  SeeedOled.clearDisplay();
-  
-  pinMode(TOUCH_PIN, INPUT_PULLUP);
-  pinMode(LED_PIN, OUTPUT);
-  digitalWrite(LED_PIN, LOW);    
-  attachInterrupt(TOUCH_PIN, CheckTouch, CHANGE);
-}
-
-int OLEDCount = 0;
-
-void CheckTouch(){
-   int TouchValue = digitalRead(TOUCH_PIN);
-
-  if ((PreTouchValue == 0) && (TouchValue == 1) && (TouchState == 0)) {
-    TouchState = 1;
-  }
-
-  if ((PreTouchValue == 1) && (TouchValue == 0) && (TouchState == 1)) {
-      TouchState = 0;
-      iwup_tsk(RCA_TASK1);
-  }
-  PreTouchValue = TouchValue; 
-}
-
-void loop() {
-  int lux;
-  int lcount;
-
-//  wai_sem(COUNT_SEM);
-  lcount = OLEDCount;        
-  lux = TSL2561.readVisibleLux();
-    
-  SeeedOled.setTextXY(0, 0);
-  SeeedOled.putString("Digital Light");
-  SeeedOled.setTextXY(1, 0);
-  SeeedOled.putString("Sensor Value is");
-  SeeedOled.setTextXY(2, 0);
-  SeeedOled.putNumber(lux);
-  SeeedOled.putString(" lux      ");
-  SeeedOled.setTextXY(4, 0);
-  SeeedOled.putString("Count is");
-  SeeedOled.setTextXY(5, 0);
-  SeeedOled.putNumber(lcount++);
-  SeeedOled.putString("         "); 
-  OLEDCount = lcount;
-//  sig_sem(COUNT_SEM);
-}
-
-void task1_setup() {
-    
-}
-
-void task1_loop() {
-    slp_tsk();
-    
-//    wai_sem(COUNT_SEM);
-    OLEDCount = 0;
-//    sig_sem(COUNT_SEM);
-    
-    digitalWrite(LED_PIN, HIGH);
-    dly_tsk(2000);
-    digitalWrite(LED_PIN, LOW);
-}
Index: rtos_arduino/trunk/examples/MultiTaskText/Exclusion/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Exclusion/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 1
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/MultiTaskText/Interrupt/Makefile
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Interrupt/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/MultiTaskText/Interrupt/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -37,7 +37,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../../../
+R2CA_DIR = ../../../
 
 #
@@ -66,3 +66,3 @@
 APPL_COBJS   += 
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,8 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("r2ca_lib.cfg");
Index: rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,71 @@
+#include "r2ca.h"
+
+#include <Wire.h>
+#include <Digital_Light_TSL2561.h>
+#include <SeeedOLED.h>
+
+#define TOUCH_PIN 3
+#define LED_PIN  4
+
+int PreTouchValue = 0;
+int TouchState = 0;
+int LEDState = 0;
+
+extern void CheckTouch(void);
+    
+void setup() {
+  Wire.begin();
+  TSL2561.init();
+  SeeedOled.init();
+  SeeedOled.deactivateScroll();
+  SeeedOled.setNormalDisplay();
+  SeeedOled.clearDisplay();
+  
+  pinMode(TOUCH_PIN, INPUT_PULLUP);
+  pinMode(LED_PIN, OUTPUT);
+  digitalWrite(LED_PIN, LOW);    
+  attachInterrupt(TOUCH_PIN, CheckTouch, CHANGE);
+}
+
+int OLEDCount = 0;
+
+void CheckTouch(){
+   int TouchValue = digitalRead(TOUCH_PIN);
+
+  if ((PreTouchValue == 0) && (TouchValue == 1) && (TouchState == 0)) {
+    TouchState = 1;
+  }
+
+  if ((PreTouchValue == 1) && (TouchValue == 0) && (TouchState == 1)) {
+      TouchState = 0;
+      iwup_tsk(R2CA_TASK1);
+  }
+  PreTouchValue = TouchValue; 
+}
+
+void loop() {
+  int lux;
+
+  lux = TSL2561.readVisibleLux();
+  
+  SeeedOled.setTextXY(0, 0);
+  SeeedOled.putString("Digital Light");
+  SeeedOled.setTextXY(1, 0);
+  SeeedOled.putString("Sensor Value is");
+  SeeedOled.setTextXY(2, 0);
+  SeeedOled.putNumber(lux);
+  SeeedOled.putString(" lux      ");
+  SeeedOled.setTextXY(4, 0);
+  SeeedOled.putString("Count is");
+  SeeedOled.setTextXY(5, 0);
+  SeeedOled.putNumber(OLEDCount++);
+  SeeedOled.putString("         ");    
+}
+
+void loop1() {
+    slp_tsk();
+
+    digitalWrite(LED_PIN, HIGH);
+    dly_tsk(2000);
+    digitalWrite(LED_PIN, LOW);
+}
Index: rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/Interrupt/r2ca_app.h	(revision 260)
@@ -0,0 +1,6 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 1
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/MultiTaskText/Interrupt/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Interrupt/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/MultiTaskText/Interrupt/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Interrupt/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/MultiTaskText/Interrupt/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Interrupt/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/MultiTaskText/Interrupt/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Interrupt/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,8 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-/*
- *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
- */
-INCLUDE("rca_lib.cfg");
Index: rtos_arduino/trunk/examples/MultiTaskText/Interrupt/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Interrupt/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,75 +1,0 @@
-#include "rca.h"
-
-#include <Wire.h>
-#include <Digital_Light_TSL2561.h>
-#include <SeeedOLED.h>
-
-#define TOUCH_PIN 3
-#define LED_PIN  4
-
-int PreTouchValue = 0;
-int TouchState = 0;
-int LEDState = 0;
-
-extern void CheckTouch(void);
-    
-void setup() {
-  Wire.begin();
-  TSL2561.init();
-  SeeedOled.init();
-  SeeedOled.deactivateScroll();
-  SeeedOled.setNormalDisplay();
-  SeeedOled.clearDisplay();
-  
-  pinMode(TOUCH_PIN, INPUT_PULLUP);
-  pinMode(LED_PIN, OUTPUT);
-  digitalWrite(LED_PIN, LOW);    
-  attachInterrupt(TOUCH_PIN, CheckTouch, CHANGE);
-}
-
-int OLEDCount = 0;
-
-void CheckTouch(){
-   int TouchValue = digitalRead(TOUCH_PIN);
-
-  if ((PreTouchValue == 0) && (TouchValue == 1) && (TouchState == 0)) {
-    TouchState = 1;
-  }
-
-  if ((PreTouchValue == 1) && (TouchValue == 0) && (TouchState == 1)) {
-      TouchState = 0;
-      iwup_tsk(RCA_TASK1);
-  }
-  PreTouchValue = TouchValue; 
-}
-
-void loop() {
-  int lux;
-
-  lux = TSL2561.readVisibleLux();
-  
-  SeeedOled.setTextXY(0, 0);
-  SeeedOled.putString("Digital Light");
-  SeeedOled.setTextXY(1, 0);
-  SeeedOled.putString("Sensor Value is");
-  SeeedOled.setTextXY(2, 0);
-  SeeedOled.putNumber(lux);
-  SeeedOled.putString(" lux      ");
-  SeeedOled.setTextXY(4, 0);
-  SeeedOled.putString("Count is");
-  SeeedOled.setTextXY(5, 0);
-  SeeedOled.putNumber(OLEDCount++);
-  SeeedOled.putString("         ");    
-}
-
-void task1_setup() {
-    
-}
-
-void task1_loop() {
-    slp_tsk();
-
-    digitalWrite(LED_PIN, HIGH);
-    dly_tsk(2000);
-    digitalWrite(LED_PIN, LOW);
-}
Index: rtos_arduino/trunk/examples/MultiTaskText/Interrupt/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/Interrupt/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 1
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/Makefile
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -37,7 +37,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../../../
+R2CA_DIR = ../../../
 
 #
@@ -66,3 +66,3 @@
 APPL_COBJS   += 
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,8 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("r2ca_lib.cfg");
Index: rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,33 @@
+#include "r2ca.h"
+
+#include <ChainableLED.h>
+
+#define LED_PIN 4
+
+#define NUM_LEDS 1
+ChainableLED leds(8, 9, NUM_LEDS);
+
+void setup() {
+  pinMode(LED_PIN, OUTPUT);
+
+  leds.init();
+}
+
+void loop() {
+  digitalWrite(LED_PIN, HIGH);
+  delay(1000);           
+  digitalWrite(LED_PIN, LOW); 
+  delay(1000);           
+}
+
+void loop1() {
+  int i;
+  leds.setColorRGB(0, 250, 0, 0);
+  delay(250);
+    
+  leds.setColorRGB(0, 0, 250, 0);
+  delay(250);
+
+  leds.setColorRGB(0, 0, 0, 250);
+  delay(250);
+}
Index: rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/r2ca_app.h	(revision 260)
@@ -0,0 +1,6 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 1
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,8 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-/*
- *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
- */
-INCLUDE("rca_lib.cfg");
Index: rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,35 +1,0 @@
-#include "rca.h"
-
-#include <ChainableLED.h>
-
-#define LED_PIN 4
-
-void setup() {
-  pinMode(LED_PIN, OUTPUT);
-}
-
-void loop() {
-  digitalWrite(LED_PIN, HIGH);
-  delay(1000);           
-  digitalWrite(LED_PIN, LOW); 
-  delay(1000);           
-}
-
-#define NUM_LEDS 1
-ChainableLED leds(8, 9, NUM_LEDS);
-
-void task1_setup() {
-  leds.init();
-}
-
-void task1_loop() {
-  int i;
-  leds.setColorRGB(0, 250, 0, 0);
-  delay(250);
-    
-  leds.setColorRGB(0, 0, 250, 0);
-  delay(250);
-
-  leds.setColorRGB(0, 0, 0, 250);
-  delay(250);
-}
Index: rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/LEDBlink_CLEDBlink/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 1
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/MultiTaskText/SingleTask/Makefile
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/SingleTask/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/MultiTaskText/SingleTask/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -37,7 +37,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../../..
+R2CA_DIR = ../../..
 
 #
@@ -66,3 +66,3 @@
 APPL_COBJS   += 
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,8 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("r2ca_lib.cfg");
Index: rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,120 @@
+#include "r2ca.h"
+
+//#define LED_BLINK
+//#define CLED_BLINK
+//#define TOUCH_SENSE
+#define LUX_SENSE
+
+#include <Wire.h>
+#include <Digital_Light_TSL2561.h>
+#include <SeeedOLED.h>
+#include <ChainableLED.h>
+
+#define LED_PIN 4
+#define TOUCH_PIN 3
+
+#ifdef LED_BLINK
+
+void setup() {
+  pinMode(LED_PIN, OUTPUT);
+}
+
+void loop() {
+  digitalWrite(LED_PIN, HIGH);
+  delay(1000);           
+  digitalWrite(LED_PIN, LOW); 
+  delay(1000);           
+}
+
+#endif /* LED_BLINK */
+
+#ifdef CLED_BLINK
+
+#define NUM_LEDS 1
+ChainableLED leds(8, 9, NUM_LEDS);
+
+void setup() {
+  leds.init();
+}
+
+void loop() {
+  int i;
+  for(i = 0; i < 25; i++){
+    leds.setColorRGB(0, i*10, 0, 0);
+    delay(10);
+  }
+  for(i = 0; i < 25; i++){
+    leds.setColorRGB(0, 0, i*10, 0);
+    delay(10);
+  }
+  for(i = 0; i < 25; i++){
+    leds.setColorRGB(0, 0, 0, i*10);
+    delay(10);
+  }
+}
+#endif /* CLED_BLINK */
+
+#ifdef TOUCH_SENSE
+
+int PreTouchValue = 0;
+int TouchState = 0;
+int LEDState = 0;
+
+void setup() {
+  pinMode(TOUCH_PIN, INPUT_PULLUP);
+  pinMode(LED_PIN, OUTPUT);
+  digitalWrite(LED_PIN, LOW);
+}
+
+void loop() {
+  int TouchValue = digitalRead(TOUCH_PIN);
+
+  if ((PreTouchValue == 0) && (TouchValue == 1) && (TouchState == 0)) {
+    TouchState = 1;
+  }
+
+  if ((PreTouchValue == 1) && (TouchValue == 0) && (TouchState == 1)) {
+    TouchState = 0;
+    if (LEDState == 0) {
+      LEDState = 1;
+      digitalWrite(LED_PIN, HIGH);
+    }
+    else {
+      LEDState = 0;
+      digitalWrite(LED_PIN, LOW);
+    }
+  }
+  PreTouchValue = TouchValue;
+}
+
+#endif /* TOUCH_SENSE */
+
+
+#ifdef LUX_SENSE
+void setup() {
+  Wire.begin();
+  TSL2561.init();
+  SeeedOled.init();
+  SeeedOled.deactivateScroll();
+  SeeedOled.setNormalDisplay();
+  SeeedOled.clearDisplay();
+}
+
+int OLEDCount = 0;
+
+void loop() {
+  int lux = TSL2561.readVisibleLux();
+
+  SeeedOled.setTextXY(0, 0);
+  SeeedOled.putString("Digital Light");
+  SeeedOled.setTextXY(1, 0);
+  SeeedOled.putString("Sensor Value is");
+  SeeedOled.setTextXY(2, 0);
+  SeeedOled.putNumber(lux);
+  SeeedOled.putString(" lux      ");
+  SeeedOled.setTextXY(4, 0);
+  SeeedOled.putString("Count is");
+  SeeedOled.setTextXY(5, 0);
+  SeeedOled.putNumber(OLEDCount++);
+}
+#endif /* LUX_SENSE */
Index: rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/MultiTaskText/SingleTask/r2ca_app.h	(revision 260)
@@ -0,0 +1,6 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 0
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/MultiTaskText/SingleTask/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/SingleTask/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/MultiTaskText/SingleTask/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/SingleTask/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/MultiTaskText/SingleTask/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/SingleTask/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/MultiTaskText/SingleTask/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/SingleTask/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,8 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-/*
- *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
- */
-INCLUDE("rca_lib.cfg");
Index: rtos_arduino/trunk/examples/MultiTaskText/SingleTask/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/SingleTask/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,120 +1,0 @@
-#include "rca.h"
-
-#define LED_BLINK
-//#define CLED_BLINK
-//#define TOUCH_SENSE
-//#define LUX_SENSE
-
-#include <Wire.h>
-#include <Digital_Light_TSL2561.h>
-#include <SeeedOLED.h>
-#include <ChainableLED.h>
-
-#define LED_PIN 4
-#define TOUCH_PIN 3
-
-#ifdef LED_BLINK
-
-void setup() {
-  pinMode(LED_PIN, OUTPUT);
-}
-
-void loop() {
-  digitalWrite(LED_PIN, HIGH);
-  delay(1000);           
-  digitalWrite(LED_PIN, LOW); 
-  delay(1000);           
-}
-
-#endif /* LED_BLINK */
-
-#ifdef CLED_BLINK
-
-#define NUM_LEDS 1
-ChainableLED leds(8, 9, NUM_LEDS);
-
-void setup() {
-  leds.init();
-}
-
-void loop() {
-  int i;
-  for(i = 0; i < 25; i++){
-    leds.setColorRGB(0, i*10, 0, 0);
-    delay(10);
-  }
-  for(i = 0; i < 25; i++){
-    leds.setColorRGB(0, 0, i*10, 0);
-    delay(10);
-  }
-  for(i = 0; i < 25; i++){
-    leds.setColorRGB(0, 0, 0, i*10);
-    delay(10);
-  }
-}
-#endif /* CLED_BLINK */
-
-#ifdef TOUCH_SENSE
-
-int PreTouchValue = 0;
-int TouchState = 0;
-int LEDState = 0;
-
-void setup() {
-  pinMode(TOUCH_PIN, INPUT_PULLUP);
-  pinMode(LED_PIN, OUTPUT);
-  digitalWrite(LED_PIN, LOW);
-}
-
-void loop() {
-  int TouchValue = digitalRead(TOUCH_PIN);
-
-  if ((PreTouchValue == 0) && (TouchValue == 1) && (TouchState == 0)) {
-    TouchState = 1;
-  }
-
-  if ((PreTouchValue == 1) && (TouchValue == 0) && (TouchState == 1)) {
-    TouchState = 0;
-    if (LEDState == 0) {
-      LEDState = 1;
-      digitalWrite(LED_PIN, HIGH);
-    }
-    else {
-      LEDState = 0;
-      digitalWrite(LED_PIN, LOW);
-    }
-  }
-  PreTouchValue = TouchValue;
-}
-
-#endif /* TOUCH_SENSE */
-
-
-#ifdef LUX_SENSE
-void setup() {
-  Wire.begin();
-  TSL2561.init();
-  SeeedOled.init();
-  SeeedOled.deactivateScroll();
-  SeeedOled.setNormalDisplay();
-  SeeedOled.clearDisplay();
-}
-
-int OLEDCount = 0;
-
-void loop() {
-  int lux = TSL2561.readVisibleLux();
-
-  SeeedOled.setTextXY(0, 0);
-  SeeedOled.putString("Digital Light");
-  SeeedOled.setTextXY(1, 0);
-  SeeedOled.putString("Sensor Value is");
-  SeeedOled.setTextXY(2, 0);
-  SeeedOled.putNumber(lux);
-  SeeedOled.putString(" lux      ");
-  SeeedOled.setTextXY(4, 0);
-  SeeedOled.putString("Count is");
-  SeeedOled.setTextXY(5, 0);
-  SeeedOled.putNumber(OLEDCount++);
-}
-#endif /* LUX_SENSE */
Index: rtos_arduino/trunk/examples/MultiTaskText/SingleTask/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/MultiTaskText/SingleTask/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 0
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/NAxesMotion/Makefile
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/NAxesMotion/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -36,7 +36,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -52,3 +52,3 @@
 APPL_DIR = 
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/NAxesMotion/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/NAxesMotion/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/NAxesMotion/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/NAxesMotion/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/NAxesMotion/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/NAxesMotion/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/NAxesMotion/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/NAxesMotion/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,8 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("r2ca_lib.cfg");
Index: rtos_arduino/trunk/examples/NAxesMotion/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/NAxesMotion/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,234 @@
+#include "r2ca.h"
+
+/****************************************************************************
+* Copyright (C) 2011 - 2014 Bosch Sensortec GmbH
+*
+* Accelerometer.ino
+* Date: 2014/09/09
+* Revision: 3.0 $
+*
+* Usage:        Example code to stream Accelerometer data
+*
+****************************************************************************
+/***************************************************************************
+* License:
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+*   Redistributions of source code must retain the above copyright
+*   notice, this list of conditions and the following disclaimer.
+*
+*   Redistributions in binary form must reproduce the above copyright
+*   notice, this list of conditions and the following disclaimer in the
+*   documentation and/or other materials provided with the distribution.
+*
+*   Neither the name of the copyright holder nor the names of the
+*   contributors may be used to endorse or promote products derived from
+*   this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+*
+* The information provided is believed to be accurate and reliable.
+* The copyright holder assumes no responsibility for the consequences of use
+* of such information nor for any infringement of patents or
+* other rights of third parties which may result from its use.
+* No license is granted by implication or otherwise under any patent or
+* patent rights of the copyright holder.
+*/
+
+#include "NAxisMotion.h"        //Contains the bridge code between the API and the Arduino Environment
+#include <Wire.h>
+
+NAxisMotion mySensor;                 //Object that for the sensor
+unsigned long lastStreamTime = 0;     //To store the last streamed time stamp
+const int streamPeriod = 20;          //To stream at 25Hz without using additional timers (time period(ms) =1000/frequency(Hz))
+   
+//bool updateSensorData = true;         //Flag to update the sensor data. Default is true to perform the first read before the first stream
+
+void setup() //This code is executed once
+{
+  //Peripheral Initialization
+  Serial.begin(115200);           //Initialize the Serial Port to view information on the Serial Monitor
+  I2C.begin();                    //Initialize I2C communication to the let the library communicate with the sensor. 
+  //Sensor Initialization
+  mySensor.initSensor(0x29);       //The I2C Address can be changed here inside this function in the library
+  mySensor.setOperationMode(OPERATION_MODE_NDOF);   //Can be configured to other operation modes as desired
+  mySensor.setUpdateMode(MANUAL);	//The default is AUTO. Changing to manual requires calling the relevant update functions prior to calling the read functions
+
+  Serial5.begin(115200);
+  Serial.print("Start!");
+}
+
+float g_eula_h;
+float g_eula_r;
+float g_eula_p;
+
+void loop() //This code is looped forever
+{
+      if ((millis() - lastStreamTime) >= streamPeriod)
+  {
+    lastStreamTime = millis();    
+    mySensor.updateEuler();        //Update the Euler data into the structure of the object
+    mySensor.updateCalibStatus();  //Update the Calibration Status
+
+    g_eula_h = mySensor.readEulerHeading();
+    g_eula_r = mySensor.readEulerRoll();
+    g_eula_p = mySensor.readEulerPitch();
+#ifdef PRINT_SENSOR      
+    Serial.print("Time: ");
+    Serial.print(lastStreamTime);
+    Serial.print("ms ");
+
+    Serial.print(" H: ");
+    Serial.print(g_eula_h); //Heading(h) 0 to 360 data
+    Serial.print("deg ");
+
+    Serial.print(" R: ");
+    Serial.print(g_eula_r); //Roll(y) 180 to -180 data
+    Serial.print("deg");
+
+    Serial.print(" P: ");
+    Serial.print(g_eula_p); //Pitch(x) 180 to -180 data
+    Serial.print("deg ");
+    
+    Serial.print(" A: ");
+    Serial.print(mySensor.readAccelCalibStatus());  //Accelerometer Calibration Status (0 - 3)
+	
+    Serial.print(" M: ");
+    Serial.print(mySensor.readMagCalibStatus());    //Magnetometer Calibration Status (0 - 3)
+	
+    Serial.print(" G: ");
+    Serial.print(mySensor.readGyroCalibStatus());   //Gyroscope Calibration Status (0 - 3)
+	
+    Serial.print(" S: ");
+    Serial.print(mySensor.readSystemCalibStatus());   //System Calibration Status (0 - 3)
+
+    Serial.println();
+#endif       
+  }
+    
+#if 0    
+  if (updateSensorData)  //Keep the updating of data as a separate task
+  {
+    mySensor.updateAccel();        //Update the Accelerometer data
+    mySensor.updateLinearAccel();  //Update the Linear Acceleration data
+    mySensor.updateGravAccel();    //Update the Gravity Acceleration data
+    mySensor.updateCalibStatus();  //Update the Calibration Status
+    updateSensorData = false;
+  }
+
+  if ((millis() - lastStreamTime) >= streamPeriod)
+  {
+    lastStreamTime = millis();
+    Serial.print("Time: ");
+    Serial.print(lastStreamTime);
+    Serial.print("ms ");
+
+    Serial.print("      aX: ");
+    Serial.print(mySensor.readAccelX()); //Accelerometer X-Axis data
+    Serial.print("m/s2 ");
+
+    Serial.print(" aY: ");
+    Serial.print(mySensor.readAccelY());  //Accelerometer Y-Axis data
+    Serial.print("m/s2 ");
+
+    Serial.print(" aZ: ");
+    Serial.print(mySensor.readAccelZ());  //Accelerometer Z-Axis data
+    Serial.print("m/s2 ");
+
+    Serial.print("      lX: ");
+    Serial.print(mySensor.readLinearAccelX()); //Linear Acceleration X-Axis data
+    Serial.print("m/s2 ");
+
+    Serial.print(" lY: ");
+    Serial.print(mySensor.readLinearAccelY());  //Linear Acceleration Y-Axis data
+    Serial.print("m/s2 ");
+
+    Serial.print(" lZ: ");
+    Serial.print(mySensor.readLinearAccelZ());  //Linear Acceleration Z-Axis data
+    Serial.print("m/s2 ");
+
+    Serial.print("      gX: ");
+    Serial.print(mySensor.readGravAccelX()); //Gravity Acceleration X-Axis data
+    Serial.print("m/s2 ");
+
+    Serial.print(" gY: ");
+    Serial.print(mySensor.readGravAccelY());  //Gravity Acceleration Y-Axis data
+    Serial.print("m/s2 ");
+
+    Serial.print(" gZ: ");
+    Serial.print(mySensor.readGravAccelZ());  //Gravity Acceleration Z-Axis data
+    Serial.print("m/s2 ");
+
+    Serial.print("      C: ");
+    Serial.print(mySensor.readAccelCalibStatus());  //Accelerometer Calibration Status (0 - 3)
+
+    Serial.println();
+    updateSensorData = true;
+  }
+#endif
+    
+  delay(1);
+}
+
+bool processing_connected = false;
+
+void establishContact() {
+    while (!Serial5.available()) {
+        Serial5.print('A'); // send a capital A
+        delay(300);
+    }
+    Serial.println("Processing Task : Connect!");
+    processing_connected = true;
+}
+
+int inByte = 0;
+int last_connect = 0;
+
+#define TIMEOUT_MS  3000
+
+void loop1()
+{
+    if(!processing_connected){
+        establishContact();        
+    }else{
+        if((millis() - last_connect) > TIMEOUT_MS){
+            processing_connected = false;
+            Serial.println("Processing Task : Disconnect!");
+        }              
+    }
+    
+    int16_t roll = (int16_t)g_eula_r;
+    int16_t pitch = (int16_t)g_eula_p;
+    int16_t heading;
+
+    if(g_eula_h <= 180){
+        heading = (int16_t)g_eula_h;
+    }
+    else{
+        heading = (int16_t)(g_eula_h - 360);
+    }
+
+    if (Serial5.available()){
+        inByte = Serial5.read();
+        last_connect = millis();
+        
+        Serial5.write((uint8_t)(heading >> 8));
+        Serial5.write((uint8_t)heading);
+        Serial5.write((uint8_t)(roll >> 8));                
+        Serial5.write((uint8_t)roll);        
+        Serial5.write((uint8_t)(pitch >> 8));
+        Serial5.write((uint8_t)pitch);
+    }
+    delay(1);
+}
Index: rtos_arduino/trunk/examples/NAxesMotion/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/NAxesMotion/r2ca_app.h	(revision 260)
@@ -0,0 +1,6 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 1
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/NAxesMotion/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/NAxesMotion/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/NAxesMotion/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/NAxesMotion/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,8 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-/*
- *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
- */
-INCLUDE("rca_lib.cfg");
Index: rtos_arduino/trunk/examples/NAxesMotion/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,237 +1,0 @@
-#include "rca.h"
-
-/****************************************************************************
-* Copyright (C) 2011 - 2014 Bosch Sensortec GmbH
-*
-* Accelerometer.ino
-* Date: 2014/09/09
-* Revision: 3.0 $
-*
-* Usage:        Example code to stream Accelerometer data
-*
-****************************************************************************
-/***************************************************************************
-* License:
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-*   Redistributions of source code must retain the above copyright
-*   notice, this list of conditions and the following disclaimer.
-*
-*   Redistributions in binary form must reproduce the above copyright
-*   notice, this list of conditions and the following disclaimer in the
-*   documentation and/or other materials provided with the distribution.
-*
-*   Neither the name of the copyright holder nor the names of the
-*   contributors may be used to endorse or promote products derived from
-*   this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-* DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
-*
-* The information provided is believed to be accurate and reliable.
-* The copyright holder assumes no responsibility for the consequences of use
-* of such information nor for any infringement of patents or
-* other rights of third parties which may result from its use.
-* No license is granted by implication or otherwise under any patent or
-* patent rights of the copyright holder.
-*/
-
-#include "NAxisMotion.h"        //Contains the bridge code between the API and the Arduino Environment
-#include <Wire.h>
-
-NAxisMotion mySensor;                 //Object that for the sensor
-unsigned long lastStreamTime = 0;     //To store the last streamed time stamp
-const int streamPeriod = 20;          //To stream at 25Hz without using additional timers (time period(ms) =1000/frequency(Hz))
-   
-//bool updateSensorData = true;         //Flag to update the sensor data. Default is true to perform the first read before the first stream
-
-void setup() //This code is executed once
-{
-  //Peripheral Initialization
-  Serial.begin(115200);           //Initialize the Serial Port to view information on the Serial Monitor
-  I2C.begin();                    //Initialize I2C communication to the let the library communicate with the sensor. 
-  //Sensor Initialization
-  mySensor.initSensor(0x29);       //The I2C Address can be changed here inside this function in the library
-  mySensor.setOperationMode(OPERATION_MODE_NDOF);   //Can be configured to other operation modes as desired
-  mySensor.setUpdateMode(MANUAL);	//The default is AUTO. Changing to manual requires calling the relevant update functions prior to calling the read functions
-}
-
-float g_eula_h;
-float g_eula_r;
-float g_eula_p;
-
-void loop() //This code is looped forever
-{
-      if ((millis() - lastStreamTime) >= streamPeriod)
-  {
-    lastStreamTime = millis();    
-    mySensor.updateEuler();        //Update the Euler data into the structure of the object
-    mySensor.updateCalibStatus();  //Update the Calibration Status
-
-    g_eula_h = mySensor.readEulerHeading();
-    g_eula_r = mySensor.readEulerRoll();
-    g_eula_p = mySensor.readEulerPitch();
-#ifdef PRINT_SENSOR      
-    Serial.print("Time: ");
-    Serial.print(lastStreamTime);
-    Serial.print("ms ");
-
-    Serial.print(" H: ");
-    Serial.print(g_eula_h); //Heading(h) 0 to 360 data
-    Serial.print("deg ");
-
-    Serial.print(" R: ");
-    Serial.print(g_eula_r); //Roll(y) 180 to -180 data
-    Serial.print("deg");
-
-    Serial.print(" P: ");
-    Serial.print(g_eula_p); //Pitch(x) 180 to -180 data
-    Serial.print("deg ");
-    
-    Serial.print(" A: ");
-    Serial.print(mySensor.readAccelCalibStatus());  //Accelerometer Calibration Status (0 - 3)
-	
-    Serial.print(" M: ");
-    Serial.print(mySensor.readMagCalibStatus());    //Magnetometer Calibration Status (0 - 3)
-	
-    Serial.print(" G: ");
-    Serial.print(mySensor.readGyroCalibStatus());   //Gyroscope Calibration Status (0 - 3)
-	
-    Serial.print(" S: ");
-    Serial.print(mySensor.readSystemCalibStatus());   //System Calibration Status (0 - 3)
-
-    Serial.println();
-#endif       
-  }
-    
-#if 0    
-  if (updateSensorData)  //Keep the updating of data as a separate task
-  {
-    mySensor.updateAccel();        //Update the Accelerometer data
-    mySensor.updateLinearAccel();  //Update the Linear Acceleration data
-    mySensor.updateGravAccel();    //Update the Gravity Acceleration data
-    mySensor.updateCalibStatus();  //Update the Calibration Status
-    updateSensorData = false;
-  }
-
-  if ((millis() - lastStreamTime) >= streamPeriod)
-  {
-    lastStreamTime = millis();
-    Serial.print("Time: ");
-    Serial.print(lastStreamTime);
-    Serial.print("ms ");
-
-    Serial.print("      aX: ");
-    Serial.print(mySensor.readAccelX()); //Accelerometer X-Axis data
-    Serial.print("m/s2 ");
-
-    Serial.print(" aY: ");
-    Serial.print(mySensor.readAccelY());  //Accelerometer Y-Axis data
-    Serial.print("m/s2 ");
-
-    Serial.print(" aZ: ");
-    Serial.print(mySensor.readAccelZ());  //Accelerometer Z-Axis data
-    Serial.print("m/s2 ");
-
-    Serial.print("      lX: ");
-    Serial.print(mySensor.readLinearAccelX()); //Linear Acceleration X-Axis data
-    Serial.print("m/s2 ");
-
-    Serial.print(" lY: ");
-    Serial.print(mySensor.readLinearAccelY());  //Linear Acceleration Y-Axis data
-    Serial.print("m/s2 ");
-
-    Serial.print(" lZ: ");
-    Serial.print(mySensor.readLinearAccelZ());  //Linear Acceleration Z-Axis data
-    Serial.print("m/s2 ");
-
-    Serial.print("      gX: ");
-    Serial.print(mySensor.readGravAccelX()); //Gravity Acceleration X-Axis data
-    Serial.print("m/s2 ");
-
-    Serial.print(" gY: ");
-    Serial.print(mySensor.readGravAccelY());  //Gravity Acceleration Y-Axis data
-    Serial.print("m/s2 ");
-
-    Serial.print(" gZ: ");
-    Serial.print(mySensor.readGravAccelZ());  //Gravity Acceleration Z-Axis data
-    Serial.print("m/s2 ");
-
-    Serial.print("      C: ");
-    Serial.print(mySensor.readAccelCalibStatus());  //Accelerometer Calibration Status (0 - 3)
-
-    Serial.println();
-    updateSensorData = true;
-  }
-#endif
-    
-  delay(1);
-}
-
-bool processing_connected = false;
-
-void establishContact() {
-    while (!Serial5.available()) {
-        Serial5.print('A'); // send a capital A
-        delay(300);
-    }
-    Serial.println("Processing Task : Connect!");
-    processing_connected = true;
-}
-
-void task1_setup()
-{
-    Serial5.begin(115200);
-    Serial.print("Start!");
-}
-
-int inByte = 0;
-int last_connect = 0;
-
-#define TIMEOUT_MS  3000
-
-void task1_loop()
-{
-    if(!processing_connected){
-        establishContact();        
-    }else{
-        if((millis() - last_connect) > TIMEOUT_MS){
-            processing_connected = false;
-            Serial.println("Processing Task : Disconnect!");
-        }              
-    }
-    
-    int16_t roll = (int16_t)g_eula_r;
-    int16_t pitch = (int16_t)g_eula_p;
-    int16_t heading;
-
-    if(g_eula_h <= 180){
-        heading = (int16_t)g_eula_h;
-    }
-    else{
-        heading = (int16_t)(g_eula_h - 360);
-    }
-
-    if (Serial5.available()){
-        inByte = Serial5.read();
-        last_connect = millis();
-        
-        Serial5.write((uint8_t)(heading >> 8));
-        Serial5.write((uint8_t)heading);
-        Serial5.write((uint8_t)(roll >> 8));                
-        Serial5.write((uint8_t)roll);        
-        Serial5.write((uint8_t)(pitch >> 8));
-        Serial5.write((uint8_t)pitch);
-    }
-    delay(1);
-}
Index: rtos_arduino/trunk/examples/NAxesMotion/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 1
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/NCESCan/Makefile
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/NCESCan/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -38,7 +38,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -54,3 +54,3 @@
 APPL_DIR = 
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/NCESCan/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/NCESCan/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/NCESCan/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/NCESCan/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,169 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents />
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.222</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/NCESCan/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/NCESCan/r2ca.cproj	(revision 260)
@@ -0,0 +1,168 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/NCESCan/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/NCESCan/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,8 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("r2ca_lib.cfg");
Index: rtos_arduino/trunk/examples/NCESCan/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/NCESCan/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,142 @@
+#include "r2ca.h"
+
+// demo: CAN-BUS Shield, receive data
+#include <SPI.h>
+#include "mcp_can.h"
+#include <stdio.h>
+#define uint8_t unsigned char
+
+const int SPI_CS_PIN = 9;
+#define CAN_INT_PIN 3
+MCP_CAN CAN(SPI_CS_PIN);                                    // Set CS pin
+
+extern void MCP2515_ISR();
+
+/*
+ *  CAN Controller : MCP2515
+ *  TXB : MCP_TXB0:0, MCP_RXB1:1,MCP_RXB2:2
+ *  RXB : MCP_RXB0:0 : Mask MCP_RXM0:0 : Filer MCP_RXF0:0, MCP_RXF1:1
+ *        MCP_RXB1:1 : Mask MCP_RXM2:1 : Filer MCP_RXF2:2, MCP_RXF3:3, MCP_RXF4:4, MCP_RXF5:5
+ *  Interrupt mask
+ *    MCP_TX0IF
+ *    MCP_TX1IF
+ *    MCP_TX2IF
+ *    MCP_RX0IF
+ *    MCP_RX1IF
+ */
+
+void setup()
+{
+    Serial.begin(115200);
+    pinMode(13, OUTPUT);
+
+    /*
+     *  CAN Initialize
+     */
+    if(CAN.begin(CAN_500KBPS) ==CAN_OK) {
+        Serial.print("can init ok!!\r\n");
+    }
+    else {
+        while(1){
+            Serial.print("Can init fail!!\r\n");
+            digitalWrite(13, HIGH); 
+            delay(500);             
+            digitalWrite(13, LOW);  
+            delay(500);             
+        };
+    }
+    
+    /*
+     *  CAN Recive mabx Init
+     */
+    
+    /*
+     *  RXB0
+     */
+    CAN.init_Mask(MCP_RXM0, 0x0f);
+    CAN.init_Filter(MCP_RXF0, 0x01);
+    CAN.init_Filter(MCP_RXF1, 0x02);
+    CAN.startReceive(MCP_RXB0);
+
+    /*
+     *  RXB1
+     */
+    CAN.init_Mask(MCP_RXM1, 0x0f);
+    CAN.init_Filter(MCP_RXF2, 0x03);
+    CAN.init_Filter(MCP_RXF3, 0x04);
+    CAN.init_Filter(MCP_RXF4, 0x05);
+    CAN.init_Filter(MCP_RXF5, 0x06);    
+    CAN.startReceive(MCP_RXB1);
+
+    CAN.enableInterrupt(MCP_RX0IF|MCP_RX1IF);
+    CAN.attachInterrupt(CAN_INT_PIN, MCP2515_ISR);
+
+}
+
+uint8_t Flag_Recv = 0;
+
+void MCP2515_ISR()
+{
+     Flag_Recv = 1;
+}
+
+void loop()
+{
+    uint8_t len = 0;
+    uint8_t buf[8];
+    uint8_t i;
+    uint32_t id;    
+    
+    if(!Flag_Recv) {
+       delay(1);
+        return;
+    }
+      
+    Flag_Recv = 0;
+
+    for(i = 0; i < 2; i++){
+        if(CAN.checkReceive(i) == CAN_NOMSG) {
+            continue;
+        }       
+        CAN.readMsg(i, &id, &len, buf);    // read data,  len: data length, buf: data buf
+        Serial.print("CAN_BUS GET DATA MBX");
+        Serial.println(i);
+        Serial.print("ID = ");Serial.print(id, HEX);
+        Serial.print(", DLC = ");Serial.print(len);
+        Serial.print(", data = ");
+        for(int i = 0; i<len; i++){    // print the data          
+              Serial.print(buf[i]);Serial.print("\t");
+          }
+        Serial.println();
+    }
+}
+
+unsigned char stmp[8][8] = {
+    {1, 2, 3, 4, 5, 6, 7, 8},
+    {2, 3, 4, 5, 6, 7, 8, 1},
+    {3, 4, 5, 6, 7, 8, 1, 2},
+    {1, 2, 3, 4, 5, 6, 7, 8},
+    {1, 2, 3, 4, 5, 6, 7, 8},
+    {1, 2, 3, 4, 5, 6, 7, 8},
+    {1, 2, 3, 4, 5, 6, 7, 8},
+    {0, 1, 2, 3, 4, 5, 6, 7}
+};
+
+unsigned char stmp1[8] =     {0, 1, 2, 3, 4, 5, 6, 7};
+    
+void loop1()
+{
+    int i, e;
+
+    for(e = 0;  e < 3; e++){
+        Serial.print("Send can message from mbx ");
+        Serial.println(e);
+        for(i = 1; i <= 8; i++){
+            while(CAN_SENDWAIT == CAN.checkSend(e)){delay(10);};
+            /* mailbox, ID, DLC, DATA */
+            CAN.sendMsg(e, i, i, stmp[i-1]);
+        }
+    }
+
+    delay(5000);
+}
Index: rtos_arduino/trunk/examples/NCESCan/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/NCESCan/r2ca_app.h	(revision 260)
@@ -0,0 +1,6 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 1
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/NCESCan/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/NCESCan/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/NCESCan/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/NCESCan/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,8 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-/*
- *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
- */
-INCLUDE("rca_lib.cfg");
Index: rtos_arduino/trunk/examples/NCESCan/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,149 +1,0 @@
-#include "rca.h"
-
-// demo: CAN-BUS Shield, receive data
-#include <SPI.h>
-#include "mcp_can.h"
-#include <stdio.h>
-#define uint8_t unsigned char
-
-const int SPI_CS_PIN = 9;
-#define CAN_INT_PIN 3
-MCP_CAN CAN(SPI_CS_PIN);                                    // Set CS pin
-
-extern void MCP2515_ISR();
-
-/*
- *  CAN Controller : MCP2515
- *  TXB : MCP_TXB0:0, MCP_RXB1:1,MCP_RXB2:2
- *  RXB : MCP_RXB0:0 : Mask MCP_RXM0:0 : Filer MCP_RXF0:0, MCP_RXF1:1
- *        MCP_RXB1:1 : Mask MCP_RXM2:1 : Filer MCP_RXF2:2, MCP_RXF3:3, MCP_RXF4:4, MCP_RXF5:5
- *  Interrupt mask
- *    MCP_TX0IF
- *    MCP_TX1IF
- *    MCP_TX2IF
- *    MCP_RX0IF
- *    MCP_RX1IF
- */
-bool can_init_done = false;
-
-void setup()
-{
-    Serial.begin(115200);
-    pinMode(13, OUTPUT);
-
-    /*
-     *  CAN Initialize
-     */
-    if(CAN.begin(CAN_500KBPS) ==CAN_OK) {
-        Serial.print("can init ok!!\r\n");
-    }
-    else {
-        while(1){
-            Serial.print("Can init fail!!\r\n");
-            digitalWrite(13, HIGH); 
-            delay(500);             
-            digitalWrite(13, LOW);  
-            delay(500);             
-        };
-    }
-    
-    /*
-     *  CAN Recive mabx Init
-     */
-    
-    /*
-     *  RXB0
-     */
-    CAN.init_Mask(MCP_RXM0, 0x0f);
-    CAN.init_Filter(MCP_RXF0, 0x01);
-    CAN.init_Filter(MCP_RXF1, 0x02);
-    CAN.startReceive(MCP_RXB0);
-
-    /*
-     *  RXB1
-     */
-    CAN.init_Mask(MCP_RXM1, 0x0f);
-    CAN.init_Filter(MCP_RXF2, 0x03);
-    CAN.init_Filter(MCP_RXF3, 0x04);
-    CAN.init_Filter(MCP_RXF4, 0x05);
-    CAN.init_Filter(MCP_RXF5, 0x06);    
-    CAN.startReceive(MCP_RXB1);
-
-    CAN.enableInterrupt(MCP_RX0IF|MCP_RX1IF);
-    CAN.attachInterrupt(CAN_INT_PIN, MCP2515_ISR);
-
-    can_init_done = true;
-}
-
-uint8_t Flag_Recv = 0;
-
-void MCP2515_ISR()
-{
-     Flag_Recv = 1;
-}
-
-void loop()
-{
-    uint8_t len = 0;
-    uint8_t buf[8];
-    uint8_t i;
-    uint32_t id;    
-    
-    if(!Flag_Recv) {
-       delay(1);
-        return;
-    }
-      
-    Flag_Recv = 0;
-
-    for(i = 0; i < 2; i++){
-        if(CAN.checkReceive(i) == CAN_NOMSG) {
-            continue;
-        }       
-        CAN.readMsg(i, &id, &len, buf);    // read data,  len: data length, buf: data buf
-        Serial.print("CAN_BUS GET DATA MBX");
-        Serial.println(i);
-        Serial.print("ID = ");Serial.print(id, HEX);
-        Serial.print(", DLC = ");Serial.print(len);
-        Serial.print(", data = ");
-        for(int i = 0; i<len; i++){    // print the data          
-              Serial.print(buf[i]);Serial.print("\t");
-          }
-        Serial.println();
-    }
-}
-
-void task1_setup()
-{
-    while(can_init_done == false){delay(10);}
-}
-
-unsigned char stmp[8][8] = {
-    {1, 2, 3, 4, 5, 6, 7, 8},
-    {2, 3, 4, 5, 6, 7, 8, 1},
-    {3, 4, 5, 6, 7, 8, 1, 2},
-    {1, 2, 3, 4, 5, 6, 7, 8},
-    {1, 2, 3, 4, 5, 6, 7, 8},
-    {1, 2, 3, 4, 5, 6, 7, 8},
-    {1, 2, 3, 4, 5, 6, 7, 8},
-    {0, 1, 2, 3, 4, 5, 6, 7}
-};
-
-unsigned char stmp1[8] =     {0, 1, 2, 3, 4, 5, 6, 7};
-    
-void task1_loop()
-{
-    int i, e;
-
-    for(e = 0;  e < 3; e++){
-        Serial.print("Send can message from mbx ");
-        Serial.println(e);
-        for(i = 1; i <= 8; i++){
-            while(CAN_SENDWAIT == CAN.checkSend(e)){delay(10);};
-            /* mailbox, ID, DLC, DATA */
-            CAN.sendMsg(e, i, i, stmp[i-1]);
-        }
-    }
-
-    delay(5000);
-}
Index: rtos_arduino/trunk/examples/NCESCan/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 1
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/NCESIoT/Makefile
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/NCESIoT/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -37,7 +37,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -53,5 +53,5 @@
 APPL_DIR = 
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Servo/src/ $(RCA_DIR)/arduino_lib/libraries/Servo/src/samd
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Servo/src/ $(R2CA_DIR)/arduino_lib/libraries/Servo/src/samd
 APPL_CXXOBJS += Servo.o
 APPL_COBJS   += 
@@ -65,3 +65,3 @@
 APPL_COBJS   += 
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/NCESIoT/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/NCESIoT/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/NCESIoT/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/NCESIoT/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/NCESIoT/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/NCESIoT/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/NCESIoT/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/NCESIoT/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,8 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("r2ca_lib.cfg");
Index: rtos_arduino/trunk/examples/NCESIoT/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/NCESIoT/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,208 @@
+#include "r2ca.h"
+
+#define SERVO
+//#define ULTRASONIC
+//#define LCD_ULTRASONIC
+//#define LCD_ULTRASONIC_SERVO  /* define R2CA_NUM_TASK as 1 */
+
+#ifdef SERVO
+
+/* Sweep
+ by BARRAGAN <http://barraganstudio.com> 
+ This example code is in the public domain.
+
+ modified 8 Nov 2013
+ by Scott Fitzgerald
+ http://arduino.cc/en/Tutorial/Sweep
+*/ 
+
+#include <Servo.h> 
+ 
+Servo myservo;  // create servo object to control a servo 
+                // twelve servo objects can be created on most boards
+ 
+int pos = 0;    // variable to store the servo position 
+ 
+void setup() 
+{ 
+  myservo.attach(2);  // attaches the servo on pin 9 to the servo object 
+} 
+ 
+void loop() 
+{ 
+  for(pos = 0; pos <= 180; pos += 1) // goes from 0 degrees to 180 degrees 
+  {                                  // in steps of 1 degree 
+    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
+    delay(15);                       // waits 15ms for the servo to reach the position 
+  } 
+  for(pos = 180; pos>=0; pos-=1)     // goes from 180 degrees to 0 degrees 
+  {                                
+    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
+    delay(15);                       // waits 15ms for the servo to reach the position 
+  } 
+} 
+
+#endif /* SERVO */
+
+#ifdef ULTRASONIC
+
+/*
+ * UltrasonicDisplayOnTerm.ino
+ * Example sketch for ultrasonic ranger
+ *
+ * Copyright (c) 2012 seeed technology inc.
+ * Website    : www.seeed.cc
+ * Author     : LG, FrankieChu
+ * Create Time: Jan 17,2013
+ * Change Log :
+ *
+ * The MIT License (MIT)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+
+/***************************************************************************/
+//	Function: Measure the distance to obstacles in front and print the distance
+//			  value to the serial terminal.The measured distance is from
+//			  the range 0 to 400cm(157 inches).
+//	Hardware: Grove - Ultrasonic Ranger
+//	Arduino IDE: Arduino-1.0
+/*****************************************************************************/
+
+#include "Ultrasonic.h"
+
+Ultrasonic ultrasonic(3);
+
+extern void task1_setup();
+
+void setup()
+{
+	Serial.begin(115200);
+}
+void loop()
+{
+	long RangeInCentimeters;
+	RangeInCentimeters = ultrasonic.MeasureInCentimeters(); // two measurements should keep an interval
+	Serial.print(RangeInCentimeters);//0~400cm
+	Serial.println(" cm");
+	delay(250);
+
+	task1_setup();
+}
+
+#endif /* ULTRASONIC */
+
+#ifdef LCD_ULTRASONIC
+
+#include <Wire.h>
+#include <SeeedGrayOLED.h>
+#include <avr/pgmspace.h>
+#include "Ultrasonic.h"
+
+Ultrasonic ultrasonic(3);
+
+void setup()
+{
+    Wire.begin();
+    SeeedGrayOled.init();             //initialize SEEED OLED display
+    SeeedGrayOled.clearDisplay();     //Clear Display.
+    SeeedGrayOled.setNormalDisplay(); //Set Normal Display Mode
+    SeeedGrayOled.setVerticalMode();  // Set to vertical mode for displaying text
+}
+ 
+void loop()
+{
+    long RangeInCentimeters;
+
+    SeeedGrayOled.setTextXY(0,0);  //set Cursor to ith line, 0th column
+    SeeedGrayOled.setGrayLevel(15); //Set Grayscale level. Any number between 0 - 15.    
+    RangeInCentimeters = ultrasonic.MeasureInCentimeters(); // two measurements should keep an interval
+    SeeedGrayOled.putNumber(RangeInCentimeters);//0~400cm
+    SeeedGrayOled.putString(" cm      ");
+    delay(250);    
+}
+#endif /* LCD_ULTRASONIC */
+
+#ifdef LCD_ULTRASONIC_SERVO
+
+#include <Wire.h>
+#include <SeeedGrayOLED.h>
+#include <avr/pgmspace.h>
+#include "Ultrasonic.h"
+
+Ultrasonic ultrasonic(3);
+
+void setup()
+{
+    Wire.begin();
+    SeeedGrayOled.init();             //initialize SEEED OLED display
+    SeeedGrayOled.clearDisplay();     //Clear Display.
+    SeeedGrayOled.setNormalDisplay(); //Set Normal Display Mode
+    SeeedGrayOled.setVerticalMode();  // Set to vertical mode for displaying text
+}
+ 
+void loop()
+{
+    long RangeInCentimeters;
+
+    SeeedGrayOled.setTextXY(0,0);  //set Cursor to ith line, 0th column
+    SeeedGrayOled.setGrayLevel(15); //Set Grayscale level. Any number between 0 - 15.    
+    RangeInCentimeters = ultrasonic.MeasureInCentimeters(); // two measurements should keep an interval
+    SeeedGrayOled.putNumber(RangeInCentimeters);//0~400cm
+    SeeedGrayOled.putString(" cm      ");
+    delay(250);    
+}
+
+/* Sweep
+ by BARRAGAN <http://barraganstudio.com> 
+ This example code is in the public domain.
+
+ modified 8 Nov 2013
+ by Scott Fitzgerald
+ http://arduino.cc/en/Tutorial/Sweep
+*/ 
+
+#include <Servo.h> 
+ 
+Servo myservo;  // create servo object to control a servo 
+                // twelve servo objects can be created on most boards
+ 
+int pos = 0;    // variable to store the servo position 
+ 
+void task1_setup() 
+{ 
+  myservo.attach(2);  // attaches the servo on pin 9 to the servo object 
+} 
+ 
+void loop1() 
+{ 
+  for(pos = 0; pos <= 180; pos += 1) // goes from 0 degrees to 180 degrees 
+  {                                  // in steps of 1 degree 
+    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
+    delay(15);                       // waits 15ms for the servo to reach the position 
+  } 
+  for(pos = 180; pos>=0; pos-=1)     // goes from 180 degrees to 0 degrees 
+  {                                
+    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
+    delay(15);                       // waits 15ms for the servo to reach the position 
+  } 
+} 
+
+#endif /* LCD_ULTRASONIC */
Index: rtos_arduino/trunk/examples/NCESIoT/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/NCESIoT/r2ca_app.h	(revision 260)
@@ -0,0 +1,6 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 0
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/NCESIoT/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/NCESIoT/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/NCESIoT/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/NCESIoT/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,8 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-/*
- *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
- */
-INCLUDE("rca_lib.cfg");
Index: rtos_arduino/trunk/examples/NCESIoT/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,204 +1,0 @@
-#include "rca.h"
-
-#define SERVO
-//#define ULTRASONIC
-//#define LCD_ULTRASONIC
-//#define LCD_ULTRASONIC_SERVO  /* define RCA_NUM_TASK as 1 */
-
-#ifdef SERVO
-
-/* Sweep
- by BARRAGAN <http://barraganstudio.com> 
- This example code is in the public domain.
-
- modified 8 Nov 2013
- by Scott Fitzgerald
- http://arduino.cc/en/Tutorial/Sweep
-*/ 
-
-#include <Servo.h> 
- 
-Servo myservo;  // create servo object to control a servo 
-                // twelve servo objects can be created on most boards
- 
-int pos = 0;    // variable to store the servo position 
- 
-void setup() 
-{ 
-  myservo.attach(2);  // attaches the servo on pin 9 to the servo object 
-} 
- 
-void loop() 
-{ 
-  for(pos = 0; pos <= 180; pos += 1) // goes from 0 degrees to 180 degrees 
-  {                                  // in steps of 1 degree 
-    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
-    delay(15);                       // waits 15ms for the servo to reach the position 
-  } 
-  for(pos = 180; pos>=0; pos-=1)     // goes from 180 degrees to 0 degrees 
-  {                                
-    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
-    delay(15);                       // waits 15ms for the servo to reach the position 
-  } 
-} 
-
-#endif /* SERVO */
-
-#ifdef ULTRASONIC
-
-/*
- * UltrasonicDisplayOnTerm.ino
- * Example sketch for ultrasonic ranger
- *
- * Copyright (c) 2012 seeed technology inc.
- * Website    : www.seeed.cc
- * Author     : LG, FrankieChu
- * Create Time: Jan 17,2013
- * Change Log :
- *
- * The MIT License (MIT)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-
-/***************************************************************************/
-//	Function: Measure the distance to obstacles in front and print the distance
-//			  value to the serial terminal.The measured distance is from
-//			  the range 0 to 400cm(157 inches).
-//	Hardware: Grove - Ultrasonic Ranger
-//	Arduino IDE: Arduino-1.0
-/*****************************************************************************/
-
-#include "Ultrasonic.h"
-
-Ultrasonic ultrasonic(3);
-
-void setup()
-{
-	Serial.begin(115200);
-}
-void loop()
-{
-	long RangeInCentimeters;
-	RangeInCentimeters = ultrasonic.MeasureInCentimeters(); // two measurements should keep an interval
-	Serial.print(RangeInCentimeters);//0~400cm
-	Serial.println(" cm");
-	delay(250);
-}
-
-#endif /* ULTRASONIC */
-
-#ifdef LCD_ULTRASONIC
-
-#include <Wire.h>
-#include <SeeedGrayOLED.h>
-#include <avr/pgmspace.h>
-#include "Ultrasonic.h"
-
-Ultrasonic ultrasonic(3);
-
-void setup()
-{
-    Wire.begin();
-    SeeedGrayOled.init();             //initialize SEEED OLED display
-    SeeedGrayOled.clearDisplay();     //Clear Display.
-    SeeedGrayOled.setNormalDisplay(); //Set Normal Display Mode
-    SeeedGrayOled.setVerticalMode();  // Set to vertical mode for displaying text
-}
- 
-void loop()
-{
-    long RangeInCentimeters;
-
-    SeeedGrayOled.setTextXY(0,0);  //set Cursor to ith line, 0th column
-    SeeedGrayOled.setGrayLevel(15); //Set Grayscale level. Any number between 0 - 15.    
-    RangeInCentimeters = ultrasonic.MeasureInCentimeters(); // two measurements should keep an interval
-    SeeedGrayOled.putNumber(RangeInCentimeters);//0~400cm
-    SeeedGrayOled.putString(" cm      ");
-    delay(250);    
-}
-#endif /* LCD_ULTRASONIC */
-
-#ifdef LCD_ULTRASONIC_SERVO
-
-#include <Wire.h>
-#include <SeeedGrayOLED.h>
-#include <avr/pgmspace.h>
-#include "Ultrasonic.h"
-
-Ultrasonic ultrasonic(3);
-
-void setup()
-{
-    Wire.begin();
-    SeeedGrayOled.init();             //initialize SEEED OLED display
-    SeeedGrayOled.clearDisplay();     //Clear Display.
-    SeeedGrayOled.setNormalDisplay(); //Set Normal Display Mode
-    SeeedGrayOled.setVerticalMode();  // Set to vertical mode for displaying text
-}
- 
-void loop()
-{
-    long RangeInCentimeters;
-
-    SeeedGrayOled.setTextXY(0,0);  //set Cursor to ith line, 0th column
-    SeeedGrayOled.setGrayLevel(15); //Set Grayscale level. Any number between 0 - 15.    
-    RangeInCentimeters = ultrasonic.MeasureInCentimeters(); // two measurements should keep an interval
-    SeeedGrayOled.putNumber(RangeInCentimeters);//0~400cm
-    SeeedGrayOled.putString(" cm      ");
-    delay(250);    
-}
-
-/* Sweep
- by BARRAGAN <http://barraganstudio.com> 
- This example code is in the public domain.
-
- modified 8 Nov 2013
- by Scott Fitzgerald
- http://arduino.cc/en/Tutorial/Sweep
-*/ 
-
-#include <Servo.h> 
- 
-Servo myservo;  // create servo object to control a servo 
-                // twelve servo objects can be created on most boards
- 
-int pos = 0;    // variable to store the servo position 
- 
-void task1_setup() 
-{ 
-  myservo.attach(2);  // attaches the servo on pin 9 to the servo object 
-} 
- 
-void task1_loop() 
-{ 
-  for(pos = 0; pos <= 180; pos += 1) // goes from 0 degrees to 180 degrees 
-  {                                  // in steps of 1 degree 
-    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
-    delay(15);                       // waits 15ms for the servo to reach the position 
-  } 
-  for(pos = 180; pos>=0; pos-=1)     // goes from 180 degrees to 0 degrees 
-  {                                
-    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
-    delay(15);                       // waits 15ms for the servo to reach the position 
-  } 
-} 
-
-#endif /* LCD_ULTRASONIC */
Index: rtos_arduino/trunk/examples/NCESIoT/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 1
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/NCESIoT_RTOS/Makefile
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT_RTOS/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/NCESIoT_RTOS/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -37,7 +37,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -66,3 +66,3 @@
 APPL_COBJS   += 
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,10 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("r2ca_lib.cfg");
+
+CRE_SEM(OLED_SEM, {TA_NULL, 1, 1});
Index: rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,136 @@
+#include "r2ca.h"
+
+//#define USE_INTERRUPT
+
+#include <Wire.h>
+#include <Digital_Light_TSL2561.h>
+#include <SeeedOLED.h>
+#include <ChainableLED.h>
+
+#define LED_PIN  4
+
+extern void task1_setup();
+extern void task2_setup();
+extern void task3_setup();
+
+void setup()
+{
+    Serial.begin(115200);
+    pinMode(LED_PIN, OUTPUT);
+
+    task1_setup();
+    task2_setup();
+    task3_setup();
+}
+
+void loop() 
+{
+    digitalWrite(LED_PIN, HIGH);   // turn the LED on (HIGH is the voltage level)
+    delay(1000);                   // wait for a second
+    digitalWrite(LED_PIN, LOW);    // turn the LED off by making the voltage LOW
+    delay(1000);                   // wait for a second    
+}
+
+
+#define TOUCH_PIN 3
+
+int is_update_oled;
+
+void task1_setup() 
+{
+    Wire.begin();
+    TSL2561.init();
+
+    SeeedOled.init();
+    SeeedOled.deactivateScroll();
+
+    is_update_oled = 1;
+} 
+ 
+void loop1() 
+{
+    int lux;
+
+    lux = TSL2561.readVisibleLux();
+    Serial.print("The Light value is: ");
+    Serial.println(lux);
+
+    if (is_update_oled == 1) {
+        wai_sem(OLED_SEM);
+        SeeedOled.setTextXY(0, 0);        
+        SeeedOled.putNumber(lux);
+        SeeedOled.putString("    ");        
+        sig_sem(OLED_SEM);
+    }
+    
+    delay(1000);
+}
+
+#ifdef USE_INTERRUPT
+void onTouch(void) {
+    Serial.print("hoge");
+    iwup_tsk(R2CA_TASK1);
+}
+#endif /* USE_INTERRUPT */
+
+void task2_setup()
+{
+    pinMode(TOUCH_PIN, INPUT_PULLUP);
+#ifdef USE_INTERRUPT    
+    attachInterrupt(TOUCH_PIN, onTouch, CHANGE);
+#endif /* USE_INTERRUPT */    
+}
+
+void loop2() 
+{
+#ifdef USE_INTERRUPT    
+    slp_tsk();
+#else /* USE_INTERRUPT */
+    delay(1);    
+#endif /* USE_INTERRUPT */
+    
+    int TouchSensorValue = digitalRead(TOUCH_PIN);
+
+    if(TouchSensorValue==1) {
+        is_update_oled = 0;
+        wai_sem(OLED_SEM);
+        SeeedOled.setInverseDisplay();
+        sig_sem(OLED_SEM);
+    }else{        
+        is_update_oled = 1;
+        wai_sem(OLED_SEM);
+        SeeedOled.setNormalDisplay();
+        sig_sem(OLED_SEM);
+    }
+}
+
+#define NUM_LEDS  1
+
+ChainableLED leds(8, 9, NUM_LEDS);
+
+void task3_setup()
+{
+    leds.init();
+}
+
+float hue = 0.0;
+boolean up = true;
+int count = 0;
+
+void loop3()
+{
+    for (byte i=0; i<NUM_LEDS; i++)
+      leds.setColorHSB(i, hue, 1.0, 0.5);
+    
+    delay(50);
+    
+    if (up)
+      hue+= 0.025;
+    else
+      hue-= 0.025;
+    
+    if (hue>=1.0 && up)
+      up = false;
+    else if (hue<=0.0 && !up)
+      up = true;
+}
Index: rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/NCESIoT_RTOS/r2ca_app.h	(revision 260)
@@ -0,0 +1,6 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 3
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/NCESIoT_RTOS/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT_RTOS/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/NCESIoT_RTOS/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT_RTOS/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/NCESIoT_RTOS/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT_RTOS/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/NCESIoT_RTOS/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT_RTOS/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,10 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-/*
- *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
- */
-INCLUDE("rca_lib.cfg");
-
-CRE_SEM(OLED_SEM, {TA_NULL, 1, 1});
Index: rtos_arduino/trunk/examples/NCESIoT_RTOS/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT_RTOS/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,128 +1,0 @@
-#include "rca.h"
-
-//#define USE_INTERRUPT
-
-#include <Wire.h>
-#include <Digital_Light_TSL2561.h>
-#include <SeeedOLED.h>
-#include <ChainableLED.h>
-
-#define LED_PIN  4
-
-void setup()
-{
-    Serial.begin(115200);
-    pinMode(LED_PIN, OUTPUT);
-}
-
-void loop() 
-{
-    digitalWrite(LED_PIN, HIGH);   // turn the LED on (HIGH is the voltage level)
-    delay(1000);                   // wait for a second
-    digitalWrite(LED_PIN, LOW);    // turn the LED off by making the voltage LOW
-    delay(1000);                   // wait for a second    
-}
-
-
-#define TOUCH_PIN 3
-
-int is_update_oled;
-
-void task1_setup() 
-{
-    Wire.begin();
-    TSL2561.init();
-
-    SeeedOled.init();
-    SeeedOled.deactivateScroll();
-
-    is_update_oled = 1;
-} 
- 
-void task1_loop() 
-{
-    int lux;
-
-    lux = TSL2561.readVisibleLux();
-    Serial.print("The Light value is: ");
-    Serial.println(lux);
-
-    if (is_update_oled == 1) {
-        wai_sem(OLED_SEM);
-        SeeedOled.setTextXY(0, 0);        
-        SeeedOled.putNumber(lux);
-        SeeedOled.putString("    ");        
-        sig_sem(OLED_SEM);
-    }
-    
-    delay(1000);
-}
-
-#ifdef USE_INTERRUPT
-void onTouch(void) {
-    Serial.print("hoge");
-    iwup_tsk(RCA_TASK1);
-}
-#endif /* USE_INTERRUPT */
-
-void task2_setup()
-{
-    pinMode(TOUCH_PIN, INPUT_PULLUP);
-#ifdef USE_INTERRUPT    
-    attachInterrupt(TOUCH_PIN, onTouch, CHANGE);
-#endif /* USE_INTERRUPT */    
-}
-
-void task2_loop() 
-{
-#ifdef USE_INTERRUPT    
-    slp_tsk();
-#else /* USE_INTERRUPT */
-    delay(1);    
-#endif /* USE_INTERRUPT */
-    
-    int TouchSensorValue = digitalRead(TOUCH_PIN);
-
-    if(TouchSensorValue==1) {
-        is_update_oled = 0;
-        wai_sem(OLED_SEM);
-        SeeedOled.setInverseDisplay();
-        sig_sem(OLED_SEM);
-    }else{        
-        is_update_oled = 1;
-        wai_sem(OLED_SEM);
-        SeeedOled.setNormalDisplay();
-        sig_sem(OLED_SEM);
-    }
-}
-
-#define NUM_LEDS  1
-
-ChainableLED leds(8, 9, NUM_LEDS);
-
-void task3_setup()
-{
-    leds.init();
-}
-
-float hue = 0.0;
-boolean up = true;
-int count = 0;
-
-void task3_loop()
-{
-    for (byte i=0; i<NUM_LEDS; i++)
-      leds.setColorHSB(i, hue, 1.0, 0.5);
-    
-    delay(50);
-    
-    if (up)
-      hue+= 0.025;
-    else
-      hue-= 0.025;
-    
-    if (hue>=1.0 && up)
-      up = false;
-    else if (hue<=0.0 && !up)
-      up = true;
-}
Index: rtos_arduino/trunk/examples/NCESIoT_RTOS/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/NCESIoT_RTOS/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 3
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/PIXY/Makefile
===================================================================
--- rtos_arduino/trunk/examples/PIXY/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/PIXY/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -37,7 +37,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -53,5 +53,5 @@
 APPL_DIR = 
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Pixy
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Pixy
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/PIXY/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/PIXY/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/PIXY/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/PIXY/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/PIXY/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/PIXY/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/PIXY/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/PIXY/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,8 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("r2ca_lib.cfg");
Index: rtos_arduino/trunk/examples/PIXY/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/PIXY/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,99 @@
+#include "r2ca.h"
+
+#include <SPI.h>  
+#include <Pixy.h>
+
+Pixy pixy;
+
+#define X_CENTER        ((PIXY_MAX_X-PIXY_MIN_X)/2)       
+#define Y_CENTER        ((PIXY_MAX_Y-PIXY_MIN_Y)/2)
+
+class ServoLoop
+{
+public:
+  ServoLoop(int32_t pgain, int32_t dgain);
+
+  void update(int32_t error);
+   
+  int32_t m_pos;
+  int32_t m_prevError;
+  int32_t m_pgain;
+  int32_t m_dgain;
+};
+
+ServoLoop panLoop(300, 500);
+ServoLoop tiltLoop(500, 700);
+
+ServoLoop::ServoLoop(int32_t pgain, int32_t dgain)
+{
+  m_pos = PIXY_RCS_CENTER_POS;
+  m_pgain = pgain;
+  m_dgain = dgain;
+  m_prevError = 0x80000000L;
+}
+
+void ServoLoop::update(int32_t error)
+{
+  long int vel;
+  char buf[32];
+  if (m_prevError!=0x80000000)
+  {	
+    vel = (error*m_pgain + (error - m_prevError)*m_dgain)>>10;
+    //sprintf(buf, "%ld\n", vel);
+    //Serial.print(buf);
+    m_pos += vel;
+    if (m_pos>PIXY_RCS_MAX_POS) 
+      m_pos = PIXY_RCS_MAX_POS; 
+    else if (m_pos<PIXY_RCS_MIN_POS) 
+      m_pos = PIXY_RCS_MIN_POS;
+  }
+  m_prevError = error;
+}
+
+void setup()
+{
+  Serial.begin(115200);
+  Serial.print("Starting...\n");  
+  pixy.init();
+  pixy.setServos(PIXY_RCS_CENTER_POS, PIXY_RCS_CENTER_POS);      
+}
+
+void loop()
+{ 
+  static int i = 0;
+  int j;
+  uint16_t blocks;
+  char buf[32]; 
+  int32_t panError, tiltError;
+  
+  blocks = pixy.getBlocks();
+  
+  if (blocks)
+  {
+    panError = X_CENTER-pixy.blocks[0].x;
+    tiltError = pixy.blocks[0].y-Y_CENTER;
+    
+    panLoop.update(panError);
+    tiltLoop.update(tiltError);
+    
+    pixy.setServos(panLoop.m_pos, tiltLoop.m_pos);
+    
+    i++;
+    
+    // do this (print) every 50 frames because printing every
+    // frame would bog down the Arduino
+    if (i%50==0) 
+    {
+      sprintf(buf, "Detected %d:\n", blocks);
+      Serial.print(buf);
+      for (j=0; j<blocks; j++)
+      {
+        sprintf(buf, "  block %d: ", j);
+        Serial.print(buf); 
+        pixy.blocks[j].print();
+        Serial.println("");
+      }
+    }
+  }
+    delay(10);
+}
Index: rtos_arduino/trunk/examples/PIXY/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/PIXY/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY/r2ca_app.h	(revision 260)
@@ -0,0 +1,6 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 0
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/PIXY/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/PIXY/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/PIXY/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/PIXY/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,171 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents>
-						<d4p1:anyType z:Ref="i1" />
-					</DependentComponents>
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.231</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/PIXY/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/PIXY/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,178 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
-    </ListValues>
-  </armgcc.assembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
-    </ListValues>
-  </armgcc.assembler.general.IncludePaths>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/PIXY/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/PIXY/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,8 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-/*
- *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
- */
-INCLUDE("rca_lib.cfg");
Index: rtos_arduino/trunk/examples/PIXY/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/PIXY/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,99 +1,0 @@
-#include "rca.h"
-
-#include <SPI.h>  
-#include <Pixy.h>
-
-Pixy pixy;
-
-#define X_CENTER        ((PIXY_MAX_X-PIXY_MIN_X)/2)       
-#define Y_CENTER        ((PIXY_MAX_Y-PIXY_MIN_Y)/2)
-
-class ServoLoop
-{
-public:
-  ServoLoop(int32_t pgain, int32_t dgain);
-
-  void update(int32_t error);
-   
-  int32_t m_pos;
-  int32_t m_prevError;
-  int32_t m_pgain;
-  int32_t m_dgain;
-};
-
-ServoLoop panLoop(300, 500);
-ServoLoop tiltLoop(500, 700);
-
-ServoLoop::ServoLoop(int32_t pgain, int32_t dgain)
-{
-  m_pos = PIXY_RCS_CENTER_POS;
-  m_pgain = pgain;
-  m_dgain = dgain;
-  m_prevError = 0x80000000L;
-}
-
-void ServoLoop::update(int32_t error)
-{
-  long int vel;
-  char buf[32];
-  if (m_prevError!=0x80000000)
-  {	
-    vel = (error*m_pgain + (error - m_prevError)*m_dgain)>>10;
-    //sprintf(buf, "%ld\n", vel);
-    //Serial.print(buf);
-    m_pos += vel;
-    if (m_pos>PIXY_RCS_MAX_POS) 
-      m_pos = PIXY_RCS_MAX_POS; 
-    else if (m_pos<PIXY_RCS_MIN_POS) 
-      m_pos = PIXY_RCS_MIN_POS;
-  }
-  m_prevError = error;
-}
-
-void setup()
-{
-  Serial.begin(115200);
-  Serial.print("Starting...\n");  
-  pixy.init();
-  pixy.setServos(PIXY_RCS_CENTER_POS, PIXY_RCS_CENTER_POS);      
-}
-
-void loop()
-{ 
-  static int i = 0;
-  int j;
-  uint16_t blocks;
-  char buf[32]; 
-  int32_t panError, tiltError;
-  
-  blocks = pixy.getBlocks();
-  
-  if (blocks)
-  {
-    panError = X_CENTER-pixy.blocks[0].x;
-    tiltError = pixy.blocks[0].y-Y_CENTER;
-    
-    panLoop.update(panError);
-    tiltLoop.update(tiltError);
-    
-    pixy.setServos(panLoop.m_pos, tiltLoop.m_pos);
-    
-    i++;
-    
-    // do this (print) every 50 frames because printing every
-    // frame would bog down the Arduino
-    if (i%50==0) 
-    {
-      sprintf(buf, "Detected %d:\n", blocks);
-      Serial.print(buf);
-      for (j=0; j<blocks; j++)
-      {
-        sprintf(buf, "  block %d: ", j);
-        Serial.print(buf); 
-        pixy.blocks[j].print();
-        Serial.println("");
-      }
-    }
-  }
-    delay(10);
-}
Index: rtos_arduino/trunk/examples/PIXY/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/PIXY/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 0
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/PIXY_Wifi/Makefile
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Wifi/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/PIXY_Wifi/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 
@@ -35,7 +35,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -51,8 +51,8 @@
 APPL_DIR     += 
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT/
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT/
 APPL_CXXOBJS += ESP8266.o
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Pixy
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Pixy
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/PIXY_Wifi/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Wifi/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Wifi/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/PIXY_Wifi/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Wifi/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Wifi/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/PIXY_Wifi/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Wifi/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Wifi/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/PIXY_Wifi/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Wifi/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Wifi/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,6 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+INCLUDE("r2ca_lib.cfg");
+
Index: rtos_arduino/trunk/examples/PIXY_Wifi/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Wifi/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Wifi/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,251 @@
+#include "r2ca.h"
+#include "ESP8266.h"
+
+#include <SPI.h>  
+#include <Pixy.h>
+
+#include "../examples_gdef.h"
+
+#define WMODE_STATION
+
+extern void task1_setup();
+
+void setup()
+{
+    int ret;
+    
+    Serial.println("Echo Server : Start!");
+    ret = WiFi.begin(Serial5, 115200);
+
+    if(ret == 1) {
+        Serial.print("Cannot communicate with ESP8266.");
+        while(1);        
+    } else if(ret == 2) {
+        Serial.println("FW Version mismatch.");
+        Serial.print("FW Version:");
+        Serial.println(WiFi.getVersion().c_str());
+        Serial.print("Supported FW Version:");
+        Serial.print(ESP8266_SUPPORT_VERSION);
+        while(1);
+    } else {
+        Serial.print("begin ok\r\n");
+    }
+
+    Serial.print("FW Version:");
+    Serial.println(WiFi.getVersion().c_str());
+    
+#ifdef  WMODE_STATION
+    if (WiFi.setOprToStation()) {
+        Serial.print("to station ok\r\n");
+    } else {
+        Serial.print("to station err\r\n");
+    }
+    
+    if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
+        Serial.print("Join AP success\r\n");
+        Serial.print("IP: ");
+        Serial.println(WiFi.getLocalIP().c_str());    
+    } else {
+        Serial.print("Join AP failure\r\n");
+        while(1);
+    }
+#else /* !WMODE_STATION */ 
+    if (WiFi.setOprToSoftAP()) {
+        Serial.print("to softap ok\r\n");
+    } else {
+        Serial.print("to softap err\r\n");
+    }    
+    if(WiFi.setSoftAPParam(AP_SSID, AP_PASSWORD, 7, 0)){
+        Serial.print("Set SoftAP success\r\n");
+        Serial.print("IP: ");
+        Serial.println(WiFi.getLocalIP().c_str());            
+    }
+    else {
+        Serial.print("Set SoftAP failure\r\n");
+    }
+#endif /* WMODE_STATION */
+    
+    if (WiFi.enableMUX()) {
+        Serial.print("multiple ok\r\n");
+    } else {
+        Serial.print("multiple err\r\n");
+        while(1);
+    }
+
+    if (WiFi.startTCPServer(80)) {
+        Serial.print("start tcp server ok\r\n");
+    } else {
+        Serial.print("start tcp server err\r\n");
+        while(1);
+    }
+
+    if (WiFi.setTCPServerTimeout(60)) { 
+        Serial.print("set tcp server timout 60 seconds\r\n");
+    } else {
+        Serial.print("set tcp server timout err\r\n");
+        while(1);
+    }
+
+    Serial.print("setup end\r\n");
+
+    task1_setup();
+}
+
+#define MUX_NULL 0xff
+
+uint8_t mux_id_ptn;
+
+uint8_t mux_id = MUX_NULL;
+uint8_t task1_mux_id = MUX_NULL;
+
+
+uint16_t pixy_blocks = 0;
+char     pixy_buf[16][128]; 
+
+void loop()
+{
+    char buf[128]; 
+    uint8_t pre_mux_id_ptn;    
+
+    delay(1);    
+    /* Check Connection Status */
+    pre_mux_id_ptn = mux_id_ptn;
+
+    if(!WiFi.getMuxCStatus(&mux_id_ptn)) {
+        Serial.println("getMuxCStatus(&mux_id_ptn) : Error!");
+    }
+    else {        
+        if (pre_mux_id_ptn != mux_id_ptn) {
+            Serial.print("Connection Status changed! : 0x");
+            Serial.println(mux_id_ptn, HEX);
+            if (mux_id_ptn & 0x01) {
+                mux_id = 0; 
+            }
+            if (mux_id_ptn & 0x02) {
+                task1_mux_id = 1;
+            }
+        }
+    }
+
+    if (mux_id == MUX_NULL) {
+        return;
+    }
+    
+    if (!WiFi.isConnected(mux_id)) {
+        Serial.print("Echo Server : Port is closed: ");
+        Serial.println(mux_id);
+        mux_id = MUX_NULL;
+        return;
+    }
+
+    if(pixy_blocks != 0) {
+        sprintf(buf, "Detected %d:\n", pixy_blocks);
+        WiFi.send(mux_id, (uint8_t*)buf, strlen(buf));        
+        for (int j=0; j<pixy_blocks; j++){
+            WiFi.send(mux_id, (uint8_t*)pixy_buf[j], strlen(pixy_buf[j]));
+        }        
+        pixy_blocks = 0;
+    }        
+}
+
+Pixy pixy;
+
+#define X_CENTER        ((PIXY_MAX_X-PIXY_MIN_X)/2)       
+#define Y_CENTER        ((PIXY_MAX_Y-PIXY_MIN_Y)/2)
+
+class ServoLoop
+{
+public:
+  ServoLoop(int32_t pgain, int32_t dgain);
+
+  void update(int32_t error);
+   
+  int32_t m_pos;
+  int32_t m_prevError;
+  int32_t m_pgain;
+  int32_t m_dgain;
+};
+
+
+ServoLoop panLoop(300, 500);
+ServoLoop tiltLoop(500, 700);
+
+ServoLoop::ServoLoop(int32_t pgain, int32_t dgain)
+{
+  m_pos = PIXY_RCS_CENTER_POS;
+  m_pgain = pgain;
+  m_dgain = dgain;
+  m_prevError = 0x80000000L;
+}
+
+void ServoLoop::update(int32_t error)
+{
+  long int vel;
+  char buf[32];
+  if (m_prevError!=0x80000000)
+  {	
+    vel = (error*m_pgain + (error - m_prevError)*m_dgain)>>10;
+    //sprintf(buf, "%ld\n", vel);
+    //Serial.print(buf);
+    m_pos += vel;
+    if (m_pos>PIXY_RCS_MAX_POS) 
+      m_pos = PIXY_RCS_MAX_POS; 
+    else if (m_pos<PIXY_RCS_MIN_POS) 
+      m_pos = PIXY_RCS_MIN_POS;
+  }
+  m_prevError = error;
+}
+
+void task1_setup()
+{
+    Serial.print("PIXY Starting...\n");  
+    pixy.init();
+    pixy.setServos(PIXY_RCS_CENTER_POS, PIXY_RCS_CENTER_POS);
+}
+
+void loop1()
+{
+    static int i = 0;
+    int j;
+    uint16_t blocks;
+    char buf[128]; 
+    int32_t panError, tiltError;
+    
+    blocks = pixy.getBlocks();
+    
+    if (blocks) {
+        panError = X_CENTER-pixy.blocks[0].x;
+        tiltError = pixy.blocks[0].y-Y_CENTER;
+    
+        panLoop.update(panError);
+        tiltLoop.update(tiltError);
+
+        pixy.setServos(panLoop.m_pos, tiltLoop.m_pos);
+        i++;
+        
+        // do this (print) every 50 frames because printing every
+        // frame would bog down the Arduino
+        if (i%50==0) {
+            sprintf(buf, "Detected %d:\n", blocks);
+            Serial.print(buf);
+            for (j=0; j<blocks; j++){
+                sprintf(buf, "  block %d: ", j);
+                Serial.print(buf);                
+                pixy.blocks[j].print();
+            }
+            if(pixy_blocks == 0) {
+                if (blocks > 16) {
+                    blocks = 16;
+                }
+                pixy_blocks = blocks;
+                for (j=0; j<blocks; j++){
+                    sprintf(pixy_buf[j], "sig: %d x: %d y: %d width: %d height: %d\n",
+                            pixy.blocks[j].signature, pixy.blocks[j].x, pixy.blocks[j].y,
+                            pixy.blocks[j].width, pixy.blocks[j].height);
+                }
+            }
+        }
+    }
+   
+    delay(10);
+}
Index: rtos_arduino/trunk/examples/PIXY_Wifi/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Wifi/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Wifi/r2ca_app.h	(revision 260)
@@ -0,0 +1,9 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 1
+
+#define  R2CA_MAINTASK_LOOP_PRI  6
+#define  R2CA_TASK1_LOOP_PRI  5
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/PIXY_Wifi/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Wifi/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/PIXY_Wifi/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Wifi/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/PIXY_Wifi/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Wifi/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/PIXY_Wifi/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Wifi/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-INCLUDE("rca_lib.cfg");
-
Index: rtos_arduino/trunk/examples/PIXY_Wifi/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Wifi/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,254 +1,0 @@
-#include "rca.h"
-#include "ESP8266.h"
-
-#include <SPI.h>  
-#include <Pixy.h>
-
-#include "../examples_gdef.h"
-
-#define WMODE_STATION
-
-bool setup_done = false;
-
-void setup()
-{
-    int ret;
-    
-    Serial.println("Echo Server : Start!");
-    ret = WiFi.begin(Serial5, 115200);
-
-    if(ret == 1) {
-        Serial.print("Cannot communicate with ESP8266.");
-        while(1);        
-    } else if(ret == 2) {
-        Serial.println("FW Version mismatch.");
-        Serial.print("FW Version:");
-        Serial.println(WiFi.getVersion().c_str());
-        Serial.print("Supported FW Version:");
-        Serial.print(ESP8266_SUPPORT_VERSION);
-        while(1);
-    } else {
-        Serial.print("begin ok\r\n");
-    }
-
-    Serial.print("FW Version:");
-    Serial.println(WiFi.getVersion().c_str());
-    
-#ifdef  WMODE_STATION
-    if (WiFi.setOprToStation()) {
-        Serial.print("to station ok\r\n");
-    } else {
-        Serial.print("to station err\r\n");
-    }
-    
-    if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
-        Serial.print("Join AP success\r\n");
-        Serial.print("IP: ");
-        Serial.println(WiFi.getLocalIP().c_str());    
-    } else {
-        Serial.print("Join AP failure\r\n");
-        while(1);
-    }
-#else /* !WMODE_STATION */ 
-    if (WiFi.setOprToSoftAP()) {
-        Serial.print("to softap ok\r\n");
-    } else {
-        Serial.print("to softap err\r\n");
-    }    
-    if(WiFi.setSoftAPParam(AP_SSID, AP_PASSWORD, 7, 0)){
-        Serial.print("Set SoftAP success\r\n");
-        Serial.print("IP: ");
-        Serial.println(WiFi.getLocalIP().c_str());            
-    }
-    else {
-        Serial.print("Set SoftAP failure\r\n");
-    }
-#endif /* WMODE_STATION */
-    
-    if (WiFi.enableMUX()) {
-        Serial.print("multiple ok\r\n");
-    } else {
-        Serial.print("multiple err\r\n");
-        while(1);
-    }
-
-    if (WiFi.startTCPServer(80)) {
-        Serial.print("start tcp server ok\r\n");
-    } else {
-        Serial.print("start tcp server err\r\n");
-        while(1);
-    }
-
-    if (WiFi.setTCPServerTimeout(60)) { 
-        Serial.print("set tcp server timout 60 seconds\r\n");
-    } else {
-        Serial.print("set tcp server timout err\r\n");
-        while(1);
-    }
-
-    Serial.print("setup end\r\n");
-
-    setup_done = true;
-}
-
-#define MUX_NULL 0xff
-
-uint8_t mux_id_ptn;
-
-uint8_t mux_id = MUX_NULL;
-uint8_t task1_mux_id = MUX_NULL;
-
-
-uint16_t pixy_blocks = 0;
-char     pixy_buf[16][128]; 
-
-void loop()
-{
-    char buf[128]; 
-    uint8_t pre_mux_id_ptn;    
-
-    delay(1);    
-    /* Check Connection Status */
-    pre_mux_id_ptn = mux_id_ptn;
-
-    if(!WiFi.getMuxCStatus(&mux_id_ptn)) {
-        Serial.println("getMuxCStatus(&mux_id_ptn) : Error!");
-    }
-    else {        
-        if (pre_mux_id_ptn != mux_id_ptn) {
-            Serial.print("Connection Status changed! : 0x");
-            Serial.println(mux_id_ptn, HEX);
-            if (mux_id_ptn & 0x01) {
-                mux_id = 0; 
-            }
-            if (mux_id_ptn & 0x02) {
-                task1_mux_id = 1;
-            }
-        }
-    }
-
-    if (mux_id == MUX_NULL) {
-        return;
-    }
-    
-    if (!WiFi.isConnected(mux_id)) {
-        Serial.print("Echo Server : Port is closed: ");
-        Serial.println(mux_id);
-        mux_id = MUX_NULL;
-        return;
-    }
-
-    if(pixy_blocks != 0) {
-        sprintf(buf, "Detected %d:\n", pixy_blocks);
-        WiFi.send(mux_id, (uint8_t*)buf, strlen(buf));        
-        for (int j=0; j<pixy_blocks; j++){
-            WiFi.send(mux_id, (uint8_t*)pixy_buf[j], strlen(pixy_buf[j]));
-        }        
-        pixy_blocks = 0;
-    }        
-}
-
-Pixy pixy;
-
-#define X_CENTER        ((PIXY_MAX_X-PIXY_MIN_X)/2)       
-#define Y_CENTER        ((PIXY_MAX_Y-PIXY_MIN_Y)/2)
-
-class ServoLoop
-{
-public:
-  ServoLoop(int32_t pgain, int32_t dgain);
-
-  void update(int32_t error);
-   
-  int32_t m_pos;
-  int32_t m_prevError;
-  int32_t m_pgain;
-  int32_t m_dgain;
-};
-
-
-ServoLoop panLoop(300, 500);
-ServoLoop tiltLoop(500, 700);
-
-ServoLoop::ServoLoop(int32_t pgain, int32_t dgain)
-{
-  m_pos = PIXY_RCS_CENTER_POS;
-  m_pgain = pgain;
-  m_dgain = dgain;
-  m_prevError = 0x80000000L;
-}
-
-void ServoLoop::update(int32_t error)
-{
-  long int vel;
-  char buf[32];
-  if (m_prevError!=0x80000000)
-  {	
-    vel = (error*m_pgain + (error - m_prevError)*m_dgain)>>10;
-    //sprintf(buf, "%ld\n", vel);
-    //Serial.print(buf);
-    m_pos += vel;
-    if (m_pos>PIXY_RCS_MAX_POS) 
-      m_pos = PIXY_RCS_MAX_POS; 
-    else if (m_pos<PIXY_RCS_MIN_POS) 
-      m_pos = PIXY_RCS_MIN_POS;
-  }
-  m_prevError = error;
-}
-
-void task1_setup()
-{
-//    while(!setup_done) {
-//        delay(1);
-//    }    
-    Serial.print("PIXY Starting...\n");  
-    pixy.init();
-    pixy.setServos(PIXY_RCS_CENTER_POS, PIXY_RCS_CENTER_POS);
-}
-
-void task1_loop()
-{
-    static int i = 0;
-    int j;
-    uint16_t blocks;
-    char buf[128]; 
-    int32_t panError, tiltError;
-    
-    blocks = pixy.getBlocks();
-    
-    if (blocks) {
-        panError = X_CENTER-pixy.blocks[0].x;
-        tiltError = pixy.blocks[0].y-Y_CENTER;
-    
-        panLoop.update(panError);
-        tiltLoop.update(tiltError);
-
-        pixy.setServos(panLoop.m_pos, tiltLoop.m_pos);
-        i++;
-        
-        // do this (print) every 50 frames because printing every
-        // frame would bog down the Arduino
-        if (i%50==0) {
-            sprintf(buf, "Detected %d:\n", blocks);
-            Serial.print(buf);
-            for (j=0; j<blocks; j++){
-                sprintf(buf, "  block %d: ", j);
-                Serial.print(buf);                
-                pixy.blocks[j].print();
-            }
-            if(pixy_blocks == 0) {
-                if (blocks > 16) {
-                    blocks = 16;
-                }
-                pixy_blocks = blocks;
-                for (j=0; j<blocks; j++){
-                    sprintf(pixy_buf[j], "sig: %d x: %d y: %d width: %d height: %d\n",
-                            pixy.blocks[j].signature, pixy.blocks[j].x, pixy.blocks[j].y,
-                            pixy.blocks[j].width, pixy.blocks[j].height);
-                }
-            }
-        }
-    }
-   
-    delay(10);
-}
Index: rtos_arduino/trunk/examples/PIXY_Wifi/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Wifi/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,9 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 1
-
-#define  RCA_MAINTASK_LOOP_PRI  6
-#define  RCA_TASK1_LOOP_PRI  5
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/PIXY_Zumo/Makefile
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/PIXY_Zumo/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg 
+APPL_CFG      = r2ca_app.cfg 
 
 #
@@ -37,7 +37,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -56,5 +56,5 @@
 #  Zumo Library
 # 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ZumoShield
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/ZumoShield
 APPL_CXXOBJS += Accelerometer.o L3G.o LSM303.o Pushbutton.o QTRSensors.o ZumoBuzzer.o ZumoMotors.o
 APPL_CFG     += ZumoShield.cfg
@@ -63,5 +63,5 @@
 #  Pixy Library
 #
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Pixy
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Pixy
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,169 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents />
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.222</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo/r2ca.cproj	(revision 260)
@@ -0,0 +1,168 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,9 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("r2ca_lib.cfg");
+INCLUDE("ZumoShield.cfg");
Index: rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,249 @@
+#include "r2ca.h"
+#include <Wire.h>
+#include <ZumoShield.h>
+
+#include <SPI.h>  
+#include <Pixy.h>
+
+//==========================================================================
+//
+//  Pixy Pet Robot
+//
+//   Adafruit invests time and resources providing this open source code, 
+//  please support Adafruit and open-source hardware by purchasing 
+//  products from Adafruit!
+//
+// Written by: Bill Earl for Adafruit Industries
+//
+//==========================================================================
+// begin license header
+//
+// All Pixy Pet source code is provided under the terms of the
+// GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html).
+//
+// end license header
+//
+//==========================================================================
+//
+// Portions of this code are derived from the Pixy CMUcam5 pantilt example code. 
+//
+//==========================================================================
+ 
+#define X_CENTER    160L
+#define Y_CENTER    100L
+#define RCS_MIN_POS     0L
+#define RCS_MAX_POS     1000L
+#define RCS_CENTER_POS	((RCS_MAX_POS-RCS_MIN_POS)/2)
+ 
+//---------------------------------------
+// Servo Loop Class
+// A Proportional/Derivative feedback
+// loop for pan/tilt servo tracking of
+// blocks.
+// (Based on Pixy CMUcam5 example code)
+//---------------------------------------
+class ServoLoop
+{
+public:
+	ServoLoop(int32_t proportionalGain, int32_t derivativeGain);
+ 
+	void update(int32_t error);
+ 
+	int32_t m_pos;
+	int32_t m_prevError;
+	int32_t m_proportionalGain;
+	int32_t m_derivativeGain;
+};
+ 
+// ServoLoop Constructor
+ServoLoop::ServoLoop(int32_t proportionalGain, int32_t derivativeGain)
+{
+	m_pos = RCS_CENTER_POS;
+	m_proportionalGain = proportionalGain;
+	m_derivativeGain = derivativeGain;
+	m_prevError = 0x80000000L;
+}
+ 
+// ServoLoop Update 
+// Calculates new output based on the measured
+// error and the current state.
+void ServoLoop::update(int32_t error)
+{
+	long int velocity;
+	char buf[32];
+	if (m_prevError!=0x80000000)
+	{	
+		velocity = (error*m_proportionalGain + (error - m_prevError)*m_derivativeGain)>>10;
+ 
+		m_pos += velocity;
+		if (m_pos>RCS_MAX_POS) 
+		{
+			m_pos = RCS_MAX_POS; 
+		}
+		else if (m_pos<RCS_MIN_POS) 
+		{
+			m_pos = RCS_MIN_POS;
+		}
+	}
+	m_prevError = error;
+}
+// End Servo Loop Class
+//---------------------------------------
+ 
+Pixy pixy;  // Declare the camera object
+ 
+ServoLoop panLoop(200, 200);  // Servo loop for pan
+ServoLoop tiltLoop(150, 200); // Servo loop for tilt
+ 
+void ScanForBlocks();
+void FollowBlock(int trackedBlock);
+int TrackBlock(int blockCount);
+
+//---------------------------------------
+// Setup - runs once at startup
+//---------------------------------------
+void setup()
+{
+	ZumoInit();
+	buzzer.playOn();    
+	Serial.begin(115200);
+	Serial.print("Starting...\n");
+	pixy.init();
+
+    button.waitForPress();
+    buzzer.playStart();    
+}
+ 
+uint32_t lastBlockTime = 0;
+ 
+//---------------------------------------
+// Main loop - runs continuously after setup
+//---------------------------------------
+void loop()
+{ 
+	uint16_t blocks;
+	blocks = pixy.getBlocks();
+ 
+	// If we have blocks in sight, track and follow them
+	if (blocks)
+	{
+		int trackedBlock = TrackBlock(blocks);
+		FollowBlock(trackedBlock);
+		lastBlockTime = millis();
+	}  
+	else if (millis() - lastBlockTime > 100)
+	{
+		motors.setLeftSpeed(0);
+		motors.setRightSpeed(0);
+		ScanForBlocks();
+	}
+}
+ 
+int oldX, oldY, oldSignature;
+ 
+//---------------------------------------
+// Track blocks via the Pixy pan/tilt mech
+// (based in part on Pixy CMUcam5 pantilt example)
+//---------------------------------------
+int TrackBlock(int blockCount)
+{
+	int trackedBlock = 0;
+	long maxSize = 0;
+ 
+	Serial.print("blocks =");
+	Serial.println(blockCount);
+ 
+	for (int i = 0; i < blockCount; i++)
+	{
+		if ((oldSignature == 0) || (pixy.blocks[i].signature == oldSignature))
+		{
+			long newSize = pixy.blocks[i].height * pixy.blocks[i].width;
+			if (newSize > maxSize)
+			{
+				trackedBlock = i;
+				maxSize = newSize;
+			}
+		}
+	}
+ 
+	int32_t panError = X_CENTER - pixy.blocks[trackedBlock].x;
+	int32_t tiltError = pixy.blocks[trackedBlock].y - Y_CENTER;
+ 
+	panLoop.update(panError);
+	tiltLoop.update(tiltError);
+ 
+	pixy.setServos(panLoop.m_pos, tiltLoop.m_pos);
+ 
+	oldX = pixy.blocks[trackedBlock].x;
+	oldY = pixy.blocks[trackedBlock].y;
+	oldSignature = pixy.blocks[trackedBlock].signature;
+	return trackedBlock;
+}
+ 
+//---------------------------------------
+// Follow blocks via the Zumo robot drive
+//
+// This code makes the robot base turn 
+// and move to follow the pan/tilt tracking
+// of the head.
+//---------------------------------------
+int32_t size = 400;
+void FollowBlock(int trackedBlock)
+{
+	int32_t followError = RCS_CENTER_POS - panLoop.m_pos;  // How far off-center are we looking now?
+ 
+	// Size is the area of the object.
+	// We keep a running average of the last 8.
+	size += pixy.blocks[trackedBlock].width * pixy.blocks[trackedBlock].height; 
+	size -= size >> 3;
+ 
+	// Forward speed decreases as we approach the object (size is larger)
+	int forwardSpeed = constrain(400 - (size/256), -100, 400);  
+ 
+	// Steering differential is proportional to the error times the forward speed
+	int32_t differential = (followError + (followError * forwardSpeed))>>8;
+ 
+	// Adjust the left and right speeds by the steering differential.
+	int leftSpeed = constrain(forwardSpeed + differential, -400, 400);
+	int rightSpeed = constrain(forwardSpeed - differential, -400, 400);
+ 
+	// And set the motor speeds
+	motors.setLeftSpeed(leftSpeed);
+	motors.setRightSpeed(rightSpeed);
+}
+ 
+//---------------------------------------
+// Random search for blocks
+//
+// This code pans back and forth at random
+// until a block is detected
+//---------------------------------------
+int scanIncrement = (RCS_MAX_POS - RCS_MIN_POS) / 150;
+uint32_t lastMove = 0;
+ 
+void ScanForBlocks()
+{
+	if (millis() - lastMove > 20)
+	{
+		lastMove = millis();
+		panLoop.m_pos += scanIncrement;
+		if ((panLoop.m_pos >= RCS_MAX_POS)||(panLoop.m_pos <= RCS_MIN_POS))
+		{
+			tiltLoop.m_pos = random(RCS_MAX_POS * 0.6, RCS_MAX_POS);
+			scanIncrement = -scanIncrement;
+			if (scanIncrement < 0)
+			{
+				motors.setLeftSpeed(-250);
+				motors.setRightSpeed(250);
+			}
+			else
+			{
+				motors.setLeftSpeed(+180);
+				motors.setRightSpeed(-180);
+			}
+			delay(random(250, 500));
+		}
+ 
+		pixy.setServos(panLoop.m_pos, tiltLoop.m_pos);
+	}
+}
Index: rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo/r2ca_app.h	(revision 260)
@@ -0,0 +1,6 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 0
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/PIXY_Zumo/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/PIXY_Zumo/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/PIXY_Zumo/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/PIXY_Zumo/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,9 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-/*
- *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
- */
-INCLUDE("rca_lib.cfg");
-INCLUDE("ZumoShield.cfg");
Index: rtos_arduino/trunk/examples/PIXY_Zumo/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,249 +1,0 @@
-#include "rca.h"
-#include <Wire.h>
-#include <ZumoShield.h>
-
-#include <SPI.h>  
-#include <Pixy.h>
-
-//==========================================================================
-//
-//  Pixy Pet Robot
-//
-//   Adafruit invests time and resources providing this open source code, 
-//  please support Adafruit and open-source hardware by purchasing 
-//  products from Adafruit!
-//
-// Written by: Bill Earl for Adafruit Industries
-//
-//==========================================================================
-// begin license header
-//
-// All Pixy Pet source code is provided under the terms of the
-// GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html).
-//
-// end license header
-//
-//==========================================================================
-//
-// Portions of this code are derived from the Pixy CMUcam5 pantilt example code. 
-//
-//==========================================================================
- 
-#define X_CENTER    160L
-#define Y_CENTER    100L
-#define RCS_MIN_POS     0L
-#define RCS_MAX_POS     1000L
-#define RCS_CENTER_POS	((RCS_MAX_POS-RCS_MIN_POS)/2)
- 
-//---------------------------------------
-// Servo Loop Class
-// A Proportional/Derivative feedback
-// loop for pan/tilt servo tracking of
-// blocks.
-// (Based on Pixy CMUcam5 example code)
-//---------------------------------------
-class ServoLoop
-{
-public:
-	ServoLoop(int32_t proportionalGain, int32_t derivativeGain);
- 
-	void update(int32_t error);
- 
-	int32_t m_pos;
-	int32_t m_prevError;
-	int32_t m_proportionalGain;
-	int32_t m_derivativeGain;
-};
- 
-// ServoLoop Constructor
-ServoLoop::ServoLoop(int32_t proportionalGain, int32_t derivativeGain)
-{
-	m_pos = RCS_CENTER_POS;
-	m_proportionalGain = proportionalGain;
-	m_derivativeGain = derivativeGain;
-	m_prevError = 0x80000000L;
-}
- 
-// ServoLoop Update 
-// Calculates new output based on the measured
-// error and the current state.
-void ServoLoop::update(int32_t error)
-{
-	long int velocity;
-	char buf[32];
-	if (m_prevError!=0x80000000)
-	{	
-		velocity = (error*m_proportionalGain + (error - m_prevError)*m_derivativeGain)>>10;
- 
-		m_pos += velocity;
-		if (m_pos>RCS_MAX_POS) 
-		{
-			m_pos = RCS_MAX_POS; 
-		}
-		else if (m_pos<RCS_MIN_POS) 
-		{
-			m_pos = RCS_MIN_POS;
-		}
-	}
-	m_prevError = error;
-}
-// End Servo Loop Class
-//---------------------------------------
- 
-Pixy pixy;  // Declare the camera object
- 
-ServoLoop panLoop(200, 200);  // Servo loop for pan
-ServoLoop tiltLoop(150, 200); // Servo loop for tilt
- 
-void ScanForBlocks();
-void FollowBlock(int trackedBlock);
-int TrackBlock(int blockCount);
-
-//---------------------------------------
-// Setup - runs once at startup
-//---------------------------------------
-void setup()
-{
-	ZumoInit();
-	buzzer.playOn();    
-	Serial.begin(115200);
-	Serial.print("Starting...\n");
-	pixy.init();
-
-    button.waitForPress();
-    buzzer.playStart();    
-}
- 
-uint32_t lastBlockTime = 0;
- 
-//---------------------------------------
-// Main loop - runs continuously after setup
-//---------------------------------------
-void loop()
-{ 
-	uint16_t blocks;
-	blocks = pixy.getBlocks();
- 
-	// If we have blocks in sight, track and follow them
-	if (blocks)
-	{
-		int trackedBlock = TrackBlock(blocks);
-		FollowBlock(trackedBlock);
-		lastBlockTime = millis();
-	}  
-	else if (millis() - lastBlockTime > 100)
-	{
-		motors.setLeftSpeed(0);
-		motors.setRightSpeed(0);
-		ScanForBlocks();
-	}
-}
- 
-int oldX, oldY, oldSignature;
- 
-//---------------------------------------
-// Track blocks via the Pixy pan/tilt mech
-// (based in part on Pixy CMUcam5 pantilt example)
-//---------------------------------------
-int TrackBlock(int blockCount)
-{
-	int trackedBlock = 0;
-	long maxSize = 0;
- 
-	Serial.print("blocks =");
-	Serial.println(blockCount);
- 
-	for (int i = 0; i < blockCount; i++)
-	{
-		if ((oldSignature == 0) || (pixy.blocks[i].signature == oldSignature))
-		{
-			long newSize = pixy.blocks[i].height * pixy.blocks[i].width;
-			if (newSize > maxSize)
-			{
-				trackedBlock = i;
-				maxSize = newSize;
-			}
-		}
-	}
- 
-	int32_t panError = X_CENTER - pixy.blocks[trackedBlock].x;
-	int32_t tiltError = pixy.blocks[trackedBlock].y - Y_CENTER;
- 
-	panLoop.update(panError);
-	tiltLoop.update(tiltError);
- 
-	pixy.setServos(panLoop.m_pos, tiltLoop.m_pos);
- 
-	oldX = pixy.blocks[trackedBlock].x;
-	oldY = pixy.blocks[trackedBlock].y;
-	oldSignature = pixy.blocks[trackedBlock].signature;
-	return trackedBlock;
-}
- 
-//---------------------------------------
-// Follow blocks via the Zumo robot drive
-//
-// This code makes the robot base turn 
-// and move to follow the pan/tilt tracking
-// of the head.
-//---------------------------------------
-int32_t size = 400;
-void FollowBlock(int trackedBlock)
-{
-	int32_t followError = RCS_CENTER_POS - panLoop.m_pos;  // How far off-center are we looking now?
- 
-	// Size is the area of the object.
-	// We keep a running average of the last 8.
-	size += pixy.blocks[trackedBlock].width * pixy.blocks[trackedBlock].height; 
-	size -= size >> 3;
- 
-	// Forward speed decreases as we approach the object (size is larger)
-	int forwardSpeed = constrain(400 - (size/256), -100, 400);  
- 
-	// Steering differential is proportional to the error times the forward speed
-	int32_t differential = (followError + (followError * forwardSpeed))>>8;
- 
-	// Adjust the left and right speeds by the steering differential.
-	int leftSpeed = constrain(forwardSpeed + differential, -400, 400);
-	int rightSpeed = constrain(forwardSpeed - differential, -400, 400);
- 
-	// And set the motor speeds
-	motors.setLeftSpeed(leftSpeed);
-	motors.setRightSpeed(rightSpeed);
-}
- 
-//---------------------------------------
-// Random search for blocks
-//
-// This code pans back and forth at random
-// until a block is detected
-//---------------------------------------
-int scanIncrement = (RCS_MAX_POS - RCS_MIN_POS) / 150;
-uint32_t lastMove = 0;
- 
-void ScanForBlocks()
-{
-	if (millis() - lastMove > 20)
-	{
-		lastMove = millis();
-		panLoop.m_pos += scanIncrement;
-		if ((panLoop.m_pos >= RCS_MAX_POS)||(panLoop.m_pos <= RCS_MIN_POS))
-		{
-			tiltLoop.m_pos = random(RCS_MAX_POS * 0.6, RCS_MAX_POS);
-			scanIncrement = -scanIncrement;
-			if (scanIncrement < 0)
-			{
-				motors.setLeftSpeed(-250);
-				motors.setRightSpeed(250);
-			}
-			else
-			{
-				motors.setLeftSpeed(+180);
-				motors.setRightSpeed(-180);
-			}
-			delay(random(250, 500));
-		}
- 
-		pixy.setServos(panLoop.m_pos, tiltLoop.m_pos);
-	}
-}
Index: rtos_arduino/trunk/examples/PIXY_Zumo/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 0
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/Makefile
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg 
+APPL_CFG      = r2ca_app.cfg 
 
 #
@@ -37,7 +37,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -56,5 +56,5 @@
 #  Zumo Library
 # 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ZumoShield
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/ZumoShield
 APPL_CXXOBJS += Accelerometer.o L3G.o LSM303.o Pushbutton.o QTRSensors.o ZumoBuzzer.o ZumoMotors.o
 APPL_CFG     += ZumoShield.cfg
@@ -63,11 +63,11 @@
 #  Pixy Library
 #
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Pixy
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Pixy
 
 #
 #  Wifi Library
 #
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT/
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT/
 APPL_CXXOBJS += ESP8266.o
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,169 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents />
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.222</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca.cproj	(revision 260)
@@ -0,0 +1,168 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,9 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("r2ca_lib.cfg");
+INCLUDE("ZumoShield.cfg");
Index: rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,405 @@
+#include "r2ca.h"
+#include "ESP8266.h"
+
+#include <Wire.h>
+#include <ZumoShield.h>
+
+#include <SPI.h>  
+#include <Pixy.h>
+
+#include "../examples_gdef.h"
+
+#define WMODE_STATION
+
+uint16_t pixy_blocks = 0;
+char     pixy_buf[16][128]; 
+
+//==========================================================================
+//
+//  Pixy Pet Robot
+//
+//   Adafruit invests time and resources providing this open source code, 
+//  please support Adafruit and open-source hardware by purchasing 
+//  products from Adafruit!
+//
+// Written by: Bill Earl for Adafruit Industries
+//
+//==========================================================================
+// begin license header
+//
+// All Pixy Pet source code is provided under the terms of the
+// GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html).
+//
+// end license header
+//
+//==========================================================================
+//
+// Portions of this code are derived from the Pixy CMUcam5 pantilt example code. 
+//
+//==========================================================================
+ 
+#define X_CENTER    160L
+#define Y_CENTER    100L
+#define RCS_MIN_POS     0L
+#define RCS_MAX_POS     1000L
+#define RCS_CENTER_POS	((RCS_MAX_POS-RCS_MIN_POS)/2)
+ 
+//---------------------------------------
+// Servo Loop Class
+// A Proportional/Derivative feedback
+// loop for pan/tilt servo tracking of
+// blocks.
+// (Based on Pixy CMUcam5 example code)
+//---------------------------------------
+class ServoLoop
+{
+public:
+	ServoLoop(int32_t proportionalGain, int32_t derivativeGain);
+ 
+	void update(int32_t error);
+ 
+	int32_t m_pos;
+	int32_t m_prevError;
+	int32_t m_proportionalGain;
+	int32_t m_derivativeGain;
+};
+ 
+// ServoLoop Constructor
+ServoLoop::ServoLoop(int32_t proportionalGain, int32_t derivativeGain)
+{
+	m_pos = RCS_CENTER_POS;
+	m_proportionalGain = proportionalGain;
+	m_derivativeGain = derivativeGain;
+	m_prevError = 0x80000000L;
+}
+ 
+// ServoLoop Update 
+// Calculates new output based on the measured
+// error and the current state.
+void ServoLoop::update(int32_t error)
+{
+	long int velocity;
+	char buf[32];
+	if (m_prevError!=0x80000000)
+	{	
+		velocity = (error*m_proportionalGain + (error - m_prevError)*m_derivativeGain)>>10;
+ 
+		m_pos += velocity;
+		if (m_pos>RCS_MAX_POS) 
+		{
+			m_pos = RCS_MAX_POS; 
+		}
+		else if (m_pos<RCS_MIN_POS) 
+		{
+			m_pos = RCS_MIN_POS;
+		}
+	}
+	m_prevError = error;
+}
+// End Servo Loop Class
+//---------------------------------------
+ 
+Pixy pixy;  // Declare the camera object
+ 
+ServoLoop panLoop(200, 200);  // Servo loop for pan
+ServoLoop tiltLoop(150, 200); // Servo loop for tilt
+ 
+void ScanForBlocks();
+void FollowBlock(int trackedBlock);
+int TrackBlock(int blockCount);
+void task1_setup();
+
+//---------------------------------------
+// Setup - runs once at startup
+//---------------------------------------
+void setup()
+{
+	ZumoInit();
+	buzzer.playOn();    
+	Serial.begin(115200);
+	Serial.print("Starting...\n");
+	pixy.init();
+
+    button.waitForPress();
+    buzzer.playStart();
+
+	task1_setup();
+}
+ 
+uint32_t lastBlockTime = 0;
+ 
+//---------------------------------------
+// Main loop - runs continuously after setup
+//---------------------------------------
+void loop()
+{ 
+	uint16_t blocks;
+	blocks = pixy.getBlocks();
+    
+	// If we have blocks in sight, track and follow them
+	if (blocks)
+	{
+		int trackedBlock = TrackBlock(blocks);
+		FollowBlock(trackedBlock);
+		lastBlockTime = millis();
+        if(pixy_blocks == 0) {
+            if (blocks > 16) {
+                blocks = 16;
+            }
+            pixy_blocks = blocks;
+            for (int j=0; j<blocks; j++){
+                sprintf(pixy_buf[j], "sig: %d x: %d y: %d width: %d height: %d\n",
+                        pixy.blocks[j].signature, pixy.blocks[j].x, pixy.blocks[j].y,
+                        pixy.blocks[j].width, pixy.blocks[j].height);
+            }
+        }
+        delay(1);
+	}  
+	else if (millis() - lastBlockTime > 100)
+	{
+		motors.setLeftSpeed(0);
+		motors.setRightSpeed(0);
+		ScanForBlocks();
+	}
+}
+ 
+int oldX, oldY, oldSignature;
+ 
+//---------------------------------------
+// Track blocks via the Pixy pan/tilt mech
+// (based in part on Pixy CMUcam5 pantilt example)
+//---------------------------------------
+int TrackBlock(int blockCount)
+{
+	int trackedBlock = 0;
+	long maxSize = 0;
+ 
+	Serial.print("blocks =");
+	Serial.println(blockCount);
+ 
+	for (int i = 0; i < blockCount; i++)
+	{
+		if ((oldSignature == 0) || (pixy.blocks[i].signature == oldSignature))
+		{
+			long newSize = pixy.blocks[i].height * pixy.blocks[i].width;
+			if (newSize > maxSize)
+			{
+				trackedBlock = i;
+				maxSize = newSize;
+			}
+		}
+	}
+ 
+	int32_t panError = X_CENTER - pixy.blocks[trackedBlock].x;
+	int32_t tiltError = pixy.blocks[trackedBlock].y - Y_CENTER;
+ 
+	panLoop.update(panError);
+	tiltLoop.update(tiltError);
+ 
+	pixy.setServos(panLoop.m_pos, tiltLoop.m_pos);
+ 
+	oldX = pixy.blocks[trackedBlock].x;
+	oldY = pixy.blocks[trackedBlock].y;
+	oldSignature = pixy.blocks[trackedBlock].signature;
+	return trackedBlock;
+}
+ 
+//---------------------------------------
+// Follow blocks via the Zumo robot drive
+//
+// This code makes the robot base turn 
+// and move to follow the pan/tilt tracking
+// of the head.
+//---------------------------------------
+int32_t size = 400;
+void FollowBlock(int trackedBlock)
+{
+	int32_t followError = RCS_CENTER_POS - panLoop.m_pos;  // How far off-center are we looking now?
+ 
+	// Size is the area of the object.
+	// We keep a running average of the last 8.
+	size += pixy.blocks[trackedBlock].width * pixy.blocks[trackedBlock].height; 
+	size -= size >> 3;
+ 
+	// Forward speed decreases as we approach the object (size is larger)
+	int forwardSpeed = constrain(400 - (size/256), -100, 400);  
+ 
+	// Steering differential is proportional to the error times the forward speed
+	int32_t differential = (followError + (followError * forwardSpeed))>>8;
+ 
+	// Adjust the left and right speeds by the steering differential.
+	int leftSpeed = constrain(forwardSpeed + differential, -400, 400);
+	int rightSpeed = constrain(forwardSpeed - differential, -400, 400);
+ 
+	// And set the motor speeds
+	motors.setLeftSpeed(leftSpeed);
+	motors.setRightSpeed(rightSpeed);
+}
+ 
+//---------------------------------------
+// Random search for blocks
+//
+// This code pans back and forth at random
+// until a block is detected
+//---------------------------------------
+int scanIncrement = (RCS_MAX_POS - RCS_MIN_POS) / 150;
+uint32_t lastMove = 0;
+ 
+void ScanForBlocks()
+{
+	if (millis() - lastMove > 20)
+	{
+		lastMove = millis();
+		panLoop.m_pos += scanIncrement;
+		if ((panLoop.m_pos >= RCS_MAX_POS)||(panLoop.m_pos <= RCS_MIN_POS))
+		{
+			tiltLoop.m_pos = random(RCS_MAX_POS * 0.6, RCS_MAX_POS);
+			scanIncrement = -scanIncrement;
+			if (scanIncrement < 0)
+			{
+				motors.setLeftSpeed(-250);
+				motors.setRightSpeed(250);
+			}
+			else
+			{
+				motors.setLeftSpeed(+180);
+				motors.setRightSpeed(-180);
+			}
+			delay(random(250, 500));
+		}
+ 
+		pixy.setServos(panLoop.m_pos, tiltLoop.m_pos);
+	}
+}
+
+
+void task1_setup()
+{
+    int ret;
+    
+    Serial.println("Echo Server : Start!");
+    ret = WiFi.begin(Serial5, 115200);
+
+    if(ret == 1) {
+        Serial.print("Cannot communicate with ESP8266.");
+        while(1);        
+    } else if(ret == 2) {
+        Serial.println("FW Version mismatch.");
+        Serial.print("FW Version:");
+        Serial.println(WiFi.getVersion().c_str());
+        Serial.print("Supported FW Version:");
+        Serial.print(ESP8266_SUPPORT_VERSION);
+        while(1);
+    } else {
+        Serial.print("begin ok\r\n");
+    }
+
+    Serial.print("FW Version:");
+    Serial.println(WiFi.getVersion().c_str());
+    
+#ifdef  WMODE_STATION
+    if (WiFi.setOprToStation()) {
+        Serial.print("to station ok\r\n");
+    } else {
+        Serial.print("to station err\r\n");
+    }
+    
+    if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
+        Serial.print("Join AP success\r\n");
+        Serial.print("IP: ");
+        Serial.println(WiFi.getLocalIP().c_str());    
+    } else {
+        Serial.print("Join AP failure\r\n");
+        while(1);
+    }
+#else /* !WMODE_STATION */ 
+    if (WiFi.setOprToSoftAP()) {
+        Serial.print("to softap ok\r\n");
+    } else {
+        Serial.print("to softap err\r\n");
+    }    
+    if(WiFi.setSoftAPParam(AP_SSID, AP_PASSWORD, 7, 0)){
+        Serial.print("Set SoftAP success\r\n");
+        Serial.print("IP: ");
+        Serial.println(WiFi.getLocalIP().c_str());            
+    }
+    else {
+        Serial.print("Set SoftAP failure\r\n");
+    }
+#endif /* WMODE_STATION */
+    
+    if (WiFi.enableMUX()) {
+        Serial.print("multiple ok\r\n");
+    } else {
+        Serial.print("multiple err\r\n");
+        while(1);
+    }
+
+    if (WiFi.startTCPServer(80)) {
+        Serial.print("start tcp server ok\r\n");
+    } else {
+        Serial.print("start tcp server err\r\n");
+        while(1);
+    }
+
+    if (WiFi.setTCPServerTimeout(60)) { 
+        Serial.print("set tcp server timout 60 seconds\r\n");
+    } else {
+        Serial.print("set tcp server timout err\r\n");
+        while(1);
+    }
+
+    Serial.print("setup end\r\n");
+}
+
+#define MUX_NULL 0xff
+
+uint8_t mux_id_ptn;
+
+uint8_t mux_id = MUX_NULL;
+uint8_t task1_mux_id = MUX_NULL;
+
+void loop1()
+{
+    char buf[128]; 
+    uint8_t pre_mux_id_ptn;    
+
+    /* Check Connection Status */
+    pre_mux_id_ptn = mux_id_ptn;
+
+    if(!WiFi.getMuxCStatus(&mux_id_ptn)) {
+        Serial.println("getMuxCStatus(&mux_id_ptn) : Error!");
+    }
+    else {        
+        if (pre_mux_id_ptn != mux_id_ptn) {
+            Serial.print("Connection Status changed! : 0x");
+            Serial.println(mux_id_ptn, HEX);
+            if (mux_id_ptn & 0x01) {
+                mux_id = 0; 
+            }
+            if (mux_id_ptn & 0x02) {
+                task1_mux_id = 1;
+            }
+        }
+    }
+
+    if (mux_id == MUX_NULL) {
+        return;
+    }
+    
+    if (!WiFi.isConnected(mux_id)) {
+        Serial.print("Echo Server : Port is closed: ");
+        Serial.println(mux_id);
+        mux_id = MUX_NULL;
+        return;
+    }
+
+    if(pixy_blocks != 0) {
+        sprintf(buf, "Detected %d:\n", pixy_blocks);
+        WiFi.send(mux_id, (uint8_t*)buf, strlen(buf));        
+        for (int j=0; j<pixy_blocks; j++){
+            WiFi.send(mux_id, (uint8_t*)pixy_buf[j], strlen(pixy_buf[j]));
+        }        
+        pixy_blocks = 0;
+    }        
+}
Index: rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/r2ca_app.h	(revision 260)
@@ -0,0 +1,9 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 1
+
+#define  R2CA_MAINTASK_LOOP_PRI  5
+#define  R2CA_TASK1_LOOP_PRI  6
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,9 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-/*
- *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
- */
-INCLUDE("rca_lib.cfg");
-INCLUDE("ZumoShield.cfg");
Index: rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,406 +1,0 @@
-#include "rca.h"
-#include "ESP8266.h"
-
-#include <Wire.h>
-#include <ZumoShield.h>
-
-#include <SPI.h>  
-#include <Pixy.h>
-
-#include "../examples_gdef.h"
-
-#define WMODE_STATION
-
-uint16_t pixy_blocks = 0;
-char     pixy_buf[16][128]; 
-
-//==========================================================================
-//
-//  Pixy Pet Robot
-//
-//   Adafruit invests time and resources providing this open source code, 
-//  please support Adafruit and open-source hardware by purchasing 
-//  products from Adafruit!
-//
-// Written by: Bill Earl for Adafruit Industries
-//
-//==========================================================================
-// begin license header
-//
-// All Pixy Pet source code is provided under the terms of the
-// GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html).
-//
-// end license header
-//
-//==========================================================================
-//
-// Portions of this code are derived from the Pixy CMUcam5 pantilt example code. 
-//
-//==========================================================================
- 
-#define X_CENTER    160L
-#define Y_CENTER    100L
-#define RCS_MIN_POS     0L
-#define RCS_MAX_POS     1000L
-#define RCS_CENTER_POS	((RCS_MAX_POS-RCS_MIN_POS)/2)
- 
-//---------------------------------------
-// Servo Loop Class
-// A Proportional/Derivative feedback
-// loop for pan/tilt servo tracking of
-// blocks.
-// (Based on Pixy CMUcam5 example code)
-//---------------------------------------
-class ServoLoop
-{
-public:
-	ServoLoop(int32_t proportionalGain, int32_t derivativeGain);
- 
-	void update(int32_t error);
- 
-	int32_t m_pos;
-	int32_t m_prevError;
-	int32_t m_proportionalGain;
-	int32_t m_derivativeGain;
-};
- 
-// ServoLoop Constructor
-ServoLoop::ServoLoop(int32_t proportionalGain, int32_t derivativeGain)
-{
-	m_pos = RCS_CENTER_POS;
-	m_proportionalGain = proportionalGain;
-	m_derivativeGain = derivativeGain;
-	m_prevError = 0x80000000L;
-}
- 
-// ServoLoop Update 
-// Calculates new output based on the measured
-// error and the current state.
-void ServoLoop::update(int32_t error)
-{
-	long int velocity;
-	char buf[32];
-	if (m_prevError!=0x80000000)
-	{	
-		velocity = (error*m_proportionalGain + (error - m_prevError)*m_derivativeGain)>>10;
- 
-		m_pos += velocity;
-		if (m_pos>RCS_MAX_POS) 
-		{
-			m_pos = RCS_MAX_POS; 
-		}
-		else if (m_pos<RCS_MIN_POS) 
-		{
-			m_pos = RCS_MIN_POS;
-		}
-	}
-	m_prevError = error;
-}
-// End Servo Loop Class
-//---------------------------------------
- 
-Pixy pixy;  // Declare the camera object
- 
-ServoLoop panLoop(200, 200);  // Servo loop for pan
-ServoLoop tiltLoop(150, 200); // Servo loop for tilt
- 
-void ScanForBlocks();
-void FollowBlock(int trackedBlock);
-int TrackBlock(int blockCount);
-
-//---------------------------------------
-// Setup - runs once at startup
-//---------------------------------------
-void setup()
-{
-	ZumoInit();
-	buzzer.playOn();    
-	Serial.begin(115200);
-	Serial.print("Starting...\n");
-	pixy.init();
-
-    button.waitForPress();
-    buzzer.playStart();    
-}
- 
-uint32_t lastBlockTime = 0;
- 
-//---------------------------------------
-// Main loop - runs continuously after setup
-//---------------------------------------
-void loop()
-{ 
-	uint16_t blocks;
-	blocks = pixy.getBlocks();
-    
-	// If we have blocks in sight, track and follow them
-	if (blocks)
-	{
-		int trackedBlock = TrackBlock(blocks);
-		FollowBlock(trackedBlock);
-		lastBlockTime = millis();
-        if(pixy_blocks == 0) {
-            if (blocks > 16) {
-                blocks = 16;
-            }
-            pixy_blocks = blocks;
-            for (int j=0; j<blocks; j++){
-                sprintf(pixy_buf[j], "sig: %d x: %d y: %d width: %d height: %d\n",
-                        pixy.blocks[j].signature, pixy.blocks[j].x, pixy.blocks[j].y,
-                        pixy.blocks[j].width, pixy.blocks[j].height);
-            }
-        }
-        delay(1);
-	}  
-	else if (millis() - lastBlockTime > 100)
-	{
-		motors.setLeftSpeed(0);
-		motors.setRightSpeed(0);
-		ScanForBlocks();
-	}
-}
- 
-int oldX, oldY, oldSignature;
- 
-//---------------------------------------
-// Track blocks via the Pixy pan/tilt mech
-// (based in part on Pixy CMUcam5 pantilt example)
-//---------------------------------------
-int TrackBlock(int blockCount)
-{
-	int trackedBlock = 0;
-	long maxSize = 0;
- 
-	Serial.print("blocks =");
-	Serial.println(blockCount);
- 
-	for (int i = 0; i < blockCount; i++)
-	{
-		if ((oldSignature == 0) || (pixy.blocks[i].signature == oldSignature))
-		{
-			long newSize = pixy.blocks[i].height * pixy.blocks[i].width;
-			if (newSize > maxSize)
-			{
-				trackedBlock = i;
-				maxSize = newSize;
-			}
-		}
-	}
- 
-	int32_t panError = X_CENTER - pixy.blocks[trackedBlock].x;
-	int32_t tiltError = pixy.blocks[trackedBlock].y - Y_CENTER;
- 
-	panLoop.update(panError);
-	tiltLoop.update(tiltError);
- 
-	pixy.setServos(panLoop.m_pos, tiltLoop.m_pos);
- 
-	oldX = pixy.blocks[trackedBlock].x;
-	oldY = pixy.blocks[trackedBlock].y;
-	oldSignature = pixy.blocks[trackedBlock].signature;
-	return trackedBlock;
-}
- 
-//---------------------------------------
-// Follow blocks via the Zumo robot drive
-//
-// This code makes the robot base turn 
-// and move to follow the pan/tilt tracking
-// of the head.
-//---------------------------------------
-int32_t size = 400;
-void FollowBlock(int trackedBlock)
-{
-	int32_t followError = RCS_CENTER_POS - panLoop.m_pos;  // How far off-center are we looking now?
- 
-	// Size is the area of the object.
-	// We keep a running average of the last 8.
-	size += pixy.blocks[trackedBlock].width * pixy.blocks[trackedBlock].height; 
-	size -= size >> 3;
- 
-	// Forward speed decreases as we approach the object (size is larger)
-	int forwardSpeed = constrain(400 - (size/256), -100, 400);  
- 
-	// Steering differential is proportional to the error times the forward speed
-	int32_t differential = (followError + (followError * forwardSpeed))>>8;
- 
-	// Adjust the left and right speeds by the steering differential.
-	int leftSpeed = constrain(forwardSpeed + differential, -400, 400);
-	int rightSpeed = constrain(forwardSpeed - differential, -400, 400);
- 
-	// And set the motor speeds
-	motors.setLeftSpeed(leftSpeed);
-	motors.setRightSpeed(rightSpeed);
-}
- 
-//---------------------------------------
-// Random search for blocks
-//
-// This code pans back and forth at random
-// until a block is detected
-//---------------------------------------
-int scanIncrement = (RCS_MAX_POS - RCS_MIN_POS) / 150;
-uint32_t lastMove = 0;
- 
-void ScanForBlocks()
-{
-	if (millis() - lastMove > 20)
-	{
-		lastMove = millis();
-		panLoop.m_pos += scanIncrement;
-		if ((panLoop.m_pos >= RCS_MAX_POS)||(panLoop.m_pos <= RCS_MIN_POS))
-		{
-			tiltLoop.m_pos = random(RCS_MAX_POS * 0.6, RCS_MAX_POS);
-			scanIncrement = -scanIncrement;
-			if (scanIncrement < 0)
-			{
-				motors.setLeftSpeed(-250);
-				motors.setRightSpeed(250);
-			}
-			else
-			{
-				motors.setLeftSpeed(+180);
-				motors.setRightSpeed(-180);
-			}
-			delay(random(250, 500));
-		}
- 
-		pixy.setServos(panLoop.m_pos, tiltLoop.m_pos);
-	}
-}
-
-
-bool setup_done = false;
-
-void task1_setup()
-{
-    int ret;
-    
-    Serial.println("Echo Server : Start!");
-    ret = WiFi.begin(Serial5, 115200);
-
-    if(ret == 1) {
-        Serial.print("Cannot communicate with ESP8266.");
-        while(1);        
-    } else if(ret == 2) {
-        Serial.println("FW Version mismatch.");
-        Serial.print("FW Version:");
-        Serial.println(WiFi.getVersion().c_str());
-        Serial.print("Supported FW Version:");
-        Serial.print(ESP8266_SUPPORT_VERSION);
-        while(1);
-    } else {
-        Serial.print("begin ok\r\n");
-    }
-
-    Serial.print("FW Version:");
-    Serial.println(WiFi.getVersion().c_str());
-    
-#ifdef  WMODE_STATION
-    if (WiFi.setOprToStation()) {
-        Serial.print("to station ok\r\n");
-    } else {
-        Serial.print("to station err\r\n");
-    }
-    
-    if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
-        Serial.print("Join AP success\r\n");
-        Serial.print("IP: ");
-        Serial.println(WiFi.getLocalIP().c_str());    
-    } else {
-        Serial.print("Join AP failure\r\n");
-        while(1);
-    }
-#else /* !WMODE_STATION */ 
-    if (WiFi.setOprToSoftAP()) {
-        Serial.print("to softap ok\r\n");
-    } else {
-        Serial.print("to softap err\r\n");
-    }    
-    if(WiFi.setSoftAPParam(AP_SSID, AP_PASSWORD, 7, 0)){
-        Serial.print("Set SoftAP success\r\n");
-        Serial.print("IP: ");
-        Serial.println(WiFi.getLocalIP().c_str());            
-    }
-    else {
-        Serial.print("Set SoftAP failure\r\n");
-    }
-#endif /* WMODE_STATION */
-    
-    if (WiFi.enableMUX()) {
-        Serial.print("multiple ok\r\n");
-    } else {
-        Serial.print("multiple err\r\n");
-        while(1);
-    }
-
-    if (WiFi.startTCPServer(80)) {
-        Serial.print("start tcp server ok\r\n");
-    } else {
-        Serial.print("start tcp server err\r\n");
-        while(1);
-    }
-
-    if (WiFi.setTCPServerTimeout(60)) { 
-        Serial.print("set tcp server timout 60 seconds\r\n");
-    } else {
-        Serial.print("set tcp server timout err\r\n");
-        while(1);
-    }
-
-    Serial.print("setup end\r\n");
-
-    setup_done = true;
-}
-
-#define MUX_NULL 0xff
-
-uint8_t mux_id_ptn;
-
-uint8_t mux_id = MUX_NULL;
-uint8_t task1_mux_id = MUX_NULL;
-
-void task1_loop()
-{
-    char buf[128]; 
-    uint8_t pre_mux_id_ptn;    
-
-    /* Check Connection Status */
-    pre_mux_id_ptn = mux_id_ptn;
-
-    if(!WiFi.getMuxCStatus(&mux_id_ptn)) {
-        Serial.println("getMuxCStatus(&mux_id_ptn) : Error!");
-    }
-    else {        
-        if (pre_mux_id_ptn != mux_id_ptn) {
-            Serial.print("Connection Status changed! : 0x");
-            Serial.println(mux_id_ptn, HEX);
-            if (mux_id_ptn & 0x01) {
-                mux_id = 0; 
-            }
-            if (mux_id_ptn & 0x02) {
-                task1_mux_id = 1;
-            }
-        }
-    }
-
-    if (mux_id == MUX_NULL) {
-        return;
-    }
-    
-    if (!WiFi.isConnected(mux_id)) {
-        Serial.print("Echo Server : Port is closed: ");
-        Serial.println(mux_id);
-        mux_id = MUX_NULL;
-        return;
-    }
-
-    if(pixy_blocks != 0) {
-        sprintf(buf, "Detected %d:\n", pixy_blocks);
-        WiFi.send(mux_id, (uint8_t*)buf, strlen(buf));        
-        for (int j=0; j<pixy_blocks; j++){
-            WiFi.send(mux_id, (uint8_t*)pixy_buf[j], strlen(pixy_buf[j]));
-        }        
-        pixy_blocks = 0;
-    }        
-}
Index: rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/PIXY_Zumo_Wifi/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,9 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 1
-
-#define  RCA_MAINTASK_LOOP_PRI  5
-#define  RCA_TASK1_LOOP_PRI  6
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/Profiling/Makefile
===================================================================
--- rtos_arduino/trunk/examples/Profiling/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/Profiling/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -36,7 +36,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -52,3 +52,3 @@
 APPL_DIR = 
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/Profiling/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/Profiling/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/Profiling/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/Profiling/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/Profiling/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/Profiling/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/Profiling/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/Profiling/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/Profiling/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/Profiling/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/Profiling/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/Profiling/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,8 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("r2ca_lib.cfg");
Index: rtos_arduino/trunk/examples/Profiling/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/Profiling/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/Profiling/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,79 @@
+#include "r2ca.h"
+
+void task1_setup();
+
+void setup(){
+    Serial.begin(115200);
+}
+
+void loop(){
+    Serial.print("idle     : ");
+    Serial.println(r2ca_idle_result);
+    Serial.print("isr       : ");
+    Serial.println(r2ca_isr_result);
+    Serial.print("dispatch  : ");
+    Serial.println(r2ca_dispatch_result);        
+    delay(1000);
+
+    task1_setup();
+}
+
+#define PSERIAL SerialUSB
+
+bool processing_connected = false;
+
+void establishContact() {
+    while (!PSERIAL.available()) {
+        PSERIAL.print('A'); // send a capital A
+        delay(300);
+    }
+    Serial.println("Processing Task : Connect!");
+    processing_connected = true;
+}
+
+void task1_setup()
+{
+    PSERIAL.begin(115200);
+    while(!PSERIAL){
+        delay(1);
+    }
+    Serial.print("Processing Task : Start!");
+}
+
+int inByte = 0;
+int last_connect = 0;
+
+#define TIMEOUT_MS  3000
+
+void loop1()
+{
+    if(!processing_connected){
+        establishContact();        
+    }else{
+        if((millis() - last_connect) > TIMEOUT_MS){
+            processing_connected = false;
+            Serial.println("Processing Task : Disconnect!");
+        }              
+    }
+    
+    uint16_t load;
+    uint16_t isr_cnt;
+    uint16_t dispatch_cnt;
+
+    load = 100 - map(r2ca_idle_result, 0, IDLE_TASK_IDLE_LOOP_10MS/10, 0, 100);
+    isr_cnt = (r2ca_isr_result > 0xffff)? 0xffff : r2ca_isr_result;
+    dispatch_cnt = (r2ca_dispatch_result > 0xffff)? 0xffff : r2ca_dispatch_result;
+    
+    if (PSERIAL.available()){
+        inByte = PSERIAL.read();        
+        last_connect = millis();
+        
+        PSERIAL.write((uint8_t)(load >> 8));
+        PSERIAL.write((uint8_t)load);
+        PSERIAL.write((uint8_t)(isr_cnt >> 8));                
+        PSERIAL.write((uint8_t)isr_cnt);        
+        PSERIAL.write((uint8_t)(dispatch_cnt >> 8));
+        PSERIAL.write((uint8_t)dispatch_cnt);
+    }
+    delay(1);
+}
Index: rtos_arduino/trunk/examples/Profiling/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/Profiling/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/Profiling/r2ca_app.h	(revision 260)
@@ -0,0 +1,9 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_ENABLE_PROFILING
+#define R2CA_PROFILING_CYC_MS  1
+
+#define R2CA_NUM_TASK 1
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/Profiling/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/Profiling/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/Profiling/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/Profiling/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/Profiling/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/Profiling/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/Profiling/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/Profiling/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,8 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-/*
- *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
- */
-INCLUDE("rca_lib.cfg");
Index: rtos_arduino/trunk/examples/Profiling/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/Profiling/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,85 +1,0 @@
-#include "rca.h"
-
-
-void setup(){
-    Serial.begin(115200);
-}
-
-void loop(){
-    Serial.print("idle     : ");
-    Serial.println(rca_idle_result);
-    Serial.print("isr       : ");
-    Serial.println(rca_isr_result);
-    Serial.print("dispatch  : ");
-    Serial.println(rca_dispatch_result);        
-    delay(1000);
-}
-
-#if 0
-void task1_setup(){
-}
-
-void task1_loop(){    
-    delay(10);
-}
-#endif
-
-#define PSERIAL SerialUSB
-
-bool processing_connected = false;
-
-void establishContact() {
-    while (!PSERIAL.available()) {
-        PSERIAL.print('A'); // send a capital A
-        delay(300);
-    }
-    Serial.println("Processing Task : Connect!");
-    processing_connected = true;
-}
-
-void task1_setup()
-{
-    PSERIAL.begin(115200);
-    while(!PSERIAL){
-        delay(1);
-    }
-    Serial.print("Processing Task : Start!");
-}
-
-int inByte = 0;
-int last_connect = 0;
-
-#define TIMEOUT_MS  3000
-
-void task1_loop()
-{
-    if(!processing_connected){
-        establishContact();        
-    }else{
-        if((millis() - last_connect) > TIMEOUT_MS){
-            processing_connected = false;
-            Serial.println("Processing Task : Disconnect!");
-        }              
-    }
-    
-    uint16_t load;
-    uint16_t isr_cnt;
-    uint16_t dispatch_cnt;
-
-    load = 100 - map(rca_idle_result, 0, IDLE_TASK_IDLE_LOOP_10MS/10, 0, 100);
-    isr_cnt = (rca_isr_result > 0xffff)? 0xffff : rca_isr_result;
-    dispatch_cnt = (rca_dispatch_result > 0xffff)? 0xffff : rca_dispatch_result;
-    
-    if (PSERIAL.available()){
-        inByte = PSERIAL.read();        
-        last_connect = millis();
-        
-        PSERIAL.write((uint8_t)(load >> 8));
-        PSERIAL.write((uint8_t)load);
-        PSERIAL.write((uint8_t)(isr_cnt >> 8));                
-        PSERIAL.write((uint8_t)isr_cnt);        
-        PSERIAL.write((uint8_t)(dispatch_cnt >> 8));
-        PSERIAL.write((uint8_t)dispatch_cnt);
-    }
-    delay(1);
-}
Index: rtos_arduino/trunk/examples/Profiling/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/Profiling/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,9 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_ENABLE_PROFILING
-#define RCA_PROFILING_CYC_MS  1
-
-#define RCA_NUM_TASK 1
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/RRScheduling/Makefile
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/RRScheduling/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -25,7 +25,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -41,3 +41,3 @@
 APPL_DIR = 
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/RRScheduling/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/RRScheduling/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/RRScheduling/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/RRScheduling/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/RRScheduling/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/RRScheduling/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/RRScheduling/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/RRScheduling/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,8 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("r2ca_lib.cfg");
Index: rtos_arduino/trunk/examples/RRScheduling/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/RRScheduling/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,72 @@
+#include "r2ca.h"
+
+
+void
+loop_wait(uint32_t num){
+    volatile uint32_t loop;
+    for(loop = 0; loop < (num*100); loop++){
+        Asm("nop");
+    }
+}
+
+/*
+ *  For MAINTASK
+ */ 
+void setup() {
+    Serial.begin(115200);
+    Serial.println("setup() : running");
+}
+
+void loop() {
+    dis_dsp();
+    Serial.println("loop() : running");
+    ena_dsp();
+    loop_wait(10000);
+}
+
+/*
+ *  For TASK1
+ */
+void loop1() {
+    dis_dsp();
+    Serial.println("task1loop() : running");
+    ena_dsp();
+    digitalWrite(13, HIGH);
+    loop_wait(10000);
+    dis_dsp();
+    Serial.println("task1loop() : running");
+    ena_dsp();
+    digitalWrite(13, LOW); 
+    loop_wait(10000);
+}
+
+/*
+ *  For TASK2
+ */
+void loop2() {
+    dis_dsp();
+    Serial.println("task2loop() : running");
+    ena_dsp();
+    loop_wait(10000);
+}
+
+/*
+ *  For TASK3
+ */
+void loop3() {
+    dis_dsp();
+    Serial.println("task3loop() : running");
+    ena_dsp();
+    loop_wait(20000);
+}
+
+/*
+ *  For TASK4
+ */
+void loop4() {
+    dis_dsp();
+    Serial.println("task4loop() : running");
+    ena_dsp();
+    loop_wait(40000);
+}
+
Index: rtos_arduino/trunk/examples/RRScheduling/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/RRScheduling/r2ca_app.h	(revision 260)
@@ -0,0 +1,9 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 4
+
+#define R2CA_RR_SCHEDULE_PRI 0xffff
+#define R2CA_RR_SCHEDULE_CYCLE 1
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/RRScheduling/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/RRScheduling/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/RRScheduling/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/RRScheduling/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,8 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-/*
- *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
- */
-INCLUDE("rca_lib.cfg");
Index: rtos_arduino/trunk/examples/RRScheduling/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,86 +1,0 @@
-#include "rca.h"
-
-
-void
-loop_wait(uint32_t num){
-    volatile uint32_t loop;
-    for(loop = 0; loop < (num*100); loop++){
-        Asm("nop");
-    }
-}
-
-/*
- *  For MAINTASK
- */ 
-void setup() {
-    Serial.begin(115200);
-    Serial.println("setup() : running");
-}
-
-void loop() {
-    Serial.println("loop() : running");
-    loop_wait(10000);
-}
-
-/*
- *  For TASK1
- */
-void task1_setup() {
-    pinMode(13, OUTPUT);
-    dis_dsp();
-    Serial.println("task1_setup() : running");
-    ena_dsp();
-}
-
-void task1_loop() {
-    digitalWrite(13, HIGH);
-    loop_wait(10000);
-    digitalWrite(13, LOW); 
-    loop_wait(10000);
-}
-
-/*
- *  For TASK2
- */
-void task2_setup() {
-    dis_dsp();
-    Serial.println("task2_setup() : running");
-    ena_dsp();
-    SerialUSB.begin(115200);
-    while(!SerialUSB){ ; }
-    SerialUSB.println("task2_setup() : running");
-}
-
-void task2_loop() {
-    SerialUSB.println("task2loop() : running");
-    loop_wait(10000);
-}
-
-/*
- *  For TASK3
- */
-void task3_setup() {
-    dis_dsp();
-    Serial.println("task3_setup() : running");
-    ena_dsp();    
-}
-
-void task3_loop() {
-    Serial.println("task3loop() : running");
-    loop_wait(20000);
-}
-
-/*
- *  For TASK4
- */
-void task4_setup() {
-    dis_dsp();
-    Serial.println("task4_setup() : running");
-    ena_dsp();
-}
-
-void task4_loop() {
-    Serial.println("task4loop() : running");
-    loop_wait(40000);
-}
-
Index: rtos_arduino/trunk/examples/RRScheduling/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,11 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 4
-
-#define RCA_RR_SCEDULE 0xffffff
-#define RCA_RR_SCEDULE_CYCLE 1
-
-#define RCA_MAINTASK_SETUP_PRI 4
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/ThingSpeak_basic/Makefile
===================================================================
--- rtos_arduino/trunk/examples/ThingSpeak_basic/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/ThingSpeak_basic/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -32,7 +32,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -49,9 +49,9 @@
 
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT
 APPL_CXXOBJS += ESP8266.o
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/thingspeak-arduino/src
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/thingspeak-arduino/src
 APPL_CXXOBJS += ThingSpeak.o
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,6 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+INCLUDE("r2ca_lib.cfg");
+
Index: rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,107 @@
+#include "r2ca.h"
+#include "ESP8266.h"
+#include "Client_ESP8266.h"
+#include "ThingSpeak.h"
+
+#include "../examples_gdef.h"
+
+ESP8266Client wifi_client;
+
+void setup()
+{
+    int ret;
+    
+    Serial.begin(115200);
+    Serial.print("Milkcocoa SDK demo");
+
+    // Connect to WiFi access point.
+    Serial.println(); Serial.println();
+    Serial.print("Connecting to ");
+    Serial.println(STA_SSID);
+
+    ret = WiFi.begin(Serial5, 115200);
+
+    if(ret == 1) {
+        Serial.print("Cannot communicate with ESP8266.");
+        while(1);        
+    } else if(ret == 2) {
+        Serial.println("FW Version mismatch.");
+        Serial.print("FW Version:");
+        Serial.println(WiFi.getVersion().c_str());
+        Serial.print("Supported FW Version:");
+        Serial.println(ESP8266_SUPPORT_VERSION);
+        while(1);
+    } else {
+        Serial.print("begin ok\r\n");
+    }
+
+    Serial.print("FW Version:");
+    Serial.println(WiFi.getVersion().c_str());
+    
+    if (WiFi.setOprToStation()) {
+        Serial.print("to station ok\r\n");
+    } else {
+        Serial.print("to station err\r\n");
+    }
+    
+    if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
+        Serial.print("Join AP success\r\n");
+        Serial.print("IP: ");
+        Serial.println(WiFi.getLocalIP().c_str());    
+    } else {
+        Serial.print("Join AP failure\r\n");
+    }
+
+    if (WiFi.stopServer()) {
+        Serial.print("Stop server ok\r\n");
+    } else {
+        Serial.print("Stop server err\r\n");
+    }        
+    
+    if (WiFi.disableMUX()) {
+        Serial.print("single ok\r\n");
+    } else {
+        Serial.print("single err\r\n");
+    }
+    
+    //Setup
+    if (ThingSpeak.begin(wifi_client))  {
+        Serial.print("ThingSpeak.begin() ok\r\n");
+    } else {
+        Serial.print("ThingSpeak.begin() err\r\n");
+    }
+    
+    pinMode(13, OUTPUT);
+    digitalWrite(13, LOW);   
+
+    Serial.println("setup end\r\n");
+}
+
+unsigned long myChannelNumber =THINGSPEAK_CHANNELNUMBER ;
+const char * myWriteAPIKey = THINGSPEAK_WRITEAPIKEY ;
+
+int cnt1;
+int cnt2;
+
+#include <math.h>
+int a;
+float temperature;
+int B=3975;                  //B value of the thermistor
+float resistance;
+
+void loop() {
+    int ret;
+
+    ThingSpeak.setField(1,cnt1);
+    ThingSpeak.setField(2,cnt2);
+
+    cnt1 += 1;
+    cnt2 += 2;
+
+    // Write the fields that you've set all at once.
+    ret = ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
+    Serial.print("Call writeFields() : return code is ");
+    Serial.println(ret);
+
+    delay(20000);
+}
Index: rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/ThingSpeak_basic/r2ca_app.h	(revision 260)
@@ -0,0 +1,19 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 0
+
+/*
+ *  Use Serial3
+ */
+#define R2CA_USE_SERIAL3
+
+#define  R2CA_TASK2_LOOP_PRI  4 //Web
+#define  R2CA_TASK3_LOOP_PRI  3 //LED
+#define  R2CA_TASK4_LOOP_PRI  7 //TFT
+#define  R2CA_TASK5_LOOP_PRI  6 //Processing
+
+#define R2CA_ENABLE_PROFILING
+#define R2CA_PROFILING_CYC_MS  1
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/ThingSpeak_basic/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/ThingSpeak_basic/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/ThingSpeak_basic/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/ThingSpeak_basic/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/ThingSpeak_basic/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/ThingSpeak_basic/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/ThingSpeak_basic/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/ThingSpeak_basic/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-INCLUDE("rca_lib.cfg");
-
Index: rtos_arduino/trunk/examples/ThingSpeak_basic/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/ThingSpeak_basic/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,107 +1,0 @@
-#include "rca.h"
-#include "ESP8266.h"
-#include "Client_ESP8266.h"
-#include "ThingSpeak.h"
-
-#include "../examples_gdef.h"
-
-ESP8266Client wifi_client;
-
-void setup()
-{
-    int ret;
-    
-    Serial.begin(115200);
-    Serial.print("Milkcocoa SDK demo");
-
-    // Connect to WiFi access point.
-    Serial.println(); Serial.println();
-    Serial.print("Connecting to ");
-    Serial.println(STA_SSID);
-
-    ret = WiFi.begin(Serial5, 115200);
-
-    if(ret == 1) {
-        Serial.print("Cannot communicate with ESP8266.");
-        while(1);        
-    } else if(ret == 2) {
-        Serial.println("FW Version mismatch.");
-        Serial.print("FW Version:");
-        Serial.println(WiFi.getVersion().c_str());
-        Serial.print("Supported FW Version:");
-        Serial.println(ESP8266_SUPPORT_VERSION);
-        while(1);
-    } else {
-        Serial.print("begin ok\r\n");
-    }
-
-    Serial.print("FW Version:");
-    Serial.println(WiFi.getVersion().c_str());
-    
-    if (WiFi.setOprToStation()) {
-        Serial.print("to station ok\r\n");
-    } else {
-        Serial.print("to station err\r\n");
-    }
-    
-    if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
-        Serial.print("Join AP success\r\n");
-        Serial.print("IP: ");
-        Serial.println(WiFi.getLocalIP().c_str());    
-    } else {
-        Serial.print("Join AP failure\r\n");
-    }
-
-    if (WiFi.stopServer()) {
-        Serial.print("Stop server ok\r\n");
-    } else {
-        Serial.print("Stop server err\r\n");
-    }        
-    
-    if (WiFi.disableMUX()) {
-        Serial.print("single ok\r\n");
-    } else {
-        Serial.print("single err\r\n");
-    }
-    
-    //Setup
-    if (ThingSpeak.begin(wifi_client))  {
-        Serial.print("ThingSpeak.begin() ok\r\n");
-    } else {
-        Serial.print("ThingSpeak.begin() err\r\n");
-    }
-    
-    pinMode(13, OUTPUT);
-    digitalWrite(13, LOW);   
-
-    Serial.println("setup end\r\n");
-}
-
-unsigned long myChannelNumber =THINGSPEAK_CHANNELNUMBER ;
-const char * myWriteAPIKey = THINGSPEAK_WRITEAPIKEY ;
-
-int cnt1;
-int cnt2;
-
-#include <math.h>
-int a;
-float temperature;
-int B=3975;                  //B value of the thermistor
-float resistance;
-
-void loop() {
-    int ret;
-
-    ThingSpeak.setField(1,cnt1);
-    ThingSpeak.setField(2,cnt2);
-
-    cnt1 += 1;
-    cnt2 += 2;
-
-    // Write the fields that you've set all at once.
-    ret = ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
-    Serial.print("Call writeFields() : return code is ");
-    Serial.println(ret);
-
-    delay(20000);
-}
Index: rtos_arduino/trunk/examples/ThingSpeak_basic/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/ThingSpeak_basic/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,19 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 0
-
-/*
- *  Use Serial3
- */
-#define RCA_USE_SERIAL3
-
-#define  RCA_TASK2_LOOP_PRI  4 //Web
-#define  RCA_TASK3_LOOP_PRI  3 //LED
-#define  RCA_TASK4_LOOP_PRI  7 //TFT
-#define  RCA_TASK5_LOOP_PRI  6 //Processing
-
-#define RCA_ENABLE_PROFILING
-#define RCA_PROFILING_CYC_MS  1
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/WifiEcho/Makefile
===================================================================
--- rtos_arduino/trunk/examples/WifiEcho/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/WifiEcho/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg
+APPL_CFG      = r2ca_app.cfg
 
 #
@@ -32,7 +32,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -49,6 +49,6 @@
 
 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT/
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/ESP8266_Arudino_AT/
 APPL_CXXOBJS += ESP8266.o
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/WifiEcho/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/WifiEcho/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/WifiEcho/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/WifiEcho/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/WifiEcho/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/WifiEcho/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/WifiEcho/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/WifiEcho/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/WifiEcho/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/WifiEcho/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/WifiEcho/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/WifiEcho/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,6 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+INCLUDE("r2ca_lib.cfg");
+
Index: rtos_arduino/trunk/examples/WifiEcho/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/WifiEcho/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/WifiEcho/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,216 @@
+#include "r2ca.h"
+#include "ESP8266.h"
+
+#include "../examples_gdef.h"
+
+#define WMODE_STATION
+
+bool setup_done = false;
+
+void setup()
+{
+    int ret;
+    
+    Serial.println("Echo Server : Start!");
+    
+    ret = WiFi.begin(Serial5, 115200);
+
+    if(ret == 1) {
+        Serial.print("Cannot communicate with ESP8266.");
+        while(1);        
+    } else if(ret == 2) {
+        Serial.println("FW Version mismatch.");
+        Serial.print("FW Version:");
+        Serial.println(WiFi.getVersion().c_str());
+        Serial.print("Supported FW Version:");
+        Serial.print(ESP8266_SUPPORT_VERSION);
+        while(1);
+    } else {
+        Serial.print("begin ok\r\n");
+    }
+
+    Serial.print("FW Version:");
+    Serial.println(WiFi.getVersion().c_str());
+    
+#ifdef  WMODE_STATION
+    if (WiFi.setOprToStation()) {
+        Serial.print("to station ok\r\n");
+    } else {
+        Serial.print("to station err\r\n");
+    }
+    
+    if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
+        Serial.print("Join AP success\r\n");
+        Serial.print("IP: ");
+        Serial.println(WiFi.getLocalIP().c_str());    
+    } else {
+        Serial.print("Join AP failure\r\n");
+        while(1);
+    }
+#else /* !WMODE_STATION */ 
+    if (WiFi.setOprToSoftAP()) {
+        Serial.print("to softap ok\r\n");
+    } else {
+        Serial.print("to softap err\r\n");
+    }    
+    if(WiFi.setSoftAPParam(AP_SSID, AP_PASSWORD, 7, 0)){
+        Serial.print("Set SoftAP success\r\n");
+        Serial.print("IP: ");
+        Serial.println(WiFi.getLocalIP().c_str());            
+    }
+    else {
+        Serial.print("Set SoftAP failure\r\n");
+    }
+#endif /* WMODE_STATION */
+    
+    if (WiFi.enableMUX()) {
+        Serial.print("multiple ok\r\n");
+    } else {
+        Serial.print("multiple err\r\n");
+        while(1);
+    }
+
+    if (WiFi.startTCPServer(80)) {
+        Serial.print("start tcp server ok\r\n");
+    } else {
+        Serial.print("start tcp server err\r\n");
+        while(1);
+    }
+
+    if (WiFi.setTCPServerTimeout(60)) { 
+        Serial.print("set tcp server timout 60 seconds\r\n");
+    } else {
+        Serial.print("set tcp server timout err\r\n");
+        while(1);
+    }
+
+    Serial.print("setup end\r\n");
+
+    setup_done = true;
+}
+
+#define MUX_NULL 0xff
+
+uint8_t mux_id_ptn;
+
+uint8_t mux_id = MUX_NULL;
+uint8_t task1_mux_id = MUX_NULL;
+
+void loop()
+{
+    uint8_t buffer[128] = {0};
+    uint8_t pre_mux_id_ptn;    
+    uint32_t len;
+    uint32_t i;
+
+    delay(1);    
+    /* Check Connection Status */
+    pre_mux_id_ptn = mux_id_ptn;
+
+    if(!WiFi.getMuxCStatus(&mux_id_ptn)) {
+        Serial.println("getMuxCStatus(&mux_id_ptn) : Error!");
+    }
+    else {        
+        if (pre_mux_id_ptn != mux_id_ptn) {
+            Serial.print("Connection Status changed! : 0x");
+            Serial.println(mux_id_ptn, HEX);
+            if (mux_id_ptn & 0x01) {
+                mux_id = 0; 
+            }
+            if (mux_id_ptn & 0x02) {
+                task1_mux_id = 1;
+            }
+        }
+    }
+
+    if (mux_id == MUX_NULL) {
+        return;
+    }
+    
+    if (!WiFi.isConnected(mux_id)) {
+        Serial.print("Echo Server : Port is closed: ");
+        Serial.println(mux_id);
+        mux_id = MUX_NULL;
+        return;
+    }
+    
+    if((len = WiFi.recv(mux_id, buffer, sizeof(buffer))) == 0) {
+        return;
+    }
+
+    /* Recived Data */
+
+    for(i = 0; i < len; i++) {
+        /* If Recive Ctrl-q(17) */
+        if(buffer[i] == 17) {
+            Serial.print("Echo Server : Close port : ");
+            Serial.println(mux_id);            
+            WiFi.releaseTCP(mux_id);
+            mux_id = MUX_NULL;
+            return;
+        }
+    }
+
+    Serial.print("Echo Server : Recive Data from mux : ");
+    Serial.println(mux_id);
+    Serial.print("Echo Server : Recive len   : ");
+    Serial.println(len);
+    Serial.print("Echo Server : Recive Data  : ");
+    Serial.println((char*)buffer);
+    
+    if(!WiFi.send(mux_id, buffer, len)) {
+        Serial.println("Echo Server : send(mux_id, cmd) : Error!");
+    }
+}
+
+#ifdef MULTI_ECHO_SERVER
+/*
+ *  For TASK1
+ */
+void loop1() {
+    uint8_t buffer[128] = {0};
+    uint32_t len;
+    uint32_t i;
+
+    delay(1);
+    
+    if (task1_mux_id == MUX_NULL) {
+        delay(1);
+        return;
+    }
+    
+    if (!WiFi.isConnected(task1_mux_id)) {
+        Serial.print("Echo Server Task1 : Port is closed: ");
+        Serial.println(task1_mux_id);
+        task1_mux_id = MUX_NULL;
+        return;
+    }
+    if((len = WiFi.recv(task1_mux_id, buffer, sizeof(buffer))) == 0) {
+        return;
+    }        
+
+    /* Recived Data */
+
+    for(i = 0; i < len; i++) {
+        /* If Recive Ctrl-q(17) */
+        if(buffer[i] == 17) {
+            Serial.print("Echo Server Task1 : Close port : ");
+            Serial.println(task1_mux_id);            
+            WiFi.releaseTCP(task1_mux_id);
+            task1_mux_id = MUX_NULL;
+            return;
+        }
+    }
+
+    Serial.print("Echo Server Task1 : Recive Data from mux : ");
+    Serial.println(task1_mux_id);
+    Serial.print("Echo Server Task1 : Recive len   : ");
+    Serial.println(len);
+    Serial.print("Echo Server Task1 : Recive Data  : ");
+    Serial.println((char*)buffer);
+    
+    if(!WiFi.send(task1_mux_id, buffer, len)) {
+        Serial.println("Echo Server Task1 : send(task1_mux_id, cmd) : Error!");
+    }
+}
+#endif /* MULTI_ECHO_SERVER */
Index: rtos_arduino/trunk/examples/WifiEcho/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/WifiEcho/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/WifiEcho/r2ca_app.h	(revision 260)
@@ -0,0 +1,12 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define MULTI_ECHO_SERVER
+
+#ifndef MULTI_ECHO_SERVER
+#define R2CA_NUM_TASK 0
+#else /* MULTI_ECHO_SERVER */
+#define R2CA_NUM_TASK 1
+#endif /* MULTI_ECHO_SERVER */
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/WifiEcho/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/WifiEcho/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/WifiEcho/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/WifiEcho/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/WifiEcho/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/WifiEcho/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/WifiEcho/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/WifiEcho/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-INCLUDE("rca_lib.cfg");
-
Index: rtos_arduino/trunk/examples/WifiEcho/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/WifiEcho/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,223 +1,0 @@
-#include "rca.h"
-#include "ESP8266.h"
-
-#include "../examples_gdef.h"
-
-#define WMODE_STATION
-
-bool setup_done = false;
-
-void setup()
-{
-    int ret;
-    
-    Serial.println("Echo Server : Start!");
-    
-    ret = WiFi.begin(Serial5, 115200);
-
-    if(ret == 1) {
-        Serial.print("Cannot communicate with ESP8266.");
-        while(1);        
-    } else if(ret == 2) {
-        Serial.println("FW Version mismatch.");
-        Serial.print("FW Version:");
-        Serial.println(WiFi.getVersion().c_str());
-        Serial.print("Supported FW Version:");
-        Serial.print(ESP8266_SUPPORT_VERSION);
-        while(1);
-    } else {
-        Serial.print("begin ok\r\n");
-    }
-
-    Serial.print("FW Version:");
-    Serial.println(WiFi.getVersion().c_str());
-    
-#ifdef  WMODE_STATION
-    if (WiFi.setOprToStation()) {
-        Serial.print("to station ok\r\n");
-    } else {
-        Serial.print("to station err\r\n");
-    }
-    
-    if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
-        Serial.print("Join AP success\r\n");
-        Serial.print("IP: ");
-        Serial.println(WiFi.getLocalIP().c_str());    
-    } else {
-        Serial.print("Join AP failure\r\n");
-        while(1);
-    }
-#else /* !WMODE_STATION */ 
-    if (WiFi.setOprToSoftAP()) {
-        Serial.print("to softap ok\r\n");
-    } else {
-        Serial.print("to softap err\r\n");
-    }    
-    if(WiFi.setSoftAPParam(AP_SSID, AP_PASSWORD, 7, 0)){
-        Serial.print("Set SoftAP success\r\n");
-        Serial.print("IP: ");
-        Serial.println(WiFi.getLocalIP().c_str());            
-    }
-    else {
-        Serial.print("Set SoftAP failure\r\n");
-    }
-#endif /* WMODE_STATION */
-    
-    if (WiFi.enableMUX()) {
-        Serial.print("multiple ok\r\n");
-    } else {
-        Serial.print("multiple err\r\n");
-        while(1);
-    }
-
-    if (WiFi.startTCPServer(80)) {
-        Serial.print("start tcp server ok\r\n");
-    } else {
-        Serial.print("start tcp server err\r\n");
-        while(1);
-    }
-
-    if (WiFi.setTCPServerTimeout(60)) { 
-        Serial.print("set tcp server timout 60 seconds\r\n");
-    } else {
-        Serial.print("set tcp server timout err\r\n");
-        while(1);
-    }
-
-    Serial.print("setup end\r\n");
-
-    setup_done = true;
-}
-
-#define MUX_NULL 0xff
-
-uint8_t mux_id_ptn;
-
-uint8_t mux_id = MUX_NULL;
-uint8_t task1_mux_id = MUX_NULL;
-
-void loop()
-{
-    uint8_t buffer[128] = {0};
-    uint8_t pre_mux_id_ptn;    
-    uint32_t len;
-    uint32_t i;
-
-    delay(1);    
-    /* Check Connection Status */
-    pre_mux_id_ptn = mux_id_ptn;
-
-    if(!WiFi.getMuxCStatus(&mux_id_ptn)) {
-        Serial.println("getMuxCStatus(&mux_id_ptn) : Error!");
-    }
-    else {        
-        if (pre_mux_id_ptn != mux_id_ptn) {
-            Serial.print("Connection Status changed! : 0x");
-            Serial.println(mux_id_ptn, HEX);
-            if (mux_id_ptn & 0x01) {
-                mux_id = 0; 
-            }
-            if (mux_id_ptn & 0x02) {
-                task1_mux_id = 1;
-            }
-        }
-    }
-
-    if (mux_id == MUX_NULL) {
-        return;
-    }
-    
-    if (!WiFi.isConnected(mux_id)) {
-        Serial.print("Echo Server : Port is closed: ");
-        Serial.println(mux_id);
-        mux_id = MUX_NULL;
-        return;
-    }
-    
-    if((len = WiFi.recv(mux_id, buffer, sizeof(buffer))) == 0) {
-        return;
-    }
-
-    /* Recived Data */
-
-    for(i = 0; i < len; i++) {
-        /* If Recive Ctrl-q(17) */
-        if(buffer[i] == 17) {
-            Serial.print("Echo Server : Close port : ");
-            Serial.println(mux_id);            
-            WiFi.releaseTCP(mux_id);
-            mux_id = MUX_NULL;
-            return;
-        }
-    }
-
-    Serial.print("Echo Server : Recive Data from mux : ");
-    Serial.println(mux_id);
-    Serial.print("Echo Server : Recive len   : ");
-    Serial.println(len);
-    Serial.print("Echo Server : Recive Data  : ");
-    Serial.println((char*)buffer);
-    
-    if(!WiFi.send(mux_id, buffer, len)) {
-        Serial.println("Echo Server : send(mux_id, cmd) : Error!");
-    }
-}
-
-#ifdef MULTI_ECHO_SERVER
-/*
- *  For TASK1
- */
-void task1_setup() {
-    while(!setup_done) {
-        delay(1);
-    }
-    Serial.println("Echo Server Task1 : start");
-}
-
-void task1_loop() {
-    uint8_t buffer[128] = {0};
-    uint32_t len;
-    uint32_t i;
-
-    delay(1);
-    
-    if (task1_mux_id == MUX_NULL) {
-        delay(1);
-        return;
-    }
-    
-    if (!WiFi.isConnected(task1_mux_id)) {
-        Serial.print("Echo Server Task1 : Port is closed: ");
-        Serial.println(task1_mux_id);
-        task1_mux_id = MUX_NULL;
-        return;
-    }
-    if((len = WiFi.recv(task1_mux_id, buffer, sizeof(buffer))) == 0) {
-        return;
-    }        
-
-    /* Recived Data */
-
-    for(i = 0; i < len; i++) {
-        /* If Recive Ctrl-q(17) */
-        if(buffer[i] == 17) {
-            Serial.print("Echo Server Task1 : Close port : ");
-            Serial.println(task1_mux_id);            
-            WiFi.releaseTCP(task1_mux_id);
-            task1_mux_id = MUX_NULL;
-            return;
-        }
-    }
-
-    Serial.print("Echo Server Task1 : Recive Data from mux : ");
-    Serial.println(task1_mux_id);
-    Serial.print("Echo Server Task1 : Recive len   : ");
-    Serial.println(len);
-    Serial.print("Echo Server Task1 : Recive Data  : ");
-    Serial.println((char*)buffer);
-    
-    if(!WiFi.send(task1_mux_id, buffer, len)) {
-        Serial.println("Echo Server Task1 : send(task1_mux_id, cmd) : Error!");
-    }
-}
-#endif /* MULTI_ECHO_SERVER */
Index: rtos_arduino/trunk/examples/WifiEcho/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/WifiEcho/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,12 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define MULTI_ECHO_SERVER
-
-#ifndef MULTI_ECHO_SERVER
-#define RCA_NUM_TASK 0
-#else /* MULTI_ECHO_SERVER */
-#define RCA_NUM_TASK 1
-#endif /* MULTI_ECHO_SERVER */
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/Zumo/Makefile
===================================================================
--- rtos_arduino/trunk/examples/Zumo/Makefile	(revision 259)
+++ rtos_arduino/trunk/examples/Zumo/Makefile	(revision 260)
@@ -7,7 +7,7 @@
 #  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
 #
-APPL_CXXOBJS += rca_app.o
+APPL_CXXOBJS += r2ca_app.o
 APPL_COBJS   += 
-APPL_CFG      = rca_app.cfg 
+APPL_CFG      = r2ca_app.cfg 
 
 #
@@ -37,7 +37,7 @@
 
 #
-#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#  R2CAã®ãã£ã¬ã¯ããªã®å®ç¾©
 #
-RCA_DIR = ../..
+R2CA_DIR = ../..
 
 #
@@ -56,7 +56,7 @@
 #  Zumo Library
 # 
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ZumoShield
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/ZumoShield
 APPL_CXXOBJS += Accelerometer.o L3G.o LSM303.o Pushbutton.o QTRSensors.o ZumoBuzzer.o ZumoMotors.o
 APPL_CFG     += ZumoShield.cfg
 
-include $(RCA_DIR)/lib/Makefile.rca
+include $(R2CA_DIR)/lib/Makefile.r2ca
Index: rtos_arduino/trunk/examples/Zumo/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/Zumo/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/Zumo/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/Zumo/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/Zumo/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/Zumo/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/Zumo/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/Zumo/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/Zumo/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/Zumo/r2ca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/Zumo/r2ca_app.cfg	(revision 260)
+++ rtos_arduino/trunk/examples/Zumo/r2ca_app.cfg	(revision 260)
@@ -0,0 +1,9 @@
+/*
+ *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
+ */
+
+/*
+ *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
+ */
+INCLUDE("r2ca_lib.cfg");
+INCLUDE("ZumoShield.cfg");
Index: rtos_arduino/trunk/examples/Zumo/r2ca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/Zumo/r2ca_app.cpp	(revision 260)
+++ rtos_arduino/trunk/examples/Zumo/r2ca_app.cpp	(revision 260)
@@ -0,0 +1,1369 @@
+#include "r2ca.h"
+#include <Wire.h>
+#include <ZumoShield.h>
+
+#define BUTTON_BASIC
+//#define MOTOR_BASIC
+//#define BUZZER_BASIC
+//#define GYRO_BASIC
+//#define REFLECTANCE_BASIC
+//#define COMPASS_BASIC
+//#define RELECTORNCE_STOP
+//#define ROTATIONRESIST
+//#define FORCEUPHILL
+//#define LINEFOLLOWER
+//#define BORDERDETECT
+//#define SUMOCOLLISIONDETECT
+//#define MAZESOLVER
+
+#ifdef BUTTON_BASIC
+
+void button_int() {
+    Serial.println("Button Interrupt!");
+}
+
+void setup() {
+    Serial.begin(115200);
+    ZumoInit();
+    attachInterrupt(ZUMO_BUTTON,  button_int, FALLING);
+}
+
+void loop() {
+    button.waitForPress();
+    led.on();
+    delay(1000);
+    led.off();  
+    delay(1000);
+    led.on();
+    delay(1000);
+    led.off();    
+    button.waitForRelease();
+}
+#endif /* BUTTON_BASIC */
+
+#ifdef MOTOR_BASIC
+
+void setup() {
+    ZumoInit();
+    buzzer.playOn();
+}
+
+void loop() {
+    button.waitForPress();
+
+    // run left motor forward
+    led.on();
+    for (int speed = 0; speed <= 400; speed++) {
+        motors.setLeftSpeed(speed);
+        delay(2);
+    }
+
+    for (int speed = 400; speed >= 0; speed--) {
+        motors.setLeftSpeed(speed);
+        delay(2);
+    }
+
+    // run left motor backward
+    led.off();
+    for (int speed = 0; speed >= -400; speed--) {
+        motors.setLeftSpeed(speed);
+        delay(2);
+    }
+    
+    for (int speed = -400; speed <= 0; speed++) {
+        motors.setLeftSpeed(speed);
+        delay(2);
+    }
+
+    // run right motor forward
+    led.on();
+    buzzer.playNum(1);
+    for (int speed = 0; speed <= 400; speed++){
+        motors.setRightSpeed(speed);
+        delay(2);
+    }
+
+    for (int speed = 400; speed >= 0; speed--){
+        motors.setRightSpeed(speed);
+        delay(2);
+    }
+
+    // run right motor backward
+    led.off();
+    buzzer.playNum(1);    
+    for (int speed = 0; speed >= -400; speed--){
+        motors.setRightSpeed(speed);
+        delay(2);
+    }
+
+    for (int speed = -400; speed <= 0; speed++){
+        motors.setRightSpeed(speed);
+        delay(2);
+    }
+    
+    delay(500);
+    
+    led.on();
+    buzzer.playNum(1);        
+    motors.setSpeeds(100, 100);
+    delay(2000);
+    motors.setSpeeds(0, 0);
+    
+    led.off();
+    buzzer.playNum(1);            
+    motors.setSpeeds(-100, -100);
+    delay(2000);
+    motors.setSpeeds(0, 0);
+    
+    led.on();
+    buzzer.playNum(1);
+    motors.setSpeeds(-100, 100);
+    delay(2000);
+    motors.setSpeeds(0, 0);
+
+    led.off();
+    buzzer.playNum(1);
+    motors.setSpeeds(100, -100);
+    delay(2000);
+    motors.setSpeeds(0, 0);
+}
+#endif /* MOTOR_BASIC */
+
+#ifdef BUZZER_BASIC
+void setup() {
+    ZumoInit();
+    buzzer.playOn();
+    buzzer.playNum(2);
+    buzzer.playMode(PLAY_AUTOMATIC);
+    Serial.begin(115200);
+}
+
+const char sound_effect[] = "O4 T100 V15 L4 MS g12>c12>e12>G6>E12 ML>G2"; // "charge" melody
+
+void loop() {
+    button.waitForPress();
+    buzzer.playFromProgramSpace(sound_effect);
+    button.waitForRelease();
+}
+#endif /* BUZZER_BASIC */
+
+
+#ifdef GYRO_BASIC
+void setup()
+{
+    Serial.begin(115200);
+    
+    buzzer.playOn();  
+    gyro.turnSensorSetup();
+    delay(500);
+    gyro.turnSensorReset();
+    
+    buzzer.playStart();
+}
+
+void loop()
+{  
+  gyro.turnSensorUpdate();
+  Serial.println(gyro.turnAngleDegree);
+}
+
+#endif /* GYRO_BASIC */
+
+
+#ifdef REFLECTANCE_BASIC
+
+void setup() {
+  buzzer.playOn();
+  Serial.begin(115200);
+  Serial.println("Zumo sample Start!");
+}
+
+void loop() {
+  reflectances.update();
+  
+  Serial.print(reflectances.value(1));
+  Serial.print(',');
+  Serial.print(reflectances.value(2));
+  Serial.print(',');  
+  Serial.print(reflectances.value(3));
+  Serial.print(',');
+  Serial.print(reflectances.value(4));
+  Serial.print(',');  
+  Serial.print(reflectances.value(5));
+  Serial.print(',');  
+  Serial.print(reflectances.value(6));
+  Serial.print(',');    
+  Serial.println();
+  
+  delay(1000);
+}
+#endif /* REFLECTANCE_BASIC */
+
+
+
+
+#ifdef COMPASS_BASIC
+
+#define min(a,b) ((a)<(b)?(a):(b))
+#define max(a,b) ((a)>(b)?(a):(b))
+#define SPEED           200
+#define CALIBRATION_SAMPLES 70
+
+void setup() {
+    Serial.begin(115200);
+    ZumoInit();
+    compass.begin();
+#if 0    
+  LSM303::vector<int16_t> running_min = {32767, 32767, 32767}, running_max = {-32767, -32767, -32767};
+  unsigned char index;
+  Serial.println("starting calibration");
+
+  // To calibrate the magnetometer, the Zumo spins to find the max/min
+  // magnetic vectors. This information is used to correct for offsets
+  // in the magnetometer data.
+  motors.setLeftSpeed(SPEED);
+  motors.setRightSpeed(-SPEED);
+
+  for(index = 0; index < CALIBRATION_SAMPLES; index ++)
+  {
+    // Take a reading of the magnetic vector and store it in compass.m
+    compass.read();
+
+    running_min.x = min(running_min.x, compass.m.x);
+    running_min.y = min(running_min.y, compass.m.y);
+
+    running_max.x = max(running_max.x, compass.m.x);
+    running_max.y = max(running_max.y, compass.m.y);
+
+    Serial.println(index);
+
+    delay(50);
+  }
+
+  motors.setLeftSpeed(0);
+  motors.setRightSpeed(0);
+
+  Serial.print("max.x   ");
+  Serial.print(running_max.x);
+  Serial.println();
+  Serial.print("max.y   ");
+  Serial.print(running_max.y);
+  Serial.println();
+  Serial.print("min.x   ");
+  Serial.print(running_min.x);
+  Serial.println();
+  Serial.print("min.y   ");
+  Serial.print(running_min.y);
+  Serial.println();
+
+  // Set calibrated values to compass.m_max and compass.m_min
+  compass.m_max.x = running_max.x;
+  compass.m_max.y = running_max.y;
+  compass.m_min.x = running_min.x;
+  compass.m_min.y = running_min.y;
+  button.waitForButton();
+#endif    
+}
+
+void loop() {
+  float heading;
+
+  heading = compass.averageHeading();
+  Serial.print("Heading: ");
+  Serial.println(heading);
+}
+
+#endif /* COMPASS_BASIC */
+
+#ifdef RELECTORNCE_STOP
+
+#define REFLECTANCE_THRESHOLD  400
+
+void setup() {
+    ZumoInit();
+    Serial.begin(115200);    
+    buzzer.playOn();
+    
+    Serial.println("Zumo sample Start!");
+    button.waitForPress();
+}
+
+void loop() {
+    reflectances.update();
+
+    while ((reflectances.value(3) < REFLECTANCE_THRESHOLD) && 
+           (reflectances.value(4) < REFLECTANCE_THRESHOLD)) {
+        motors.setSpeeds(100, 100);
+        led.on();
+        reflectances.update();
+    }
+    motors.setSpeeds(0, 0);
+    led.off();
+    button.waitForPress();
+}
+#endif /* COMPASS_BASIC */
+
+
+#ifdef ROTATIONRESIST
+/* This demo shows how the Zumo can use its gyroscope to detect
+when it is being rotated, and use the motors to resist that
+rotation.
+
+This code was tested on a Zumo with 4 NiMH batteries and two 75:1
+HP micro metal gearmotors.  If you have different batteries or
+motors, you might need to adjust the PID constants.
+
+Be careful to not move the robot for a few seconds after starting
+it while the gyro is being calibrated.  During the gyro
+calibration, the yellow LED is on and the words "Gyro cal" are
+displayed on the LCD.
+
+After the gyro calibration is done, press button A to start the
+demo.  If you try to turn the Zumo, or put it on a surface that
+is turning, it will drive its motors to counteract the turning.
+
+This demo only uses the Z axis of the gyro, so it is possible to
+pick up the Zumo, rotate it about its X and Y axes, and then put
+it down facing in a new position. */
+
+// This is the maximum speed the motors will be allowed to turn.
+// A maxSpeed of 400 lets the motors go at top speed.  Decrease
+// this value to impose a speed limit.
+const int16_t maxSpeed = 400;
+
+void setup()
+{  
+    buzzer.playOn();
+    ZumoInit();
+    Serial.begin(115200);    
+    button.waitForButton();
+  
+    gyro.turnSensorSetup();
+    delay(500);
+    gyro.turnSensorReset();
+    
+    buzzer.playStart();
+    delay(1000);
+}
+
+void loop()
+{  
+  // Read the gyro to update turnAngle, the estimation of how far
+  // the robot has turned, and turnRate, the estimation of how
+  // fast it is turning.
+  gyro.turnSensorUpdate();
+  Serial.println(gyro.turnAngleDegree);
+
+  // Calculate the motor turn speed using proportional and
+  // derivative PID terms.  Here we are a using a proportional
+  // constant of 56 and a derivative constant of 1/20.
+  int32_t turnSpeed = -(int32_t)(gyro.turnAngle) / (gyro.turnAngle1 / 56)
+    - gyro.turnRate / 20;
+
+  // Constrain our motor speeds to be between
+  // -maxSpeed and maxSpeed.
+  turnSpeed = constrain(turnSpeed, -maxSpeed, maxSpeed);
+
+  motors.setSpeeds(-turnSpeed, turnSpeed);  
+}
+#endif /* ROTATIONRESIST */
+
+#ifdef FORCEUPHILL
+/* This demo shows how the Zumo can use its gyroscope to detect
+when it is being rotated, and use the motors to resist that
+rotation.
+
+This code was tested on a Zumo with 4 NiMH batteries and two 75:1
+HP micro metal gearmotors.  If you have different batteries or
+motors, you might need to adjust the PID constants.
+
+Be careful to not move the robot for a few seconds after starting
+it while the gyro is being calibrated.  During the gyro
+calibration, the yellow LED is on and the words "Gyro cal" are
+displayed on the LCD.
+
+After the gyro calibration is done, press button A to start the
+demo.  If you try to turn the Zumo, or put it on a surface that
+is turning, it will drive its motors to counteract the turning.
+
+This demo only uses the Z axis of the gyro, so it is possible to
+pick up the Zumo, rotate it about its X and Y axes, and then put
+it down facing in a new position. */
+
+// This is the maximum speed the motors will be allowed to turn.
+// A maxSpeed of 400 lets the motors go at top speed.  Decrease
+// this value to impose a speed limit.
+const int16_t maxSpeed = 400;
+
+void setup()
+{  
+    buzzer.playOn();
+    ZumoInit();
+    Serial.begin(115200);
+    
+    button.waitForButton();
+    compass.begin();
+    buzzer.playStart();
+    led.on();
+}
+
+void loop()
+{  
+  // Read the acceleration from the LSM303.
+  // A value of 16384 corresponds to approximately 1 g.
+  compass.read();
+  int16_t x = compass.a.x;
+  int16_t y = compass.a.y;
+  int32_t magnitudeSquared = (int32_t)x * x + (int32_t)y * y;
+
+  // Use the encoders to see how much we should drive forward.
+  // If the robot rolls downhill, the encoder counts will become
+  // negative, resulting in a positive forwardSpeed to counteract
+  // the rolling.
+  int16_t forwardSpeed = 20;
+
+  // See if we are actually on an incline.
+  // 16384 * sin(5 deg) = 1427
+  int16_t turnSpeed;
+  if (magnitudeSquared > (int32_t)1427 * 1427)
+  {
+    // We are on an incline of more than 5 degrees, so
+    // try to face uphill using a feedback algorithm.
+    turnSpeed = y / 16;
+  }
+  else
+  {
+    // We not on a noticeable incline, so don't turn.
+    turnSpeed = 0;
+  }
+
+  // To face uphill, we need to turn so that the X acceleration
+  // is negative and the Y acceleration is 0.  Therefore, when
+  // the Y acceleration is positive, we want to turn to the
+  // left (counter-clockwise).
+  int16_t leftSpeed = forwardSpeed - turnSpeed;
+  int16_t rightSpeed = forwardSpeed + turnSpeed;
+
+  // Constrain the speeds to be between -maxSpeed and maxSpeed.
+  leftSpeed = constrain(leftSpeed, -maxSpeed, maxSpeed);
+  rightSpeed = constrain(rightSpeed, -maxSpeed, maxSpeed);
+
+  motors.setSpeeds(leftSpeed, rightSpeed);  
+}
+#endif /* FORCEUPHILL */
+
+
+#ifdef LINEFOLLOWER
+/*
+ * Demo line-following code for the Pololu Zumo Robot
+ *
+ * This code will follow a black line on a white background, using a
+ * PID-based algorithm.  It works decently on courses with smooth, 6"
+ * radius curves and has been tested with Zumos using 30:1 HP and
+ * 75:1 HP motors.  Modifications might be required for it to work
+ * well on different courses or with different motors.
+ *
+ * http://www.pololu.com/catalog/product/2506
+ * http://www.pololu.com
+ * http://forum.pololu.com
+ */
+int lastError = 0;
+
+// This is the maximum speed the motors will be allowed to turn.
+// (400 lets the motors go at top speed; decrease to impose a speed limit)
+const int MAX_SPEED = 400;
+
+// Sound Effects
+const char sound_effect[] PROGMEM = "O4 T100 V15 L4 MS g12>c12>e12>G6>E12 ML>G2"; // "charge" melody
+
+void setup()
+{
+    // Play a little welcome song
+    buzzer.playOn();
+    ZumoInit();
+    Serial.begin(115200);    
+
+    // Initialize the reflectance sensors module
+    reflectances.init();
+
+    // Wait for the user button to be pressed and released
+    button.waitForButton();
+    
+    // Turn on LED to indicate we are in calibration mode
+    led.on();
+
+    // Wait 1 second and then begin automatic sensor calibration
+    // by rotating in place to sweep the sensors over the line
+    delay(1000);
+    int i;
+    for(i = 0; i < 80; i++) {
+        if ((i > 10 && i <= 30) || (i > 50 && i <= 70))
+          motors.setSpeeds(-200, 200);
+        else
+          motors.setSpeeds(200, -200);
+        reflectances.calibrate();
+        
+        // Since our counter runs to 80, the total delay will be
+        // 80*20 = 1600 ms.
+        delay(20);
+    }
+    motors.setSpeeds(0,0);
+    
+    // Turn off LED to indicate we are through with calibration
+    led.off();
+    buzzer.playOn();
+
+    // Wait for the user button to be pressed and released
+    button.waitForButton();
+    
+    // Play music and wait for it to finish before we start driving.
+    buzzer.playFromProgramSpace(sound_effect);
+    while(buzzer.isPlaying()){delay(1);};
+}
+
+void loop()
+{
+  unsigned int sensors[6];
+
+  // Get the position of the line.  Note that we *must* provide the "sensors"
+  // argument to readLine() here, even though we are not interested in the
+  // individual sensor readings
+  int position = reflectances.readLine(sensors);
+
+  // Our "error" is how far we are away from the center of the line, which
+  // corresponds to position 2500.
+  int error = position - 2500;
+
+  // Get motor speed difference using proportional and derivative PID terms
+  // (the integral term is generally not very useful for line following).
+  // Here we are using a proportional constant of 1/4 and a derivative
+  // constant of 6, which should work decently for many Zumo motor choices.
+  // You probably want to use trial and error to tune these constants for
+  // your particular Zumo and line course.
+  int speedDifference = error / 4 + 6 * (error - lastError);
+
+  lastError = error;
+
+  // Get individual motor speeds.  The sign of speedDifference
+  // determines if the robot turns left or right.
+  int m1Speed = MAX_SPEED + speedDifference;
+  int m2Speed = MAX_SPEED - speedDifference;
+
+  // Here we constrain our motor speeds to be between 0 and MAX_SPEED.
+  // Generally speaking, one motor will always be turning at MAX_SPEED
+  // and the other will be at MAX_SPEED-|speedDifference| if that is positive,
+  // else it will be stationary.  For some applications, you might want to
+  // allow the motor speed to go negative so that it can spin in reverse.
+  if (m1Speed < 0)
+    m1Speed = 0;
+  if (m2Speed < 0)
+    m2Speed = 0;
+  if (m1Speed > MAX_SPEED)
+    m1Speed = MAX_SPEED;
+  if (m2Speed > MAX_SPEED)
+    m2Speed = MAX_SPEED;
+
+  motors.setSpeeds(m1Speed, m2Speed);
+}
+
+#endif /* LINEFOLLOWER */
+
+#ifdef BORDERDETECT
+
+// this might need to be tuned for different lighting conditions, surfaces, etc.
+#define QTR_THRESHOLD  600
+
+// these might need to be tuned for different motor types
+#define REVERSE_SPEED     200 // 0 is stopped, 400 is full speed
+#define TURN_SPEED        200
+#define FORWARD_SPEED     200
+#define REVERSE_DURATION  300 // ms
+#define TURN_DURATION     400 // ms
+
+void setup()
+{
+    buzzer.playOn();
+
+    ZumoInit();
+    
+    Serial.begin(115200);
+    Serial.println("Zumo sample Start!");
+
+    led.on();
+    button.waitForButton();
+    led.off();
+    buzzer.playNum(3);
+    delay(1000);
+    buzzer.playStart();
+    delay(1000);
+}
+
+void loop()
+{
+  if (button.isPressed()) {
+    motors.setSpeeds(0, 0);
+    button.waitForRelease();
+
+    led.on();
+    button.waitForButton();
+    led.off();
+    buzzer.playNum(3);
+    delay(1000);
+    buzzer.playStart();
+    delay(1000);
+  }
+
+  reflectances.update();
+
+  if (reflectances.value(1) > QTR_THRESHOLD) {
+    // if leftmost sensor detects line, reverse and turn to the right
+    motors.setSpeeds(-REVERSE_SPEED, -REVERSE_SPEED);
+    delay(REVERSE_DURATION);
+    motors.setSpeeds(TURN_SPEED, -TURN_SPEED);
+    delay(TURN_DURATION);
+    motors.setSpeeds(FORWARD_SPEED, FORWARD_SPEED);
+  } else if (reflectances.value(6)  > QTR_THRESHOLD) {
+    // if rightmost sensor detects line, reverse and turn to the left
+    motors.setSpeeds(-REVERSE_SPEED, -REVERSE_SPEED);
+    delay(REVERSE_DURATION);
+    motors.setSpeeds(-TURN_SPEED, TURN_SPEED);
+    delay(TURN_DURATION);
+    motors.setSpeeds(FORWARD_SPEED, FORWARD_SPEED);
+  } else {
+    // otherwise, go straight
+    motors.setSpeeds(FORWARD_SPEED, FORWARD_SPEED);
+  }
+}
+#endif /* BORDERDETECT */
+
+
+#ifdef SUMOCOLLISIONDETECT
+/* This example uses the accelerometer in the Zumo Shield's onboard LSM303DLHC with the LSM303 Library to 
+ * detect contact with an adversary robot in the sumo ring. The LSM303 Library is not included in the Zumo 
+ * Shield libraries; it can be downloaded separately from GitHub at: 
+ *
+ *    https://github.com/pololu/LSM303 
+ *
+ * This example extends the BorderDetect example, which makes use of the onboard Zumo Reflectance Sensor Array
+ * and its associated library to detect the border of the sumo ring.  It also illustrates the use of the 
+ * ZumoMotors, PushButton, and ZumoBuzzer libraries.
+ *
+ * In loop(), the program reads the x and y components of acceleration (ignoring z), and detects a
+ * contact when the magnitude of the 3-period average of the x-y vector exceeds an empirically determined
+ * XY_ACCELERATION_THRESHOLD.  On contact detection, the forward speed is increased to FULL_SPEED from
+ * the default SEARCH_SPEED, simulating a "fight or flight" response.
+ *
+ * The program attempts to detect contact only when the Zumo is going straight.  When it is executing a
+ * turn at the sumo ring border, the turn itself generates an acceleration in the x-y plane, so the 
+ * acceleration reading at that time is difficult to interpret for contact detection.  Since the Zumo also 
+ * accelerates forward out of a turn, the acceleration readings are also ignored for MIN_DELAY_AFTER_TURN 
+ * milliseconds after completing a turn. To further avoid false positives, a MIN_DELAY_BETWEEN_CONTACTS is 
+ * also specified.
+ *
+ * This example also contains the following enhancements:
+ * 
+ *  - uses the Zumo Buzzer library to play a sound effect ("charge" melody) at start of competition and 
+ *    whenever contact is made with an opposing robot
+ *
+ *  - randomizes the turn angle on border detection, so that the Zumo executes a more effective search pattern
+ *
+ *  - supports a FULL_SPEED_DURATION_LIMIT, allowing the robot to switch to a SUSTAINED_SPEED after a short 
+ *    period of forward movement at FULL_SPEED.  In the example, both speeds are set to 400 (max), but this 
+ *    feature may be useful to prevent runoffs at the turns if the sumo ring surface is unusually smooth.
+ *
+ *  - logging of accelerometer output to the serial monitor when LOG_SERIAL is #defined.
+ *
+ *  This example also makes use of the public domain RunningAverage library from the Arduino website; the relevant
+ *  code has been copied into this .ino file and does not need to be downloaded separately.
+ */
+
+// #define LOG_SERIAL // write log output to serial port
+
+// Accelerometer Settings
+#define RA_SIZE 3  // number of readings to include in running average of accelerometer readings
+#define XY_ACCELERATION_THRESHOLD 2400  // for detection of contact (~16000 = magnitude of acceleration due to gravity)
+
+// this might need to be tuned for different lighting conditions, surfaces, etc.
+#define QTR_THRESHOLD  1000 // microseconds
+
+// these might need to be tuned for different motor types
+#define REVERSE_SPEED     200 // 0 is stopped, 400 is full speed
+#define TURN_SPEED        200
+#define SEARCH_SPEED      200
+#define SUSTAINED_SPEED   400 // switches to SUSTAINED_SPEED from FULL_SPEED after FULL_SPEED_DURATION_LIMIT ms
+#define FULL_SPEED        400
+#define STOP_DURATION     100 // ms
+#define REVERSE_DURATION  300 // ms
+#define TURN_DURATION     300 // ms
+
+#define RIGHT 1
+#define LEFT -1
+
+enum ForwardSpeed { SearchSpeed, SustainedSpeed, FullSpeed };
+ForwardSpeed _forwardSpeed;  // current forward speed setting
+unsigned long full_speed_start_time;
+#define FULL_SPEED_DURATION_LIMIT     250  // ms
+
+// Sound Effects
+const char sound_effect[] PROGMEM = "O4 T100 V15 L4 MS g12>c12>e12>G6>E12 ML>G2"; // "charge" melody
+ // use V0 to suppress sound effect; v15 for max volume
+ 
+ // Timing
+unsigned long loop_start_time;
+unsigned long last_turn_time;
+unsigned long contact_made_time;
+#define MIN_DELAY_AFTER_TURN          400  // ms = min delay before detecting contact event
+#define MIN_DELAY_BETWEEN_CONTACTS   1000  // ms = min delay between detecting new contact event
+
+Accelerometer lsm303;
+boolean in_contact;  // set when accelerometer detects contact with opposing robot
+
+// forward declaration
+void setForwardSpeed(ForwardSpeed speed);
+void waitForButtonAndCountDown(bool restarting);
+void turn(char direction, bool randomize);
+bool check_for_contact();
+void on_contact_made();
+void on_contact_lost();
+int getForwardSpeed();
+void setForwardSpeed(ForwardSpeed speed);
+
+void setup()
+{
+  buzzer.playOn();
+
+  ZumoInit();
+    
+  lsm303.begin();
+  
+#ifdef LOG_SERIAL
+  Serial.begin(115200);
+  lsm303.getLogHeader();
+#endif
+
+  randomSeed((unsigned int) millis());  
+
+  led.on();
+  buzzer.playMode(PLAY_AUTOMATIC);
+  waitForButtonAndCountDown(false);
+}
+
+void loop()
+{
+  if (button.isPressed()) {
+    // if button is pressed, stop and wait for another press to go again
+    motors.setSpeeds(0, 0);
+    button.waitForRelease();
+    waitForButtonAndCountDown(true);
+  }
+  
+  loop_start_time = millis();
+  lsm303.readAcceleration(loop_start_time); 
+  reflectances.update();
+  
+  if ((_forwardSpeed == FullSpeed) && 
+      (loop_start_time - full_speed_start_time > FULL_SPEED_DURATION_LIMIT)){ 
+    setForwardSpeed(SustainedSpeed);
+  }
+  
+  if (reflectances.value(1) > QTR_THRESHOLD) {
+    // if leftmost sensor detects line, reverse and turn to the right
+    turn(RIGHT, true);
+  }
+  else if (reflectances.value(6) > QTR_THRESHOLD) {
+    // if rightmost sensor detects line, reverse and turn to the left
+    turn(LEFT, true);
+  }
+  else {
+    // otherwise, go straight
+    if (check_for_contact()) on_contact_made();
+    int speed = getForwardSpeed();
+    motors.setSpeeds(speed, speed);
+  }
+}
+
+void waitForButtonAndCountDown(bool restarting)
+{ 
+#ifdef LOG_SERIAL
+  Serial.print(restarting ? "Restarting Countdown" : "Starting Countdown");
+  Serial.println();
+#endif
+  
+  led.on();
+  button.waitForButton();
+  led.off();
+   
+  // play audible countdown
+  buzzer.playNum(3);
+  delay(1000);
+  buzzer.playFromProgramSpace(sound_effect);
+  delay(1000);
+  
+  // reset loop variables
+  in_contact = false;  // 1 if contact made; 0 if no contact or contact lost
+  contact_made_time = 0;
+  last_turn_time = millis();  // prevents false contact detection on initial acceleration
+  _forwardSpeed = SearchSpeed;
+  full_speed_start_time = 0;
+}
+
+// execute turn 
+// direction:  RIGHT or LEFT
+// randomize: to improve searching
+void turn(char direction, bool randomize)
+{
+#ifdef LOG_SERIAL
+  Serial.print("turning ...");
+  Serial.println();
+#endif
+
+  // assume contact lost
+  on_contact_lost();
+  
+  static unsigned int duration_increment = TURN_DURATION / 4;
+  
+  // motors.setSpeeds(0,0);
+  // delay(STOP_DURATION);
+  motors.setSpeeds(-REVERSE_SPEED, -REVERSE_SPEED);
+  delay(REVERSE_DURATION);
+  motors.setSpeeds(TURN_SPEED * direction, -TURN_SPEED * direction);
+  delay(randomize ? TURN_DURATION + (random(8) - 2) * duration_increment : TURN_DURATION);
+  int speed = getForwardSpeed();
+  motors.setSpeeds(speed, speed);
+  last_turn_time = millis();
+}
+
+void setForwardSpeed(ForwardSpeed speed)
+{
+  _forwardSpeed = speed;
+  if (speed == FullSpeed) full_speed_start_time = loop_start_time;
+}
+
+int getForwardSpeed()
+{
+  int speed;
+  switch (_forwardSpeed)
+  {
+    case FullSpeed:
+      speed = FULL_SPEED;
+      break;
+    case SustainedSpeed:
+      speed = SUSTAINED_SPEED;
+      break;
+    default:
+      speed = SEARCH_SPEED;
+      break;
+  }
+  return speed;
+}
+  
+// check for contact, but ignore readings immediately after turning or losing contact
+bool check_for_contact()
+{
+  static long threshold_squared = (long) XY_ACCELERATION_THRESHOLD * (long) XY_ACCELERATION_THRESHOLD;
+  return (lsm303.ss_xy_avg() >  threshold_squared) && \
+    (loop_start_time - last_turn_time > MIN_DELAY_AFTER_TURN) && \
+    (loop_start_time - contact_made_time > MIN_DELAY_BETWEEN_CONTACTS);
+}
+
+// sound horn and accelerate on contact -- fight or flight
+void on_contact_made()
+{
+#ifdef LOG_SERIAL
+  Serial.print("contact made");
+  Serial.println();
+#endif
+  in_contact = true;
+  contact_made_time = loop_start_time;
+  setForwardSpeed(FullSpeed);
+  buzzer.playFromProgramSpace(sound_effect);
+}
+
+// reset forward speed
+void on_contact_lost()
+{
+#ifdef LOG_SERIAL
+  Serial.print("contact lost");
+  Serial.println();
+#endif
+  in_contact = false;
+  setForwardSpeed(SearchSpeed);
+}
+#endif /* SUMOCOLLISIONDETECT */
+
+
+#ifdef MAZESOLVER
+
+/* This example uses the Zumo Reflectance Sensor Array
+ * to navigate a black line maze with no loops. This program
+ * is based off the 3pi maze solving example which can be
+ * found here:
+ *
+ * http://www.pololu.com/docs/0J21/8.a
+ * 
+ * The Zumo first calibrates the sensors to account
+ * for differences of the black line on white background.
+ * Calibration is accomplished in setup().
+ *
+ * In loop(), the function solveMaze() is called and navigates
+ * the Zumo until it finds the finish line which is defined as
+ * a large black area that is thick and wide enough to
+ * cover all six sensors at the same time.
+ * 
+ * Once the Zumo reaches the finishing line, it will stop and
+ * wait for the user to place the Zumo back at the starting
+ * line. The Zumo can then follow the shortest path to the finish
+ * line.
+ *
+ * The macros SPEED, TURN_SPEED, ABOVE_LINE(), and LINE_THICKNESS 
+ * might need to be adjusted on a case by case basis to give better 
+ * line following results.
+ */
+
+// SENSOR_THRESHOLD is a value to compare reflectance sensor
+// readings to to decide if the sensor is over a black line
+#define SENSOR_THRESHOLD 300
+
+// ABOVE_LINE is a helper macro that takes returns
+// 1 if the sensor is over the line and 0 if otherwise
+#define ABOVE_LINE(sensor)((sensor) > SENSOR_THRESHOLD)
+
+// Motor speed when turning. TURN_SPEED should always
+// have a positive value, otherwise the Zumo will turn
+// in the wrong direction.
+#define TURN_SPEED 200
+
+// Motor speed when driving straight. SPEED should always
+// have a positive value, otherwise the Zumo will travel in the
+// wrong direction.
+#define SPEED 200 
+
+// Thickness of your line in inches
+#define LINE_THICKNESS .75 
+
+// When the motor speed of the zumo is set by
+// motors.setSpeeds(200,200), 200 is in ZUNITs/Second.
+// A ZUNIT is a fictitious measurement of distance
+// and only helps to approximate how far the Zumo has
+// traveled. Experimentally it was observed that for 
+// every inch, there were approximately 17142 ZUNITs.
+// This value will differ depending on setup/battery
+// life and may be adjusted accordingly. This value
+// was found using a 75:1 HP Motors with batteries
+// partially discharged.
+#define INCHES_TO_ZUNITS 17142.0
+
+// When the Zumo reaches the end of a segment it needs
+// to find out three things: if it has reached the finish line,
+// if there is a straight segment ahead of it, and which
+// segment to take. OVERSHOOT tells the Zumo how far it needs
+// to overshoot the segment to find out any of these things.
+#define OVERSHOOT(line_thickness)(((INCHES_TO_ZUNITS * (line_thickness)) / SPEED))
+
+// path[] keeps a log of all the turns made
+// since starting the maze
+char path[100] = "";
+unsigned char path_length = 0; // the length of the path
+
+void turn(char dir);
+char selectTurn(unsigned char found_left, unsigned char found_straight, unsigned char found_right);
+void solveMaze();
+void goToFinishLine();
+void simplifyPath();
+
+void setup()
+{
+    unsigned int sensors[6];
+    unsigned short count = 0;
+    unsigned short last_status = 0;
+    int turn_direction = 1;  
+
+    buzzer.playOn();
+    ZumoInit();
+    reflectances.init();
+  
+    delay(500);
+    led.on(); // turn on LED to indicate we are in calibration mode
+   
+    button.waitForButton();
+  
+    // Calibrate the Zumo by sweeping it from left to right
+    for(int i = 0; i < 4; i ++)  {
+        // Zumo will turn clockwise if turn_direction = 1.
+        // If turn_direction = -1 Zumo will turn counter-clockwise.
+        turn_direction *= -1;
+        
+        // Turn direction.
+        motors.setSpeeds(turn_direction * TURN_SPEED, -1*turn_direction * TURN_SPEED);
+      
+        // This while loop monitors line position
+        // until the turn is complete. 
+        while(count < 2) {
+            reflectances.calibrate();
+            reflectances.readLine(sensors);
+            if(turn_direction < 0) {
+                // If the right  most sensor changes from (over white space -> over 
+                // line or over line -> over white space) add 1 to count.
+                count += ABOVE_LINE(sensors[5]) ^ last_status;
+                last_status = ABOVE_LINE(sensors[5]);
+            }
+            else {
+                // If the left most sensor changes from (over white space -> over 
+                // line or over line -> over white space) add 1 to count.
+                count += ABOVE_LINE(sensors[0]) ^ last_status;
+                last_status = ABOVE_LINE(sensors[0]);	  
+            }
+        }
+        
+        count = 0;
+        last_status = 0;
+    }
+    
+    // Turn left.
+    turn('L');
+    
+    motors.setSpeeds(0, 0);
+    
+    // Sound off buzzer to denote Zumo is finished calibrating
+    buzzer.playStart();
+    
+    // Turn off LED to indicate we are through with calibration
+    led.off();
+}
+
+void loop()
+{
+
+    // solveMaze() explores every segment
+    // of the maze until it finds the finish
+    // line.
+    solveMaze();
+  
+    // Sound off buzzer to denote Zumo has solved the maze
+    buzzer.play(">>a32");
+    
+    // The maze has been solved. When the user
+    // places the Zumo at the starting line
+    // and pushes the Zumo button, the Zumo
+    // knows where the finish line is and
+    // will automatically navigate.
+    while(1) {
+        button.waitForButton();
+        goToFinishLine();
+        // Sound off buzzer to denote Zumo is at the finish line.
+        buzzer.play(">>a32");
+    }
+}
+
+// Turns according to the parameter dir, which should be 
+// 'L' (left), 'R' (right), 'S' (straight), or 'B' (back).
+void turn(char dir)
+{
+    // count and last_status help
+    // keep track of how much further
+    // the Zumo needs to turn.
+    unsigned short count = 0;
+    unsigned short last_status = 0;
+    unsigned int sensors[6];
+  
+    // dir tests for which direction to turn
+    switch(dir) {
+  
+        // Since we're using the sensors to coordinate turns instead of timing them, 
+        // we can treat a left turn the same as a direction reversal: they differ only 
+        // in whether the zumo will turn 90 degrees or 180 degrees before seeing the 
+        // line under the sensor. If 'B' is passed to the turn function when there is a
+        // left turn available, then the Zumo will turn onto the left segment.
+      case 'L':
+      case 'B':
+        // Turn left.
+        motors.setSpeeds(-TURN_SPEED, TURN_SPEED);
+        
+        // This while loop monitors line position
+        // until the turn is complete. 
+        while(count < 2) {
+            reflectances.readLine(sensors);
+            
+            // Increment count whenever the state of the sensor changes 
+            // (white->black and black->white) since the sensor should 
+            // pass over 1 line while the robot is turning, the final 
+            // count should be 2
+            count += ABOVE_LINE(sensors[1]) ^ last_status; 
+            last_status = ABOVE_LINE(sensors[1]);
+        }
+        
+        break;
+        
+      case 'R':
+        // Turn right.
+        motors.setSpeeds(TURN_SPEED, -TURN_SPEED);
+      
+        // This while loop monitors line position
+        // until the turn is complete. 
+        while(count < 2) {
+          reflectances.readLine(sensors);
+            count += ABOVE_LINE(sensors[4]) ^ last_status;
+            last_status = ABOVE_LINE(sensors[4]);
+        }
+        
+        break;
+        
+      case 'S':
+        // Don't do anything!
+        break;
+    }
+}
+
+// This function decides which way to turn during the learning phase of
+// maze solving.  It uses the variables found_left, found_straight, and
+// found_right, which indicate whether there is an exit in each of the
+// three directions, applying the "left hand on the wall" strategy.
+char selectTurn(unsigned char found_left, unsigned char found_straight,
+  unsigned char found_right)
+{
+    // Make a decision about how to turn.  The following code
+    // implements a left-hand-on-the-wall strategy, where we always
+    // turn as far to the left as possible.
+    if(found_left)
+      return 'L';
+    else if(found_straight)
+      return 'S';
+    else if(found_right)
+      return 'R';
+    else
+      return 'B';
+}
+
+// The maze is broken down into segments. Once the Zumo decides
+// which segment to turn on, it will navigate until it finds another
+// intersection. followSegment() will then return after the
+// intersection is found.
+void followSegment()
+{
+    unsigned int position;
+    unsigned int sensors[6];
+    int offset_from_center;
+    int power_difference;
+    
+    while(1) {     
+        // Get the position of the line.
+        position = reflectances.readLine(sensors);
+        
+        // The offset_from_center should be 0 when we are on the line.
+        offset_from_center = ((int)position) - 2500;
+        
+        // Compute the difference between the two motor power settings,
+        // m1 - m2.  If this is a positive number the robot will turn
+        // to the left.  If it is a negative number, the robot will
+        // turn to the right, and the magnitude of the number determines
+        // the sharpness of the turn.
+        power_difference = offset_from_center / 3;
+        
+        // Compute the actual motor settings.  We never set either motor
+        // to a negative value.
+        if(power_difference > SPEED)
+          power_difference = SPEED;
+        if(power_difference < -SPEED)
+          power_difference = -SPEED;
+     
+        if(power_difference < 0)
+          motors.setSpeeds(SPEED + power_difference, SPEED);
+        else
+          motors.setSpeeds(SPEED, SPEED - power_difference);
+        
+        // We use the inner four sensors (1, 2, 3, and 4) for
+        // determining whether there is a line straight ahead, and the
+        // sensors 0 and 5 for detecting lines going to the left and
+        // right.
+     
+        if(!ABOVE_LINE(sensors[0]) && !ABOVE_LINE(sensors[1]) && !ABOVE_LINE(sensors[2]) && !ABOVE_LINE(sensors[3]) && !ABOVE_LINE(sensors[4]) && !ABOVE_LINE(sensors[5])) {
+            // There is no line visible ahead, and we didn't see any
+            // intersection.  Must be a dead end.            
+            return;
+        }
+        else if(ABOVE_LINE(sensors[0]) || ABOVE_LINE(sensors[5])) {
+            // Found an intersection.
+            return;
+        }        
+    }
+}
+
+// The solveMaze() function works by applying a "left hand on the wall" strategy: 
+// the robot follows a segment until it reaches an intersection, where it takes the 
+// leftmost fork available to it. It records each turn it makes, and as long as the 
+// maze has no loops, this strategy will eventually lead it to the finish. Afterwards, 
+// the recorded path is simplified by removing dead ends. More information can be 
+// found in the 3pi maze solving example.
+void solveMaze()
+{
+    while(1) {
+        // Navigate current line segment
+        followSegment();
+        
+        // These variables record whether the robot has seen a line to the
+        // left, straight ahead, and right, while examining the current
+        // intersection.
+        unsigned char found_left = 0;
+        unsigned char found_straight = 0;
+        unsigned char found_right = 0;
+         
+        // Now read the sensors and check the intersection type.
+        unsigned int sensors[6];
+        reflectances.readLine(sensors);
+        
+        // Check for left and right exits.
+        if(ABOVE_LINE(sensors[0]))
+          found_left = 1;
+        if(ABOVE_LINE(sensors[5]))
+          found_right = 1;
+        
+        // Drive straight a bit more, until we are
+        // approximately in the middle of intersection.
+        // This should help us better detect if we
+        // have left or right segments.
+        motors.setSpeeds(SPEED, SPEED);
+        delay(OVERSHOOT(LINE_THICKNESS)/2);
+        
+        reflectances.readLine(sensors);
+        
+        // Check for left and right exits.
+        if(ABOVE_LINE(sensors[0]))
+          found_left = 1;
+        if(ABOVE_LINE(sensors[5]))
+          found_right = 1;
+        
+        // After driving a little further, we
+        // should have passed the intersection
+        // and can check to see if we've hit the
+        // finish line or if there is a straight segment
+        // ahead.   
+        delay(OVERSHOOT(LINE_THICKNESS)/2);
+        
+        // Check for a straight exit.
+        reflectances.readLine(sensors);
+        
+        // Check again to see if left or right segment has been found
+        if(ABOVE_LINE(sensors[0]))
+          found_left = 1;
+        if(ABOVE_LINE(sensors[5]))
+            found_right = 1;
+        
+        if(ABOVE_LINE(sensors[1]) || ABOVE_LINE(sensors[2]) || ABOVE_LINE(sensors[3]) || ABOVE_LINE(sensors[4]))
+          found_straight = 1;
+         
+        // Check for the ending spot.
+        // If all four middle sensors are on dark black, we have
+        // solved the maze.
+        if(ABOVE_LINE(sensors[1]) && ABOVE_LINE(sensors[2]) && ABOVE_LINE(sensors[3]) && ABOVE_LINE(sensors[4])) {
+            motors.setSpeeds(0,0);
+            break;
+        }
+        
+        // Intersection identification is complete.
+        unsigned char dir = selectTurn(found_left, found_straight, found_right);
+        
+        // Make the turn indicated by the path.
+        turn(dir);
+         
+        // Store the intersection in the path variable.
+        path[path_length] = dir;
+        path_length++;
+         
+        // You should check to make sure that the path_length does not
+        // exceed the bounds of the array.  We'll ignore that in this
+        // example.
+         
+        // Simplify the learned path.
+        simplifyPath();
+         
+    }
+}
+
+// Now enter an infinite loop - we can re-run the maze as many
+// times as we want to.
+void goToFinishLine()
+{
+  unsigned int sensors[6];
+  int i = 0;
+
+  // Turn around if the Zumo is facing the wrong direction.
+  if(path[0] == 'B') {
+    turn('B');
+    i++;
+  }
+  
+  for(;i<path_length;i++) {
+
+    followSegment();
+                  
+    // Drive through the intersection. 
+    motors.setSpeeds(SPEED, SPEED);
+    delay(OVERSHOOT(LINE_THICKNESS));
+                   
+    // Make a turn according to the instruction stored in
+    // path[i].
+    turn(path[i]);
+  }
+    
+  // Follow the last segment up to the finish.
+  followSegment();
+ 
+  // The finish line has been reached.
+  // Return and wait for another button push to
+  // restart the maze.         
+  reflectances.readLine(sensors);
+  motors.setSpeeds(0,0);
+  
+  return; 
+} 
+
+
+// simplifyPath analyzes the path[] array and reduces all the
+// turns. For example: Right turn + Right turn = (1) Back turn.
+void simplifyPath()
+{
+  
+  // only simplify the path if the second-to-last turn was a 'B'
+  if(path_length < 3 || path[path_length - 2] != 'B')
+  return;
+   
+  int total_angle = 0;
+  int i;
+  
+  for(i = 1; i <= 3; i++) {
+    switch(path[path_length - i]) {
+      case 'R':
+        total_angle += 90;
+        break;
+      case 'L':
+        total_angle += 270;
+        break;
+      case 'B':
+        total_angle += 180;
+        break;
+    }
+  }
+   
+  // Get the angle as a number between 0 and 360 degrees.
+  total_angle = total_angle % 360;
+   
+  // Replace all of those turns with a single one.
+  switch(total_angle) {
+    case 0:
+      path[path_length - 3] = 'S';
+      break;
+    case 90:
+      path[path_length - 3] = 'R';
+      break;
+    case 180:
+      path[path_length - 3] = 'B';
+      break;
+    case 270:
+      path[path_length - 3] = 'L';
+      break;
+  }
+   
+  // The path is now two steps shorter.
+  path_length -= 2;
+}
+#endif /* MAZESOLVER */
Index: rtos_arduino/trunk/examples/Zumo/r2ca_app.h
===================================================================
--- rtos_arduino/trunk/examples/Zumo/r2ca_app.h	(revision 260)
+++ rtos_arduino/trunk/examples/Zumo/r2ca_app.h	(revision 260)
@@ -0,0 +1,6 @@
+#ifndef _R2CA_APP_H_
+#define _R2CA_APP_H_
+
+#define R2CA_NUM_TASK 0
+
+#endif /* _R2CA_APP_H_ */
Index: rtos_arduino/trunk/examples/Zumo/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/Zumo/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/Zumo/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/Zumo/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/Zumo/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/Zumo/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/examples/Zumo/rca_app.cfg
===================================================================
--- rtos_arduino/trunk/examples/Zumo/rca_app.cfg	(revision 259)
+++ 	(revision )
@@ -1,9 +1,0 @@
-/*
- *  $Id: sample1.cfg 2416 2012-09-07 08:06:20Z ertl-hiro $
- */
-
-/*
- *  ãµã³ãã«ãã­ã°ã©ã (1)ã®ã·ã¹ãã ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«
- */
-INCLUDE("rca_lib.cfg");
-INCLUDE("ZumoShield.cfg");
Index: rtos_arduino/trunk/examples/Zumo/rca_app.cpp
===================================================================
--- rtos_arduino/trunk/examples/Zumo/rca_app.cpp	(revision 259)
+++ 	(revision )
@@ -1,1369 +1,0 @@
-#include "rca.h"
-#include <Wire.h>
-#include <ZumoShield.h>
-
-#define BUTTON_BASIC
-//#define MOTOR_BASIC
-//#define BUZZER_BASIC
-//#define GYRO_BASIC
-//#define REFLECTANCE_BASIC
-//#define COMPASS_BASIC
-//#define RELECTORNCE_STOP
-//#define ROTATIONRESIST
-//#define FORCEUPHILL
-//#define LINEFOLLOWER
-//#define BORDERDETECT
-//#define SUMOCOLLISIONDETECT
-//#define MAZESOLVER
-
-#ifdef BUTTON_BASIC
-
-void button_int() {
-    Serial.println("Button Interrupt!");
-}
-
-void setup() {
-    Serial.begin(115200);
-    ZumoInit();
-    attachInterrupt(ZUMO_BUTTON,  button_int, FALLING);
-}
-
-void loop() {
-    button.waitForPress();
-    led.on();
-    delay(1000);
-    led.off();  
-    delay(1000);
-    led.on();
-    delay(1000);
-    led.off();    
-    button.waitForRelease();
-}
-#endif /* BUTTON_BASIC */
-
-#ifdef MOTOR_BASIC
-
-void setup() {
-    ZumoInit();
-    buzzer.playOn();
-}
-
-void loop() {
-    button.waitForPress();
-
-    // run left motor forward
-    led.on();
-    for (int speed = 0; speed <= 400; speed++) {
-        motors.setLeftSpeed(speed);
-        delay(2);
-    }
-
-    for (int speed = 400; speed >= 0; speed--) {
-        motors.setLeftSpeed(speed);
-        delay(2);
-    }
-
-    // run left motor backward
-    led.off();
-    for (int speed = 0; speed >= -400; speed--) {
-        motors.setLeftSpeed(speed);
-        delay(2);
-    }
-    
-    for (int speed = -400; speed <= 0; speed++) {
-        motors.setLeftSpeed(speed);
-        delay(2);
-    }
-
-    // run right motor forward
-    led.on();
-    buzzer.playNum(1);
-    for (int speed = 0; speed <= 400; speed++){
-        motors.setRightSpeed(speed);
-        delay(2);
-    }
-
-    for (int speed = 400; speed >= 0; speed--){
-        motors.setRightSpeed(speed);
-        delay(2);
-    }
-
-    // run right motor backward
-    led.off();
-    buzzer.playNum(1);    
-    for (int speed = 0; speed >= -400; speed--){
-        motors.setRightSpeed(speed);
-        delay(2);
-    }
-
-    for (int speed = -400; speed <= 0; speed++){
-        motors.setRightSpeed(speed);
-        delay(2);
-    }
-    
-    delay(500);
-    
-    led.on();
-    buzzer.playNum(1);        
-    motors.setSpeeds(100, 100);
-    delay(2000);
-    motors.setSpeeds(0, 0);
-    
-    led.off();
-    buzzer.playNum(1);            
-    motors.setSpeeds(-100, -100);
-    delay(2000);
-    motors.setSpeeds(0, 0);
-    
-    led.on();
-    buzzer.playNum(1);
-    motors.setSpeeds(-100, 100);
-    delay(2000);
-    motors.setSpeeds(0, 0);
-
-    led.off();
-    buzzer.playNum(1);
-    motors.setSpeeds(100, -100);
-    delay(2000);
-    motors.setSpeeds(0, 0);
-}
-#endif /* MOTOR_BASIC */
-
-#ifdef BUZZER_BASIC
-void setup() {
-    ZumoInit();
-    buzzer.playOn();
-    buzzer.playNum(2);
-    buzzer.playMode(PLAY_AUTOMATIC);
-    Serial.begin(115200);
-}
-
-const char sound_effect[] = "O4 T100 V15 L4 MS g12>c12>e12>G6>E12 ML>G2"; // "charge" melody
-
-void loop() {
-    button.waitForPress();
-    buzzer.playFromProgramSpace(sound_effect);
-    button.waitForRelease();
-}
-#endif /* BUZZER_BASIC */
-
-
-#ifdef GYRO_BASIC
-void setup()
-{
-    Serial.begin(115200);
-    
-    buzzer.playOn();  
-    gyro.turnSensorSetup();
-    delay(500);
-    gyro.turnSensorReset();
-    
-    buzzer.playStart();
-}
-
-void loop()
-{  
-  gyro.turnSensorUpdate();
-  Serial.println(gyro.turnAngleDegree);
-}
-
-#endif /* GYRO_BASIC */
-
-
-#ifdef REFLECTANCE_BASIC
-
-void setup() {
-  buzzer.playOn();
-  Serial.begin(115200);
-  Serial.println("Zumo sample Start!");
-}
-
-void loop() {
-  reflectances.update();
-  
-  Serial.print(reflectances.value(1));
-  Serial.print(',');
-  Serial.print(reflectances.value(2));
-  Serial.print(',');  
-  Serial.print(reflectances.value(3));
-  Serial.print(',');
-  Serial.print(reflectances.value(4));
-  Serial.print(',');  
-  Serial.print(reflectances.value(5));
-  Serial.print(',');  
-  Serial.print(reflectances.value(6));
-  Serial.print(',');    
-  Serial.println();
-  
-  delay(1000);
-}
-#endif /* REFLECTANCE_BASIC */
-
-
-
-
-#ifdef COMPASS_BASIC
-
-#define min(a,b) ((a)<(b)?(a):(b))
-#define max(a,b) ((a)>(b)?(a):(b))
-#define SPEED           200
-#define CALIBRATION_SAMPLES 70
-
-void setup() {
-    Serial.begin(115200);
-    ZumoInit();
-    compass.begin();
-#if 0    
-  LSM303::vector<int16_t> running_min = {32767, 32767, 32767}, running_max = {-32767, -32767, -32767};
-  unsigned char index;
-  Serial.println("starting calibration");
-
-  // To calibrate the magnetometer, the Zumo spins to find the max/min
-  // magnetic vectors. This information is used to correct for offsets
-  // in the magnetometer data.
-  motors.setLeftSpeed(SPEED);
-  motors.setRightSpeed(-SPEED);
-
-  for(index = 0; index < CALIBRATION_SAMPLES; index ++)
-  {
-    // Take a reading of the magnetic vector and store it in compass.m
-    compass.read();
-
-    running_min.x = min(running_min.x, compass.m.x);
-    running_min.y = min(running_min.y, compass.m.y);
-
-    running_max.x = max(running_max.x, compass.m.x);
-    running_max.y = max(running_max.y, compass.m.y);
-
-    Serial.println(index);
-
-    delay(50);
-  }
-
-  motors.setLeftSpeed(0);
-  motors.setRightSpeed(0);
-
-  Serial.print("max.x   ");
-  Serial.print(running_max.x);
-  Serial.println();
-  Serial.print("max.y   ");
-  Serial.print(running_max.y);
-  Serial.println();
-  Serial.print("min.x   ");
-  Serial.print(running_min.x);
-  Serial.println();
-  Serial.print("min.y   ");
-  Serial.print(running_min.y);
-  Serial.println();
-
-  // Set calibrated values to compass.m_max and compass.m_min
-  compass.m_max.x = running_max.x;
-  compass.m_max.y = running_max.y;
-  compass.m_min.x = running_min.x;
-  compass.m_min.y = running_min.y;
-  button.waitForButton();
-#endif    
-}
-
-void loop() {
-  float heading;
-
-  heading = compass.averageHeading();
-  Serial.print("Heading: ");
-  Serial.println(heading);
-}
-
-#endif /* COMPASS_BASIC */
-
-#ifdef RELECTORNCE_STOP
-
-#define REFLECTANCE_THRESHOLD  400
-
-void setup() {
-    ZumoInit();
-    Serial.begin(115200);    
-    buzzer.playOn();
-    
-    Serial.println("Zumo sample Start!");
-    button.waitForPress();
-}
-
-void loop() {
-    reflectances.update();
-
-    while ((reflectances.value(3) < REFLECTANCE_THRESHOLD) && 
-           (reflectances.value(4) < REFLECTANCE_THRESHOLD)) {
-        motors.setSpeeds(100, 100);
-        led.on();
-        reflectances.update();
-    }
-    motors.setSpeeds(0, 0);
-    led.off();
-    button.waitForPress();
-}
-#endif /* COMPASS_BASIC */
-
-
-#ifdef ROTATIONRESIST
-/* This demo shows how the Zumo can use its gyroscope to detect
-when it is being rotated, and use the motors to resist that
-rotation.
-
-This code was tested on a Zumo with 4 NiMH batteries and two 75:1
-HP micro metal gearmotors.  If you have different batteries or
-motors, you might need to adjust the PID constants.
-
-Be careful to not move the robot for a few seconds after starting
-it while the gyro is being calibrated.  During the gyro
-calibration, the yellow LED is on and the words "Gyro cal" are
-displayed on the LCD.
-
-After the gyro calibration is done, press button A to start the
-demo.  If you try to turn the Zumo, or put it on a surface that
-is turning, it will drive its motors to counteract the turning.
-
-This demo only uses the Z axis of the gyro, so it is possible to
-pick up the Zumo, rotate it about its X and Y axes, and then put
-it down facing in a new position. */
-
-// This is the maximum speed the motors will be allowed to turn.
-// A maxSpeed of 400 lets the motors go at top speed.  Decrease
-// this value to impose a speed limit.
-const int16_t maxSpeed = 400;
-
-void setup()
-{  
-    buzzer.playOn();
-    ZumoInit();
-    Serial.begin(115200);    
-    button.waitForButton();
-  
-    gyro.turnSensorSetup();
-    delay(500);
-    gyro.turnSensorReset();
-    
-    buzzer.playStart();
-    delay(1000);
-}
-
-void loop()
-{  
-  // Read the gyro to update turnAngle, the estimation of how far
-  // the robot has turned, and turnRate, the estimation of how
-  // fast it is turning.
-  gyro.turnSensorUpdate();
-  Serial.println(gyro.turnAngleDegree);
-
-  // Calculate the motor turn speed using proportional and
-  // derivative PID terms.  Here we are a using a proportional
-  // constant of 56 and a derivative constant of 1/20.
-  int32_t turnSpeed = -(int32_t)(gyro.turnAngle) / (gyro.turnAngle1 / 56)
-    - gyro.turnRate / 20;
-
-  // Constrain our motor speeds to be between
-  // -maxSpeed and maxSpeed.
-  turnSpeed = constrain(turnSpeed, -maxSpeed, maxSpeed);
-
-  motors.setSpeeds(-turnSpeed, turnSpeed);  
-}
-#endif /* ROTATIONRESIST */
-
-#ifdef FORCEUPHILL
-/* This demo shows how the Zumo can use its gyroscope to detect
-when it is being rotated, and use the motors to resist that
-rotation.
-
-This code was tested on a Zumo with 4 NiMH batteries and two 75:1
-HP micro metal gearmotors.  If you have different batteries or
-motors, you might need to adjust the PID constants.
-
-Be careful to not move the robot for a few seconds after starting
-it while the gyro is being calibrated.  During the gyro
-calibration, the yellow LED is on and the words "Gyro cal" are
-displayed on the LCD.
-
-After the gyro calibration is done, press button A to start the
-demo.  If you try to turn the Zumo, or put it on a surface that
-is turning, it will drive its motors to counteract the turning.
-
-This demo only uses the Z axis of the gyro, so it is possible to
-pick up the Zumo, rotate it about its X and Y axes, and then put
-it down facing in a new position. */
-
-// This is the maximum speed the motors will be allowed to turn.
-// A maxSpeed of 400 lets the motors go at top speed.  Decrease
-// this value to impose a speed limit.
-const int16_t maxSpeed = 400;
-
-void setup()
-{  
-    buzzer.playOn();
-    ZumoInit();
-    Serial.begin(115200);
-    
-    button.waitForButton();
-    compass.begin();
-    buzzer.playStart();
-    led.on();
-}
-
-void loop()
-{  
-  // Read the acceleration from the LSM303.
-  // A value of 16384 corresponds to approximately 1 g.
-  compass.read();
-  int16_t x = compass.a.x;
-  int16_t y = compass.a.y;
-  int32_t magnitudeSquared = (int32_t)x * x + (int32_t)y * y;
-
-  // Use the encoders to see how much we should drive forward.
-  // If the robot rolls downhill, the encoder counts will become
-  // negative, resulting in a positive forwardSpeed to counteract
-  // the rolling.
-  int16_t forwardSpeed = 20;
-
-  // See if we are actually on an incline.
-  // 16384 * sin(5 deg) = 1427
-  int16_t turnSpeed;
-  if (magnitudeSquared > (int32_t)1427 * 1427)
-  {
-    // We are on an incline of more than 5 degrees, so
-    // try to face uphill using a feedback algorithm.
-    turnSpeed = y / 16;
-  }
-  else
-  {
-    // We not on a noticeable incline, so don't turn.
-    turnSpeed = 0;
-  }
-
-  // To face uphill, we need to turn so that the X acceleration
-  // is negative and the Y acceleration is 0.  Therefore, when
-  // the Y acceleration is positive, we want to turn to the
-  // left (counter-clockwise).
-  int16_t leftSpeed = forwardSpeed - turnSpeed;
-  int16_t rightSpeed = forwardSpeed + turnSpeed;
-
-  // Constrain the speeds to be between -maxSpeed and maxSpeed.
-  leftSpeed = constrain(leftSpeed, -maxSpeed, maxSpeed);
-  rightSpeed = constrain(rightSpeed, -maxSpeed, maxSpeed);
-
-  motors.setSpeeds(leftSpeed, rightSpeed);  
-}
-#endif /* FORCEUPHILL */
-
-
-#ifdef LINEFOLLOWER
-/*
- * Demo line-following code for the Pololu Zumo Robot
- *
- * This code will follow a black line on a white background, using a
- * PID-based algorithm.  It works decently on courses with smooth, 6"
- * radius curves and has been tested with Zumos using 30:1 HP and
- * 75:1 HP motors.  Modifications might be required for it to work
- * well on different courses or with different motors.
- *
- * http://www.pololu.com/catalog/product/2506
- * http://www.pololu.com
- * http://forum.pololu.com
- */
-int lastError = 0;
-
-// This is the maximum speed the motors will be allowed to turn.
-// (400 lets the motors go at top speed; decrease to impose a speed limit)
-const int MAX_SPEED = 400;
-
-// Sound Effects
-const char sound_effect[] PROGMEM = "O4 T100 V15 L4 MS g12>c12>e12>G6>E12 ML>G2"; // "charge" melody
-
-void setup()
-{
-    // Play a little welcome song
-    buzzer.playOn();
-    ZumoInit();
-    Serial.begin(115200);    
-
-    // Initialize the reflectance sensors module
-    reflectances.init();
-
-    // Wait for the user button to be pressed and released
-    button.waitForButton();
-    
-    // Turn on LED to indicate we are in calibration mode
-    led.on();
-
-    // Wait 1 second and then begin automatic sensor calibration
-    // by rotating in place to sweep the sensors over the line
-    delay(1000);
-    int i;
-    for(i = 0; i < 80; i++) {
-        if ((i > 10 && i <= 30) || (i > 50 && i <= 70))
-          motors.setSpeeds(-200, 200);
-        else
-          motors.setSpeeds(200, -200);
-        reflectances.calibrate();
-        
-        // Since our counter runs to 80, the total delay will be
-        // 80*20 = 1600 ms.
-        delay(20);
-    }
-    motors.setSpeeds(0,0);
-    
-    // Turn off LED to indicate we are through with calibration
-    led.off();
-    buzzer.playOn();
-
-    // Wait for the user button to be pressed and released
-    button.waitForButton();
-    
-    // Play music and wait for it to finish before we start driving.
-    buzzer.playFromProgramSpace(sound_effect);
-    while(buzzer.isPlaying()){delay(1);};
-}
-
-void loop()
-{
-  unsigned int sensors[6];
-
-  // Get the position of the line.  Note that we *must* provide the "sensors"
-  // argument to readLine() here, even though we are not interested in the
-  // individual sensor readings
-  int position = reflectances.readLine(sensors);
-
-  // Our "error" is how far we are away from the center of the line, which
-  // corresponds to position 2500.
-  int error = position - 2500;
-
-  // Get motor speed difference using proportional and derivative PID terms
-  // (the integral term is generally not very useful for line following).
-  // Here we are using a proportional constant of 1/4 and a derivative
-  // constant of 6, which should work decently for many Zumo motor choices.
-  // You probably want to use trial and error to tune these constants for
-  // your particular Zumo and line course.
-  int speedDifference = error / 4 + 6 * (error - lastError);
-
-  lastError = error;
-
-  // Get individual motor speeds.  The sign of speedDifference
-  // determines if the robot turns left or right.
-  int m1Speed = MAX_SPEED + speedDifference;
-  int m2Speed = MAX_SPEED - speedDifference;
-
-  // Here we constrain our motor speeds to be between 0 and MAX_SPEED.
-  // Generally speaking, one motor will always be turning at MAX_SPEED
-  // and the other will be at MAX_SPEED-|speedDifference| if that is positive,
-  // else it will be stationary.  For some applications, you might want to
-  // allow the motor speed to go negative so that it can spin in reverse.
-  if (m1Speed < 0)
-    m1Speed = 0;
-  if (m2Speed < 0)
-    m2Speed = 0;
-  if (m1Speed > MAX_SPEED)
-    m1Speed = MAX_SPEED;
-  if (m2Speed > MAX_SPEED)
-    m2Speed = MAX_SPEED;
-
-  motors.setSpeeds(m1Speed, m2Speed);
-}
-
-#endif /* LINEFOLLOWER */
-
-#ifdef BORDERDETECT
-
-// this might need to be tuned for different lighting conditions, surfaces, etc.
-#define QTR_THRESHOLD  600
-
-// these might need to be tuned for different motor types
-#define REVERSE_SPEED     200 // 0 is stopped, 400 is full speed
-#define TURN_SPEED        200
-#define FORWARD_SPEED     200
-#define REVERSE_DURATION  300 // ms
-#define TURN_DURATION     400 // ms
-
-void setup()
-{
-    buzzer.playOn();
-
-    ZumoInit();
-    
-    Serial.begin(115200);
-    Serial.println("Zumo sample Start!");
-
-    led.on();
-    button.waitForButton();
-    led.off();
-    buzzer.playNum(3);
-    delay(1000);
-    buzzer.playStart();
-    delay(1000);
-}
-
-void loop()
-{
-  if (button.isPressed()) {
-    motors.setSpeeds(0, 0);
-    button.waitForRelease();
-
-    led.on();
-    button.waitForButton();
-    led.off();
-    buzzer.playNum(3);
-    delay(1000);
-    buzzer.playStart();
-    delay(1000);
-  }
-
-  reflectances.update();
-
-  if (reflectances.value(1) > QTR_THRESHOLD) {
-    // if leftmost sensor detects line, reverse and turn to the right
-    motors.setSpeeds(-REVERSE_SPEED, -REVERSE_SPEED);
-    delay(REVERSE_DURATION);
-    motors.setSpeeds(TURN_SPEED, -TURN_SPEED);
-    delay(TURN_DURATION);
-    motors.setSpeeds(FORWARD_SPEED, FORWARD_SPEED);
-  } else if (reflectances.value(6)  > QTR_THRESHOLD) {
-    // if rightmost sensor detects line, reverse and turn to the left
-    motors.setSpeeds(-REVERSE_SPEED, -REVERSE_SPEED);
-    delay(REVERSE_DURATION);
-    motors.setSpeeds(-TURN_SPEED, TURN_SPEED);
-    delay(TURN_DURATION);
-    motors.setSpeeds(FORWARD_SPEED, FORWARD_SPEED);
-  } else {
-    // otherwise, go straight
-    motors.setSpeeds(FORWARD_SPEED, FORWARD_SPEED);
-  }
-}
-#endif /* BORDERDETECT */
-
-
-#ifdef SUMOCOLLISIONDETECT
-/* This example uses the accelerometer in the Zumo Shield's onboard LSM303DLHC with the LSM303 Library to 
- * detect contact with an adversary robot in the sumo ring. The LSM303 Library is not included in the Zumo 
- * Shield libraries; it can be downloaded separately from GitHub at: 
- *
- *    https://github.com/pololu/LSM303 
- *
- * This example extends the BorderDetect example, which makes use of the onboard Zumo Reflectance Sensor Array
- * and its associated library to detect the border of the sumo ring.  It also illustrates the use of the 
- * ZumoMotors, PushButton, and ZumoBuzzer libraries.
- *
- * In loop(), the program reads the x and y components of acceleration (ignoring z), and detects a
- * contact when the magnitude of the 3-period average of the x-y vector exceeds an empirically determined
- * XY_ACCELERATION_THRESHOLD.  On contact detection, the forward speed is increased to FULL_SPEED from
- * the default SEARCH_SPEED, simulating a "fight or flight" response.
- *
- * The program attempts to detect contact only when the Zumo is going straight.  When it is executing a
- * turn at the sumo ring border, the turn itself generates an acceleration in the x-y plane, so the 
- * acceleration reading at that time is difficult to interpret for contact detection.  Since the Zumo also 
- * accelerates forward out of a turn, the acceleration readings are also ignored for MIN_DELAY_AFTER_TURN 
- * milliseconds after completing a turn. To further avoid false positives, a MIN_DELAY_BETWEEN_CONTACTS is 
- * also specified.
- *
- * This example also contains the following enhancements:
- * 
- *  - uses the Zumo Buzzer library to play a sound effect ("charge" melody) at start of competition and 
- *    whenever contact is made with an opposing robot
- *
- *  - randomizes the turn angle on border detection, so that the Zumo executes a more effective search pattern
- *
- *  - supports a FULL_SPEED_DURATION_LIMIT, allowing the robot to switch to a SUSTAINED_SPEED after a short 
- *    period of forward movement at FULL_SPEED.  In the example, both speeds are set to 400 (max), but this 
- *    feature may be useful to prevent runoffs at the turns if the sumo ring surface is unusually smooth.
- *
- *  - logging of accelerometer output to the serial monitor when LOG_SERIAL is #defined.
- *
- *  This example also makes use of the public domain RunningAverage library from the Arduino website; the relevant
- *  code has been copied into this .ino file and does not need to be downloaded separately.
- */
-
-// #define LOG_SERIAL // write log output to serial port
-
-// Accelerometer Settings
-#define RA_SIZE 3  // number of readings to include in running average of accelerometer readings
-#define XY_ACCELERATION_THRESHOLD 2400  // for detection of contact (~16000 = magnitude of acceleration due to gravity)
-
-// this might need to be tuned for different lighting conditions, surfaces, etc.
-#define QTR_THRESHOLD  1000 // microseconds
-
-// these might need to be tuned for different motor types
-#define REVERSE_SPEED     200 // 0 is stopped, 400 is full speed
-#define TURN_SPEED        200
-#define SEARCH_SPEED      200
-#define SUSTAINED_SPEED   400 // switches to SUSTAINED_SPEED from FULL_SPEED after FULL_SPEED_DURATION_LIMIT ms
-#define FULL_SPEED        400
-#define STOP_DURATION     100 // ms
-#define REVERSE_DURATION  300 // ms
-#define TURN_DURATION     300 // ms
-
-#define RIGHT 1
-#define LEFT -1
-
-enum ForwardSpeed { SearchSpeed, SustainedSpeed, FullSpeed };
-ForwardSpeed _forwardSpeed;  // current forward speed setting
-unsigned long full_speed_start_time;
-#define FULL_SPEED_DURATION_LIMIT     250  // ms
-
-// Sound Effects
-const char sound_effect[] PROGMEM = "O4 T100 V15 L4 MS g12>c12>e12>G6>E12 ML>G2"; // "charge" melody
- // use V0 to suppress sound effect; v15 for max volume
- 
- // Timing
-unsigned long loop_start_time;
-unsigned long last_turn_time;
-unsigned long contact_made_time;
-#define MIN_DELAY_AFTER_TURN          400  // ms = min delay before detecting contact event
-#define MIN_DELAY_BETWEEN_CONTACTS   1000  // ms = min delay between detecting new contact event
-
-Accelerometer lsm303;
-boolean in_contact;  // set when accelerometer detects contact with opposing robot
-
-// forward declaration
-void setForwardSpeed(ForwardSpeed speed);
-void waitForButtonAndCountDown(bool restarting);
-void turn(char direction, bool randomize);
-bool check_for_contact();
-void on_contact_made();
-void on_contact_lost();
-int getForwardSpeed();
-void setForwardSpeed(ForwardSpeed speed);
-
-void setup()
-{
-  buzzer.playOn();
-
-  ZumoInit();
-    
-  lsm303.begin();
-  
-#ifdef LOG_SERIAL
-  Serial.begin(115200);
-  lsm303.getLogHeader();
-#endif
-
-  randomSeed((unsigned int) millis());  
-
-  led.on();
-  buzzer.playMode(PLAY_AUTOMATIC);
-  waitForButtonAndCountDown(false);
-}
-
-void loop()
-{
-  if (button.isPressed()) {
-    // if button is pressed, stop and wait for another press to go again
-    motors.setSpeeds(0, 0);
-    button.waitForRelease();
-    waitForButtonAndCountDown(true);
-  }
-  
-  loop_start_time = millis();
-  lsm303.readAcceleration(loop_start_time); 
-  reflectances.update();
-  
-  if ((_forwardSpeed == FullSpeed) && 
-      (loop_start_time - full_speed_start_time > FULL_SPEED_DURATION_LIMIT)){ 
-    setForwardSpeed(SustainedSpeed);
-  }
-  
-  if (reflectances.value(1) > QTR_THRESHOLD) {
-    // if leftmost sensor detects line, reverse and turn to the right
-    turn(RIGHT, true);
-  }
-  else if (reflectances.value(6) > QTR_THRESHOLD) {
-    // if rightmost sensor detects line, reverse and turn to the left
-    turn(LEFT, true);
-  }
-  else {
-    // otherwise, go straight
-    if (check_for_contact()) on_contact_made();
-    int speed = getForwardSpeed();
-    motors.setSpeeds(speed, speed);
-  }
-}
-
-void waitForButtonAndCountDown(bool restarting)
-{ 
-#ifdef LOG_SERIAL
-  Serial.print(restarting ? "Restarting Countdown" : "Starting Countdown");
-  Serial.println();
-#endif
-  
-  led.on();
-  button.waitForButton();
-  led.off();
-   
-  // play audible countdown
-  buzzer.playNum(3);
-  delay(1000);
-  buzzer.playFromProgramSpace(sound_effect);
-  delay(1000);
-  
-  // reset loop variables
-  in_contact = false;  // 1 if contact made; 0 if no contact or contact lost
-  contact_made_time = 0;
-  last_turn_time = millis();  // prevents false contact detection on initial acceleration
-  _forwardSpeed = SearchSpeed;
-  full_speed_start_time = 0;
-}
-
-// execute turn 
-// direction:  RIGHT or LEFT
-// randomize: to improve searching
-void turn(char direction, bool randomize)
-{
-#ifdef LOG_SERIAL
-  Serial.print("turning ...");
-  Serial.println();
-#endif
-
-  // assume contact lost
-  on_contact_lost();
-  
-  static unsigned int duration_increment = TURN_DURATION / 4;
-  
-  // motors.setSpeeds(0,0);
-  // delay(STOP_DURATION);
-  motors.setSpeeds(-REVERSE_SPEED, -REVERSE_SPEED);
-  delay(REVERSE_DURATION);
-  motors.setSpeeds(TURN_SPEED * direction, -TURN_SPEED * direction);
-  delay(randomize ? TURN_DURATION + (random(8) - 2) * duration_increment : TURN_DURATION);
-  int speed = getForwardSpeed();
-  motors.setSpeeds(speed, speed);
-  last_turn_time = millis();
-}
-
-void setForwardSpeed(ForwardSpeed speed)
-{
-  _forwardSpeed = speed;
-  if (speed == FullSpeed) full_speed_start_time = loop_start_time;
-}
-
-int getForwardSpeed()
-{
-  int speed;
-  switch (_forwardSpeed)
-  {
-    case FullSpeed:
-      speed = FULL_SPEED;
-      break;
-    case SustainedSpeed:
-      speed = SUSTAINED_SPEED;
-      break;
-    default:
-      speed = SEARCH_SPEED;
-      break;
-  }
-  return speed;
-}
-  
-// check for contact, but ignore readings immediately after turning or losing contact
-bool check_for_contact()
-{
-  static long threshold_squared = (long) XY_ACCELERATION_THRESHOLD * (long) XY_ACCELERATION_THRESHOLD;
-  return (lsm303.ss_xy_avg() >  threshold_squared) && \
-    (loop_start_time - last_turn_time > MIN_DELAY_AFTER_TURN) && \
-    (loop_start_time - contact_made_time > MIN_DELAY_BETWEEN_CONTACTS);
-}
-
-// sound horn and accelerate on contact -- fight or flight
-void on_contact_made()
-{
-#ifdef LOG_SERIAL
-  Serial.print("contact made");
-  Serial.println();
-#endif
-  in_contact = true;
-  contact_made_time = loop_start_time;
-  setForwardSpeed(FullSpeed);
-  buzzer.playFromProgramSpace(sound_effect);
-}
-
-// reset forward speed
-void on_contact_lost()
-{
-#ifdef LOG_SERIAL
-  Serial.print("contact lost");
-  Serial.println();
-#endif
-  in_contact = false;
-  setForwardSpeed(SearchSpeed);
-}
-#endif /* SUMOCOLLISIONDETECT */
-
-
-#ifdef MAZESOLVER
-
-/* This example uses the Zumo Reflectance Sensor Array
- * to navigate a black line maze with no loops. This program
- * is based off the 3pi maze solving example which can be
- * found here:
- *
- * http://www.pololu.com/docs/0J21/8.a
- * 
- * The Zumo first calibrates the sensors to account
- * for differences of the black line on white background.
- * Calibration is accomplished in setup().
- *
- * In loop(), the function solveMaze() is called and navigates
- * the Zumo until it finds the finish line which is defined as
- * a large black area that is thick and wide enough to
- * cover all six sensors at the same time.
- * 
- * Once the Zumo reaches the finishing line, it will stop and
- * wait for the user to place the Zumo back at the starting
- * line. The Zumo can then follow the shortest path to the finish
- * line.
- *
- * The macros SPEED, TURN_SPEED, ABOVE_LINE(), and LINE_THICKNESS 
- * might need to be adjusted on a case by case basis to give better 
- * line following results.
- */
-
-// SENSOR_THRESHOLD is a value to compare reflectance sensor
-// readings to to decide if the sensor is over a black line
-#define SENSOR_THRESHOLD 300
-
-// ABOVE_LINE is a helper macro that takes returns
-// 1 if the sensor is over the line and 0 if otherwise
-#define ABOVE_LINE(sensor)((sensor) > SENSOR_THRESHOLD)
-
-// Motor speed when turning. TURN_SPEED should always
-// have a positive value, otherwise the Zumo will turn
-// in the wrong direction.
-#define TURN_SPEED 200
-
-// Motor speed when driving straight. SPEED should always
-// have a positive value, otherwise the Zumo will travel in the
-// wrong direction.
-#define SPEED 200 
-
-// Thickness of your line in inches
-#define LINE_THICKNESS .75 
-
-// When the motor speed of the zumo is set by
-// motors.setSpeeds(200,200), 200 is in ZUNITs/Second.
-// A ZUNIT is a fictitious measurement of distance
-// and only helps to approximate how far the Zumo has
-// traveled. Experimentally it was observed that for 
-// every inch, there were approximately 17142 ZUNITs.
-// This value will differ depending on setup/battery
-// life and may be adjusted accordingly. This value
-// was found using a 75:1 HP Motors with batteries
-// partially discharged.
-#define INCHES_TO_ZUNITS 17142.0
-
-// When the Zumo reaches the end of a segment it needs
-// to find out three things: if it has reached the finish line,
-// if there is a straight segment ahead of it, and which
-// segment to take. OVERSHOOT tells the Zumo how far it needs
-// to overshoot the segment to find out any of these things.
-#define OVERSHOOT(line_thickness)(((INCHES_TO_ZUNITS * (line_thickness)) / SPEED))
-
-// path[] keeps a log of all the turns made
-// since starting the maze
-char path[100] = "";
-unsigned char path_length = 0; // the length of the path
-
-void turn(char dir);
-char selectTurn(unsigned char found_left, unsigned char found_straight, unsigned char found_right);
-void solveMaze();
-void goToFinishLine();
-void simplifyPath();
-
-void setup()
-{
-    unsigned int sensors[6];
-    unsigned short count = 0;
-    unsigned short last_status = 0;
-    int turn_direction = 1;  
-
-    buzzer.playOn();
-    ZumoInit();
-    reflectances.init();
-  
-    delay(500);
-    led.on(); // turn on LED to indicate we are in calibration mode
-   
-    button.waitForButton();
-  
-    // Calibrate the Zumo by sweeping it from left to right
-    for(int i = 0; i < 4; i ++)  {
-        // Zumo will turn clockwise if turn_direction = 1.
-        // If turn_direction = -1 Zumo will turn counter-clockwise.
-        turn_direction *= -1;
-        
-        // Turn direction.
-        motors.setSpeeds(turn_direction * TURN_SPEED, -1*turn_direction * TURN_SPEED);
-      
-        // This while loop monitors line position
-        // until the turn is complete. 
-        while(count < 2) {
-            reflectances.calibrate();
-            reflectances.readLine(sensors);
-            if(turn_direction < 0) {
-                // If the right  most sensor changes from (over white space -> over 
-                // line or over line -> over white space) add 1 to count.
-                count += ABOVE_LINE(sensors[5]) ^ last_status;
-                last_status = ABOVE_LINE(sensors[5]);
-            }
-            else {
-                // If the left most sensor changes from (over white space -> over 
-                // line or over line -> over white space) add 1 to count.
-                count += ABOVE_LINE(sensors[0]) ^ last_status;
-                last_status = ABOVE_LINE(sensors[0]);	  
-            }
-        }
-        
-        count = 0;
-        last_status = 0;
-    }
-    
-    // Turn left.
-    turn('L');
-    
-    motors.setSpeeds(0, 0);
-    
-    // Sound off buzzer to denote Zumo is finished calibrating
-    buzzer.playStart();
-    
-    // Turn off LED to indicate we are through with calibration
-    led.off();
-}
-
-void loop()
-{
-
-    // solveMaze() explores every segment
-    // of the maze until it finds the finish
-    // line.
-    solveMaze();
-  
-    // Sound off buzzer to denote Zumo has solved the maze
-    buzzer.play(">>a32");
-    
-    // The maze has been solved. When the user
-    // places the Zumo at the starting line
-    // and pushes the Zumo button, the Zumo
-    // knows where the finish line is and
-    // will automatically navigate.
-    while(1) {
-        button.waitForButton();
-        goToFinishLine();
-        // Sound off buzzer to denote Zumo is at the finish line.
-        buzzer.play(">>a32");
-    }
-}
-
-// Turns according to the parameter dir, which should be 
-// 'L' (left), 'R' (right), 'S' (straight), or 'B' (back).
-void turn(char dir)
-{
-    // count and last_status help
-    // keep track of how much further
-    // the Zumo needs to turn.
-    unsigned short count = 0;
-    unsigned short last_status = 0;
-    unsigned int sensors[6];
-  
-    // dir tests for which direction to turn
-    switch(dir) {
-  
-        // Since we're using the sensors to coordinate turns instead of timing them, 
-        // we can treat a left turn the same as a direction reversal: they differ only 
-        // in whether the zumo will turn 90 degrees or 180 degrees before seeing the 
-        // line under the sensor. If 'B' is passed to the turn function when there is a
-        // left turn available, then the Zumo will turn onto the left segment.
-      case 'L':
-      case 'B':
-        // Turn left.
-        motors.setSpeeds(-TURN_SPEED, TURN_SPEED);
-        
-        // This while loop monitors line position
-        // until the turn is complete. 
-        while(count < 2) {
-            reflectances.readLine(sensors);
-            
-            // Increment count whenever the state of the sensor changes 
-            // (white->black and black->white) since the sensor should 
-            // pass over 1 line while the robot is turning, the final 
-            // count should be 2
-            count += ABOVE_LINE(sensors[1]) ^ last_status; 
-            last_status = ABOVE_LINE(sensors[1]);
-        }
-        
-        break;
-        
-      case 'R':
-        // Turn right.
-        motors.setSpeeds(TURN_SPEED, -TURN_SPEED);
-      
-        // This while loop monitors line position
-        // until the turn is complete. 
-        while(count < 2) {
-          reflectances.readLine(sensors);
-            count += ABOVE_LINE(sensors[4]) ^ last_status;
-            last_status = ABOVE_LINE(sensors[4]);
-        }
-        
-        break;
-        
-      case 'S':
-        // Don't do anything!
-        break;
-    }
-}
-
-// This function decides which way to turn during the learning phase of
-// maze solving.  It uses the variables found_left, found_straight, and
-// found_right, which indicate whether there is an exit in each of the
-// three directions, applying the "left hand on the wall" strategy.
-char selectTurn(unsigned char found_left, unsigned char found_straight,
-  unsigned char found_right)
-{
-    // Make a decision about how to turn.  The following code
-    // implements a left-hand-on-the-wall strategy, where we always
-    // turn as far to the left as possible.
-    if(found_left)
-      return 'L';
-    else if(found_straight)
-      return 'S';
-    else if(found_right)
-      return 'R';
-    else
-      return 'B';
-}
-
-// The maze is broken down into segments. Once the Zumo decides
-// which segment to turn on, it will navigate until it finds another
-// intersection. followSegment() will then return after the
-// intersection is found.
-void followSegment()
-{
-    unsigned int position;
-    unsigned int sensors[6];
-    int offset_from_center;
-    int power_difference;
-    
-    while(1) {     
-        // Get the position of the line.
-        position = reflectances.readLine(sensors);
-        
-        // The offset_from_center should be 0 when we are on the line.
-        offset_from_center = ((int)position) - 2500;
-        
-        // Compute the difference between the two motor power settings,
-        // m1 - m2.  If this is a positive number the robot will turn
-        // to the left.  If it is a negative number, the robot will
-        // turn to the right, and the magnitude of the number determines
-        // the sharpness of the turn.
-        power_difference = offset_from_center / 3;
-        
-        // Compute the actual motor settings.  We never set either motor
-        // to a negative value.
-        if(power_difference > SPEED)
-          power_difference = SPEED;
-        if(power_difference < -SPEED)
-          power_difference = -SPEED;
-     
-        if(power_difference < 0)
-          motors.setSpeeds(SPEED + power_difference, SPEED);
-        else
-          motors.setSpeeds(SPEED, SPEED - power_difference);
-        
-        // We use the inner four sensors (1, 2, 3, and 4) for
-        // determining whether there is a line straight ahead, and the
-        // sensors 0 and 5 for detecting lines going to the left and
-        // right.
-     
-        if(!ABOVE_LINE(sensors[0]) && !ABOVE_LINE(sensors[1]) && !ABOVE_LINE(sensors[2]) && !ABOVE_LINE(sensors[3]) && !ABOVE_LINE(sensors[4]) && !ABOVE_LINE(sensors[5])) {
-            // There is no line visible ahead, and we didn't see any
-            // intersection.  Must be a dead end.            
-            return;
-        }
-        else if(ABOVE_LINE(sensors[0]) || ABOVE_LINE(sensors[5])) {
-            // Found an intersection.
-            return;
-        }        
-    }
-}
-
-// The solveMaze() function works by applying a "left hand on the wall" strategy: 
-// the robot follows a segment until it reaches an intersection, where it takes the 
-// leftmost fork available to it. It records each turn it makes, and as long as the 
-// maze has no loops, this strategy will eventually lead it to the finish. Afterwards, 
-// the recorded path is simplified by removing dead ends. More information can be 
-// found in the 3pi maze solving example.
-void solveMaze()
-{
-    while(1) {
-        // Navigate current line segment
-        followSegment();
-        
-        // These variables record whether the robot has seen a line to the
-        // left, straight ahead, and right, while examining the current
-        // intersection.
-        unsigned char found_left = 0;
-        unsigned char found_straight = 0;
-        unsigned char found_right = 0;
-         
-        // Now read the sensors and check the intersection type.
-        unsigned int sensors[6];
-        reflectances.readLine(sensors);
-        
-        // Check for left and right exits.
-        if(ABOVE_LINE(sensors[0]))
-          found_left = 1;
-        if(ABOVE_LINE(sensors[5]))
-          found_right = 1;
-        
-        // Drive straight a bit more, until we are
-        // approximately in the middle of intersection.
-        // This should help us better detect if we
-        // have left or right segments.
-        motors.setSpeeds(SPEED, SPEED);
-        delay(OVERSHOOT(LINE_THICKNESS)/2);
-        
-        reflectances.readLine(sensors);
-        
-        // Check for left and right exits.
-        if(ABOVE_LINE(sensors[0]))
-          found_left = 1;
-        if(ABOVE_LINE(sensors[5]))
-          found_right = 1;
-        
-        // After driving a little further, we
-        // should have passed the intersection
-        // and can check to see if we've hit the
-        // finish line or if there is a straight segment
-        // ahead.   
-        delay(OVERSHOOT(LINE_THICKNESS)/2);
-        
-        // Check for a straight exit.
-        reflectances.readLine(sensors);
-        
-        // Check again to see if left or right segment has been found
-        if(ABOVE_LINE(sensors[0]))
-          found_left = 1;
-        if(ABOVE_LINE(sensors[5]))
-            found_right = 1;
-        
-        if(ABOVE_LINE(sensors[1]) || ABOVE_LINE(sensors[2]) || ABOVE_LINE(sensors[3]) || ABOVE_LINE(sensors[4]))
-          found_straight = 1;
-         
-        // Check for the ending spot.
-        // If all four middle sensors are on dark black, we have
-        // solved the maze.
-        if(ABOVE_LINE(sensors[1]) && ABOVE_LINE(sensors[2]) && ABOVE_LINE(sensors[3]) && ABOVE_LINE(sensors[4])) {
-            motors.setSpeeds(0,0);
-            break;
-        }
-        
-        // Intersection identification is complete.
-        unsigned char dir = selectTurn(found_left, found_straight, found_right);
-        
-        // Make the turn indicated by the path.
-        turn(dir);
-         
-        // Store the intersection in the path variable.
-        path[path_length] = dir;
-        path_length++;
-         
-        // You should check to make sure that the path_length does not
-        // exceed the bounds of the array.  We'll ignore that in this
-        // example.
-         
-        // Simplify the learned path.
-        simplifyPath();
-         
-    }
-}
-
-// Now enter an infinite loop - we can re-run the maze as many
-// times as we want to.
-void goToFinishLine()
-{
-  unsigned int sensors[6];
-  int i = 0;
-
-  // Turn around if the Zumo is facing the wrong direction.
-  if(path[0] == 'B') {
-    turn('B');
-    i++;
-  }
-  
-  for(;i<path_length;i++) {
-
-    followSegment();
-                  
-    // Drive through the intersection. 
-    motors.setSpeeds(SPEED, SPEED);
-    delay(OVERSHOOT(LINE_THICKNESS));
-                   
-    // Make a turn according to the instruction stored in
-    // path[i].
-    turn(path[i]);
-  }
-    
-  // Follow the last segment up to the finish.
-  followSegment();
- 
-  // The finish line has been reached.
-  // Return and wait for another button push to
-  // restart the maze.         
-  reflectances.readLine(sensors);
-  motors.setSpeeds(0,0);
-  
-  return; 
-} 
-
-
-// simplifyPath analyzes the path[] array and reduces all the
-// turns. For example: Right turn + Right turn = (1) Back turn.
-void simplifyPath()
-{
-  
-  // only simplify the path if the second-to-last turn was a 'B'
-  if(path_length < 3 || path[path_length - 2] != 'B')
-  return;
-   
-  int total_angle = 0;
-  int i;
-  
-  for(i = 1; i <= 3; i++) {
-    switch(path[path_length - i]) {
-      case 'R':
-        total_angle += 90;
-        break;
-      case 'L':
-        total_angle += 270;
-        break;
-      case 'B':
-        total_angle += 180;
-        break;
-    }
-  }
-   
-  // Get the angle as a number between 0 and 360 degrees.
-  total_angle = total_angle % 360;
-   
-  // Replace all of those turns with a single one.
-  switch(total_angle) {
-    case 0:
-      path[path_length - 3] = 'S';
-      break;
-    case 90:
-      path[path_length - 3] = 'R';
-      break;
-    case 180:
-      path[path_length - 3] = 'B';
-      break;
-    case 270:
-      path[path_length - 3] = 'L';
-      break;
-  }
-   
-  // The path is now two steps shorter.
-  path_length -= 2;
-}
-#endif /* MAZESOLVER */
Index: rtos_arduino/trunk/examples/Zumo/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/Zumo/rca_app.h	(revision 259)
+++ 	(revision )
@@ -1,6 +1,0 @@
-#ifndef _RCA_APP_H_
-#define _RCA_APP_H_
-
-#define RCA_NUM_TASK 0
-
-#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/proj_base/r2ca.atsln
===================================================================
--- rtos_arduino/trunk/examples/proj_base/r2ca.atsln	(revision 260)
+++ rtos_arduino/trunk/examples/proj_base/r2ca.atsln	(revision 260)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Atmel Studio Solution File, Format Version 11.00
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "r2ca", "r2ca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|ARM = Debug|ARM
+		Release|ARM = Release|ARM
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
+		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: rtos_arduino/trunk/examples/proj_base/r2ca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/proj_base/r2ca.componentinfo.xml	(revision 260)
+++ rtos_arduino/trunk/examples/proj_base/r2ca.componentinfo.xml	(revision 260)
@@ -0,0 +1,171 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
+	<ProjectComponents>
+		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
+			<CApiVersion></CApiVersion>
+			<CBundle></CBundle>
+			<CClass>CMSIS</CClass>
+			<CGroup>CORE</CGroup>
+			<CSub></CSub>
+			<CVariant></CVariant>
+			<CVendor>ARM</CVendor>
+			<CVersion>3.40.0</CVersion>
+			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
+					<CApiVersion></CApiVersion>
+					<CBundle></CBundle>
+					<CClass>Device</CClass>
+					<CGroup>Startup</CGroup>
+					<CSub></CSub>
+					<CVariant></CVariant>
+					<CVendor>Atmel</CVendor>
+					<CVersion>1.0.0</CVersion>
+					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
+					<DependentComponents>
+						<d4p1:anyType z:Ref="i1" />
+					</DependentComponents>
+					<Description></Description>
+					<Files>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>include</Category>
+							<Condition>C</Condition>
+							<FileContentHash i:nil="true" />
+							<FileVersion></FileVersion>
+							<Name>samd21a/include</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\include\sam.h</AbsolutePath>
+							<Attribute></Attribute>
+							<Category>header</Category>
+							<Condition>C</Condition>
+							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/include/sam.h</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.c</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>o0ncidL5gR0Z0YwWJ1YroQ==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.c</Name>
+							<SelectString>Main file (.c)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\templates\main.cpp</AbsolutePath>
+							<Attribute>template</Attribute>
+							<Category>source</Category>
+							<Condition>C Exe</Condition>
+							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/templates/main.cpp</Name>
+							<SelectString>Main file (.cpp)</SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\system_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/system_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>source</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>linkerScript</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+						<d4p1:anyType i:type="FileInfo">
+							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.231\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
+							<Attribute>config</Attribute>
+							<Category>other</Category>
+							<Condition>GCC Exe</Condition>
+							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
+							<FileVersion></FileVersion>
+							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
+							<SelectString></SelectString>
+							<SourcePath></SourcePath>
+						</d4p1:anyType>
+					</Files>
+					<PackName>SAMD21_DFP</PackName>
+					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.231/Atmel.SAMD21_DFP.pdsc</PackPath>
+					<PackVersion>1.0.231</PackVersion>
+					<PresentInProject>true</PresentInProject>
+					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
+					<RteComponents>
+						<d4p1:string></d4p1:string>
+					</RteComponents>
+					<Status>Resolved</Status>
+					<VersionMode>Fixed</VersionMode>
+					<IsComponentInAtProject>true</IsComponentInAtProject>
+				</d4p1:anyType>
+			</DependentComponents>
+			<Description></Description>
+			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>doc</Category>
+					<Condition></Condition>
+					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Documentation\Core\html\index.html</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+				<d4p1:anyType i:type="FileInfo">
+					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
+					<Attribute></Attribute>
+					<Category>include</Category>
+					<Condition></Condition>
+					<FileContentHash i:nil="true" />
+					<FileVersion></FileVersion>
+					<Name>CMSIS\Include\</Name>
+					<SelectString></SelectString>
+					<SourcePath></SourcePath>
+				</d4p1:anyType>
+			</Files>
+			<PackName>CMSIS</PackName>
+			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
+			<PackVersion>4.2.0</PackVersion>
+			<PresentInProject>true</PresentInProject>
+			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
+			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
+				<d4p1:string></d4p1:string>
+			</RteComponents>
+			<Status>Resolved</Status>
+			<VersionMode>Fixed</VersionMode>
+			<IsComponentInAtProject>true</IsComponentInAtProject>
+		</ProjectComponent>
+		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
+	</ProjectComponents>
+</Store>
Index: rtos_arduino/trunk/examples/proj_base/r2ca.cproj
===================================================================
--- rtos_arduino/trunk/examples/proj_base/r2ca.cproj	(revision 260)
+++ rtos_arduino/trunk/examples/proj_base/r2ca.cproj	(revision 260)
@@ -0,0 +1,178 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectVersion>7.0</ProjectVersion>
+    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
+    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
+    <avrdevice>ATSAMD21G18A</avrdevice>
+    <avrdeviceseries>none</avrdeviceseries>
+    <OutputType>Executable</OutputType>
+    <Language>C</Language>
+    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
+    <OutputFileExtension>.elf</OutputFileExtension>
+    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
+    <AssemblyName>r2ca</AssemblyName>
+    <Name>r2ca</Name>
+    <RootNamespace>r2ca</RootNamespace>
+    <ToolchainFlavour>Native</ToolchainFlavour>
+    <KeepTimersRunning>true</KeepTimersRunning>
+    <OverrideVtor>false</OverrideVtor>
+    <CacheFlash>true</CacheFlash>
+    <ProgFlashFromRam>true</ProgFlashFromRam>
+    <RamSnippetAddress>0x20000000</RamSnippetAddress>
+    <UncachedRange />
+    <preserveEEPROM>true</preserveEEPROM>
+    <OverrideVtorValue>exception_table</OverrideVtorValue>
+    <BootSegment>2</BootSegment>
+    <eraseonlaunchrule>4</eraseonlaunchrule>
+    <ExternalProgrammingToolCommand />
+    <AsfFrameworkConfig>
+      <framework-data xmlns="">
+        <options />
+        <configurations />
+        <files />
+        <documentation help="" />
+        <offline-documentation help="" />
+        <dependencies>
+          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
+        </dependencies>
+      </framework-data>
+    </AsfFrameworkConfig>
+    <UseGdb>False</UseGdb>
+    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
+    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
+    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
+    <avrtoolinterface>SWD</avrtoolinterface>
+    <com_atmel_avrdbg_tool_edbg>
+      <ToolOptions>
+        <InterfaceProperties>
+          <SwdClock>2000000</SwdClock>
+        </InterfaceProperties>
+        <InterfaceName>SWD</InterfaceName>
+      </ToolOptions>
+      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
+      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
+      <ToolName>EDBG</ToolName>
+    </com_atmel_avrdbg_tool_edbg>
+    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>NDEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+</ArmGcc>
+    </ToolchainSettings>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <ToolchainSettings>
+      <ArmGcc>
+  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
+  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
+  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
+  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
+  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
+  <armgcc.compiler.symbols.DefSymbols>
+    <ListValues>
+      <Value>DEBUG</Value>
+    </ListValues>
+  </armgcc.compiler.symbols.DefSymbols>
+  <armgcc.compiler.directories.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.compiler.directories.IncludePaths>
+  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
+  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
+  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
+  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
+  <armgcc.linker.libraries.Libraries>
+    <ListValues>
+      <Value>libm</Value>
+    </ListValues>
+  </armgcc.linker.libraries.Libraries>
+  <armgcc.linker.libraries.LibrarySearchPaths>
+    <ListValues>
+      <Value>%24(ProjectDir)\Device_Startup</Value>
+    </ListValues>
+  </armgcc.linker.libraries.LibrarySearchPaths>
+  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
+  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
+  <armgcc.assembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.assembler.general.IncludePaths>
+  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
+  <armgcc.preprocessingassembler.general.IncludePaths>
+    <ListValues>
+      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
+      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.231\samd21a\include</Value>
+    </ListValues>
+  </armgcc.preprocessingassembler.general.IncludePaths>
+  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
+</ArmGcc>
+    </ToolchainSettings>
+    <UsesExternalMakeFile>True</UsesExternalMakeFile>
+    <OutputDirectory />
+    <BuildTarget>all</BuildTarget>
+    <CleanTarget>clean</CleanTarget>
+    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Include="r2ca_app.cfg">
+      <SubType>compile</SubType>
+    </None>
+    <None Include="r2ca_app.cpp">
+      <SubType>compile</SubType>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="r2ca_app.h">
+      <SubType>compile</SubType>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
+</Project>
Index: rtos_arduino/trunk/examples/proj_base/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/proj_base/rca.atsln	(revision 259)
+++ 	(revision )
@@ -1,22 +1,0 @@
-﻿
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Atmel Studio Solution File, Format Version 11.00
-VisualStudioVersion = 14.0.23107.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "rca", "rca.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|ARM = Debug|ARM
-		Release|ARM = Release|ARM
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
-		{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
Index: rtos_arduino/trunk/examples/proj_base/rca.componentinfo.xml
===================================================================
--- rtos_arduino/trunk/examples/proj_base/rca.componentinfo.xml	(revision 259)
+++ 	(revision )
@@ -1,169 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
-	<ProjectComponents>
-		<ProjectComponent z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
-			<CApiVersion></CApiVersion>
-			<CBundle></CBundle>
-			<CClass>CMSIS</CClass>
-			<CGroup>CORE</CGroup>
-			<CSub></CSub>
-			<CVariant></CVariant>
-			<CVendor>ARM</CVendor>
-			<CVersion>3.40.0</CVersion>
-			<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-			<DependentComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType z:Id="i2" i:type="ProjectComponent">
-					<CApiVersion></CApiVersion>
-					<CBundle></CBundle>
-					<CClass>Device</CClass>
-					<CGroup>Startup</CGroup>
-					<CSub></CSub>
-					<CVariant></CVariant>
-					<CVendor>Atmel</CVendor>
-					<CVersion>1.0.0</CVersion>
-					<DefaultRepoPath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs</DefaultRepoPath>
-					<DependentComponents />
-					<Description></Description>
-					<Files>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>include</Category>
-							<Condition>C</Condition>
-							<FileContentHash i:nil="true" />
-							<FileVersion></FileVersion>
-							<Name>samd21a/include</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\include\sam.h</AbsolutePath>
-							<Attribute></Attribute>
-							<Category>header</Category>
-							<Condition>C</Condition>
-							<FileContentHash>wM94EGprD6Od4xKBsAzkFQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/include/sam.h</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.c</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>dSS7TLoDl1MS+uFZPgKPWQ==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.c</Name>
-							<SelectString>Main file (.c)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\templates\main.cpp</AbsolutePath>
-							<Attribute>template</Attribute>
-							<Category>source</Category>
-							<Condition>C Exe</Condition>
-							<FileContentHash>nU+WlKcYaWh0AWBBS+WVpA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/templates/main.cpp</Name>
-							<SelectString>Main file (.cpp)</SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\system_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>Qjqe1jYsYQB+vQG2A3hhiA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/system_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\startup_samd21.c</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>source</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>pLNlIy+Llw/GLgds0gbQQA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/startup_samd21.c</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_flash.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>linkerScript</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>4xbqLG5DtSn/T8pJoWAvNA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_flash.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-						<d4p1:anyType i:type="FileInfo">
-							<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.0.222\samd21a\gcc\gcc\samd21g18a_sram.ld</AbsolutePath>
-							<Attribute>config</Attribute>
-							<Category>other</Category>
-							<Condition>GCC Exe</Condition>
-							<FileContentHash>K9GWjx6oZkcBnxrHUbvSwA==</FileContentHash>
-							<FileVersion></FileVersion>
-							<Name>samd21a/gcc/gcc/samd21g18a_sram.ld</Name>
-							<SelectString></SelectString>
-							<SourcePath></SourcePath>
-						</d4p1:anyType>
-					</Files>
-					<PackName>SAMD21_DFP</PackName>
-					<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/SAMD21_DFP/1.0.222/Atmel.SAMD21_DFP.pdsc</PackPath>
-					<PackVersion>1.0.222</PackVersion>
-					<PresentInProject>true</PresentInProject>
-					<ReferenceConditionId>ATSAMD21G18A</ReferenceConditionId>
-					<RteComponents>
-						<d4p1:string></d4p1:string>
-					</RteComponents>
-					<Status>Resolved</Status>
-					<VersionMode>Fixed</VersionMode>
-					<IsComponentInAtProject>true</IsComponentInAtProject>
-				</d4p1:anyType>
-			</DependentComponents>
-			<Description></Description>
-			<Files xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Documentation\Core\html\index.html</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>doc</Category>
-					<Condition></Condition>
-					<FileContentHash>Fm1Ae7doPh4708FZQAIEpw==</FileContentHash>
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Documentation\Core\html\index.html</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-				<d4p1:anyType i:type="FileInfo">
-					<AbsolutePath>C:/Program Files (x86)\Atmel\Studio\7.0\Packs\arm\cmsis\4.2.0\CMSIS\Include\</AbsolutePath>
-					<Attribute></Attribute>
-					<Category>include</Category>
-					<Condition></Condition>
-					<FileContentHash i:nil="true" />
-					<FileVersion></FileVersion>
-					<Name>CMSIS\Include\</Name>
-					<SelectString></SelectString>
-					<SourcePath></SourcePath>
-				</d4p1:anyType>
-			</Files>
-			<PackName>CMSIS</PackName>
-			<PackPath>C:/Program Files (x86)/Atmel/Studio/7.0/Packs/arm/cmsis/4.2.0/ARM.CMSIS.pdsc</PackPath>
-			<PackVersion>4.2.0</PackVersion>
-			<PresentInProject>true</PresentInProject>
-			<ReferenceConditionId>CMSIS Core</ReferenceConditionId>
-			<RteComponents xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
-				<d4p1:string></d4p1:string>
-			</RteComponents>
-			<Status>Resolved</Status>
-			<VersionMode>Fixed</VersionMode>
-			<IsComponentInAtProject>true</IsComponentInAtProject>
-		</ProjectComponent>
-		<ProjectComponent z:Ref="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />
-	</ProjectComponents>
-</Store>
Index: rtos_arduino/trunk/examples/proj_base/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/proj_base/rca.cproj	(revision 259)
+++ 	(revision )
@@ -1,168 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
-  <PropertyGroup>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectVersion>7.0</ProjectVersion>
-    <ToolchainName>com.Atmel.ARMGCC.C</ToolchainName>
-    <ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
-    <avrdevice>ATSAMD21G18A</avrdevice>
-    <avrdeviceseries>none</avrdeviceseries>
-    <OutputType>Executable</OutputType>
-    <Language>C</Language>
-    <OutputFileName>$(MSBuildProjectName)</OutputFileName>
-    <OutputFileExtension>.elf</OutputFileExtension>
-    <OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
-    <AssemblyName>rca</AssemblyName>
-    <Name>rca</Name>
-    <RootNamespace>rca</RootNamespace>
-    <ToolchainFlavour>Native</ToolchainFlavour>
-    <KeepTimersRunning>true</KeepTimersRunning>
-    <OverrideVtor>false</OverrideVtor>
-    <CacheFlash>true</CacheFlash>
-    <ProgFlashFromRam>true</ProgFlashFromRam>
-    <RamSnippetAddress>0x20000000</RamSnippetAddress>
-    <UncachedRange />
-    <preserveEEPROM>true</preserveEEPROM>
-    <OverrideVtorValue>exception_table</OverrideVtorValue>
-    <BootSegment>2</BootSegment>
-    <eraseonlaunchrule>4</eraseonlaunchrule>
-    <ExternalProgrammingToolCommand />
-    <AsfFrameworkConfig>
-      <framework-data xmlns="">
-        <options />
-        <configurations />
-        <files />
-        <documentation help="" />
-        <offline-documentation help="" />
-        <dependencies>
-          <content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.27.3" />
-        </dependencies>
-      </framework-data>
-    </AsfFrameworkConfig>
-    <UseGdb>False</UseGdb>
-    <avrtool>com.atmel.avrdbg.tool.edbg</avrtool>
-    <avrtoolserialnumber>FFFFFFFFFFFFFFFFFFFF</avrtoolserialnumber>
-    <avrdeviceexpectedsignature>0x10010005</avrdeviceexpectedsignature>
-    <avrtoolinterface>SWD</avrtoolinterface>
-    <com_atmel_avrdbg_tool_edbg>
-      <ToolOptions>
-        <InterfaceProperties>
-          <SwdClock>2000000</SwdClock>
-        </InterfaceProperties>
-        <InterfaceName>SWD</InterfaceName>
-      </ToolOptions>
-      <ToolType>com.atmel.avrdbg.tool.edbg</ToolType>
-      <ToolNumber>FFFFFFFFFFFFFFFFFFFF</ToolNumber>
-      <ToolName>EDBG</ToolName>
-    </com_atmel_avrdbg_tool_edbg>
-    <avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>NDEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize for size (-Os)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-</ArmGcc>
-    </ToolchainSettings>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <ToolchainSettings>
-      <ArmGcc>
-  <armgcc.common.outputfiles.hex>True</armgcc.common.outputfiles.hex>
-  <armgcc.common.outputfiles.lss>True</armgcc.common.outputfiles.lss>
-  <armgcc.common.outputfiles.eep>True</armgcc.common.outputfiles.eep>
-  <armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
-  <armgcc.common.outputfiles.srec>True</armgcc.common.outputfiles.srec>
-  <armgcc.compiler.symbols.DefSymbols>
-    <ListValues>
-      <Value>DEBUG</Value>
-    </ListValues>
-  </armgcc.compiler.symbols.DefSymbols>
-  <armgcc.compiler.directories.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.compiler.directories.IncludePaths>
-  <armgcc.compiler.optimization.level>Optimize (-O1)</armgcc.compiler.optimization.level>
-  <armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
-  <armgcc.compiler.optimization.DebugLevel>Maximum (-g3)</armgcc.compiler.optimization.DebugLevel>
-  <armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
-  <armgcc.linker.libraries.Libraries>
-    <ListValues>
-      <Value>libm</Value>
-    </ListValues>
-  </armgcc.linker.libraries.Libraries>
-  <armgcc.linker.libraries.LibrarySearchPaths>
-    <ListValues>
-      <Value>%24(ProjectDir)\Device_Startup</Value>
-    </ListValues>
-  </armgcc.linker.libraries.LibrarySearchPaths>
-  <armgcc.linker.optimization.GarbageCollectUnusedSections>True</armgcc.linker.optimization.GarbageCollectUnusedSections>
-  <armgcc.linker.miscellaneous.LinkerFlags>-Tsamd21g18a_flash.ld</armgcc.linker.miscellaneous.LinkerFlags>
-  <armgcc.assembler.debugging.DebugLevel>Default (-g)</armgcc.assembler.debugging.DebugLevel>
-  <armgcc.preprocessingassembler.general.IncludePaths>
-    <ListValues>
-      <Value>%24(PackRepoDir)\atmel\SAMD21_DFP\1.0.222\samd21a\include</Value>
-      <Value>%24(PackRepoDir)\arm\cmsis\4.2.0\CMSIS\Include\</Value>
-    </ListValues>
-  </armgcc.preprocessingassembler.general.IncludePaths>
-  <armgcc.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcc.preprocessingassembler.debugging.DebugLevel>
-</ArmGcc>
-    </ToolchainSettings>
-    <UsesExternalMakeFile>True</UsesExternalMakeFile>
-    <OutputDirectory />
-    <BuildTarget>all</BuildTarget>
-    <CleanTarget>clean</CleanTarget>
-    <ExternalMakeFilePath>Makefile</ExternalMakeFilePath>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Include="rca_app.cfg">
-      <SubType>compile</SubType>
-    </None>
-    <None Include="rca_app.cpp">
-      <SubType>compile</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="rca_app.h">
-      <SubType>compile</SubType>
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
-</Project>
Index: rtos_arduino/trunk/lib/Makefile.r2ca
===================================================================
--- rtos_arduino/trunk/lib/Makefile.r2ca	(revision 260)
+++ rtos_arduino/trunk/lib/Makefile.r2ca	(revision 260)
@@ -0,0 +1,626 @@
+#
+#  Arduinoã©ã¤ãã©ãªç¨ã®å®ç¾©
+#
+ARDUINO_LIB_DIR = $(R2CA_DIR)/arduino_lib
+
+#
+#   ã³ã¢ã©ã¤ãã©ãª
+#
+APPL_COBJS += delay.o \
+              wiring.o wiring_digital.o wiring_analog.o wiring_shift.o \
+              WInterrupts.o \
+              samd21_host.o \
+              dtostrf.o \
+              itoa.o \
+              syscalls.o \
+
+APPL_CXXOBJS += r2ca_lib.o \
+                variant.o \
+                SERCOM.o Uart.o RingBuffer.o Print.o  \
+                CDC.o HID.o USBCore.o Reset.o \
+                Stream.o \
+                wiring_pulse.o \
+                WMath.o \
+                WString.o \
+                IPAddress.o \
+                Tone.o \
+
+ifeq ($(USE_ETHERNET2), true)
+#
+#   Ethenet2ã©ã¤ãã©ãª
+#
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/Ethernet2/src/ $(R2CA_DIR)/arduino_lib/libraries/Ethernet2/src/utility
+APPL_CXXOBJS += Dhcp.o Dns.o Ethernet2.o EthernetClient.o EthernetServer.o EthernetUdp2.o Twitter.o socket.o w5500.o
+APPL_COBJS   += 
+USE_ARDUINO_SPI       = true
+endif
+
+ifeq ($(USE_NCESCAN), true)
+#
+#   NCESCANã©ã¤ãã©ãª
+#
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/NcesCan/
+APPL_CXXOBJS += mcp_can.o
+APPL_COBJS   += 
+USE_ARDUINO_SPI = true
+endif
+
+ifeq ($(USE_NAXESMOTION), true)
+#
+#   NAxesMotionã©ã¤ãã©ãª
+#
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/NAxesMotion $(R2CA_DIR)/arduino_lib/libraries/NAxesMotion/utility
+APPL_CXXOBJS += NAxisMotion.o 
+APPL_COBJS   += BNO055.o
+USE_WIRE      = true
+endif
+
+ifeq ($(USE_ARDUINO_SD), true)
+#
+#   SDã©ã¤ãã©ãª
+#
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/SD/src/ $(R2CA_DIR)/arduino_lib/libraries/SD/src/utility
+APPL_CXXOBJS += File.o SD.o Sd2Card.o SdFile.o SdVolume.o 
+APPL_COBJS   += 
+endif
+
+ifeq ($(USE_ARDUINO_TFT), true)
+#
+#   TFTã©ã¤ãã©ãª
+#
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/TFT/src/ $(R2CA_DIR)/arduino_lib/libraries/TFT/src/utility
+APPL_CXXOBJS += TFT.o Adafruit_GFX.o Adafruit_ST7735.o
+APPL_COBJS   += glcdfont.o
+endif
+
+ifeq ($(USE_WIRE), true)
+#
+#   Wireã©ã¤ãã©ãª
+#
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/hardware/arduino/samd/libraries/Wire/
+APPL_CXXOBJS += Wire.o
+APPL_COBJS   += 
+endif
+
+ifeq ($(USE_ARDUINO_SPI), true)
+#
+#   SPIã©ã¤ãã©ãª
+#
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/hardware/arduino/samd/libraries/SPI/
+APPL_CXXOBJS += SPI.o
+APPL_COBJS   += 
+endif
+
+ifeq ($(USE_ARDUINO_RTC), true)
+#
+#   RTCã©ã¤ãã©ãª
+#
+APPL_DIR     += $(R2CA_DIR)/arduino_lib/libraries/RTC/src/
+APPL_CXXOBJS += RTCInt.o
+APPL_COBJS   += 
+endif
+
+
+APPL_DIR += $(R2CA_DIR)/lib \
+            $(ARDUINO_LIB_DIR)/hardware/arduino/samd/cores/arduino/ \
+            $(ARDUINO_LIB_DIR)/hardware/arduino/samd/cores/arduino/avr \
+            $(ARDUINO_LIB_DIR)/hardware/arduino/samd/cores/arduino/USB \
+            $(ARDUINO_LIB_DIR)/hardware/arduino/samd/variants/arduino_zero/ 
+
+CDEFS += -Dprintf=iprintf \
+         -DF_CPU=48000000L \
+         -DARDUINO=10710 \
+         -DARDUINO_SAM_ZERO \
+         -DARDUINO_ARCH_SAMD \
+         -D__SAMD21G18A__ \
+         -DUSB_VID=0x2a03 \
+         -DUSB_PID=0x804f \
+         -DUSBCON \
+         -DUSB_MANUFACTURER= \
+         -DTOPPERS_WITH_ARDUINO
+
+CXXLIBS += -lm -lstdc++
+
+CXXFLAGS = -fno-rtti -fno-exceptions
+
+vpath %.cpp $(APPL_DIR) $(TOPPERS_ARDUINO_DIR)/lib
+
+INCLUDES += -I$(TOPPERS_ARDUINO_DIR)/lib
+
+#
+#  Serialã®æ±ã
+#
+ifeq ($(ARDUINO_SERIAL), NOUSE_SERIAL)
+	USE_LOGTASK = true
+endif
+
+ifeq ($(ARDUINO_SERIAL), USE_SERIAL)
+	CDEFS += -DTOPPERS_USE_ARDUINO_SERIAL
+endif
+
+#
+#  ã¿ã¼ã²ããç¥ç§°ã®å®ç¾©
+#
+TARGET = arduino_m0_gcc
+
+#
+#  ãã­ã°ã©ãã³ã°è¨èªã®å®ç¾©
+#
+SRCLANG = c
+ifeq ($(SRCLANG),c)
+  LIBS = -lc
+endif
+ifeq ($(SRCLANG),c++)
+  USE_CXX = true
+  CXXLIBS = -lstdc++ -lm -lc
+  CXXRTS = cxxrt.o newlibrt.o
+endif
+
+#
+#  ãªãã¸ã§ã¯ããã¡ã¤ã«åã®æ¡å¼µå­ã®è¨­å®
+#
+OBJEXT = elf
+
+#
+#  å®è¡ç°å¢ã®å®ç¾©ï¼ã¿ã¼ã²ããä¾å­ã«ä¸æ¸ããããå ´åãããï¼
+#
+DBGENV := 
+
+#
+#  ã«ã¼ãã«ã©ã¤ãã©ãªï¼libkernel.aï¼ã®ãã£ã¬ã¯ããªå
+#  ï¼ã«ã¼ãã«ã©ã¤ãã©ãªãmakeå¯¾è±¡ã«ããæã¯ï¼ç©ºã«å®ç¾©ããï¼
+#
+KERNEL_LIB = 
+
+#
+#  ã«ã¼ãã«ãé¢æ°åä½ã§ã³ã³ãã¤ã«ãããã©ããã®å®ç¾©
+#
+KERNEL_FUNCOBJS = 
+
+#
+#  ãã¬ã¼ã¹ã­ã°ãåå¾ãããã©ããã®å®ç¾©
+#
+ENABLE_TRACE = 
+
+#
+#  ã¦ã¼ãã£ãªãã£ãã­ã°ã©ã ã®åç§°
+#
+PERL = /usr/bin/perl
+CFG = "$(SRCDIR)/cfg/cfg/cfg"
+
+#
+#  ãªãã¸ã§ã¯ããã¡ã¤ã«åã®å®ç¾©
+#
+OBJNAME = r2ca
+ifdef OBJEXT
+  OBJFILE = $(OBJNAME).$(OBJEXT)
+  CFG1_OUT = cfg1_out.$(OBJEXT)
+else
+  OBJFILE = $(OBJNAME)
+  CFG1_OUT = cfg1_out
+endif
+
+#
+#  ã¿ã¼ã²ããä¾å­é¨ã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+TARGETDIR = $(SRCDIR)/target/$(TARGET)
+
+#
+#  ã¿ã¼ã²ããä¾å­ã®å®ç¾©ã®ã¤ã³ã¯ã«ã¼ã
+#
+include $(TARGETDIR)/Makefile.target
+
+#
+#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿é¢ä¿ã®å¤æ°ã®å®ç¾©
+#
+CFG_TABS := --api-table $(SRCDIR)/kernel/kernel_api.csv \
+			--cfg1-def-table $(SRCDIR)/kernel/kernel_def.csv $(CFG_TABS)
+
+CFG_ASMOBJS := $(CFG_ASMOBJS)
+CFG_COBJS := kernel_cfg.o $(CFG_COBJS)
+CFG_OBJS := $(CFG_ASMOBJS) $(CFG_COBJS)
+CFG2_OUT_SRCS := kernel_cfg.h kernel_cfg.c $(CFG2_OUT_SRCS)
+
+#
+#  å
+±éã³ã³ãã¤ã«ãªãã·ã§ã³ã®å®ç¾©
+#
+COPTS := $(COPTS) -g -MD
+ifndef OMIT_WARNING_ALL
+  COPTS := $(COPTS) -Wall
+endif
+ifndef OMIT_OPTIMIZATION
+  COPTS := $(COPTS) -Os
+endif
+CDEFS := $(CDEFS) 
+INCLUDES := -I. -I$(SRCDIR)/include -I$(SRCDIR)/arch -I$(SRCDIR) $(INCLUDES)
+LDFLAGS := $(LDFLAGS) 
+CFG1_OUT_LDFLAGS := $(CFG1_OUT_LDFLAGS) 
+LIBS := $(LIBS) $(CXXLIBS)
+CFLAGS = $(COPTS) $(CDEFS) $(INCLUDES)
+
+#
+#  ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã«é¢ããå®ç¾©
+#
+APPL_DIR += $(SRCDIR)/library
+APPL_COBJS := $(APPL_COBJS) log_output.o vasyslog.o t_perror.o strerror.o
+ifdef APPL_DIR
+  INCLUDES := $(INCLUDES) $(foreach dir,$(APPL_DIR),-I$(dir))
+endif
+
+#
+#  ã·ã¹ãã ãµã¼ãã¹ã«é¢ããå®ç¾©
+#
+SYSSVC_DIR := $(SYSSVC_DIR) $(SRCDIR)/syssvc $(SRCDIR)/library
+SYSSVC_ASMOBJS := $(SYSSVC_ASMOBJS)
+SYSSVC_COBJS := $(SYSSVC_COBJS) banner.o syslog.o \
+				 $(CXXRTS)
+
+ifeq ($(USE_LOGTASK),true)
+	SYSSVC_COBJS := $(SYSSVC_COBJS) serial.o logtask.o
+	CDEFS := $(CDEFS) -DTOPPERS_USE_LOGTASK
+endif
+
+SYSSVC_CFLAGS := $(SYSSVC_CFLAGS)
+SYSSVC_LIBS := $(SYSSVC_LIBS)
+INCLUDES := $(INCLUDES)
+
+#
+#  ã«ã¼ãã«ã«é¢ããå®ç¾©
+#
+#  KERNEL_ASMOBJS: ã«ã¼ãã«ã©ã¤ãã©ãªã«å«ããï¼ã½ã¼ã¹ãã¢ã»ã³ããªè¨èªã®
+#				   ãªãã¸ã§ã¯ããã¡ã¤ã«ï¼
+#  KERNEL_COBJS: ã«ã¼ãã«ã®ã©ã¤ãã©ãªã«å«ããï¼ã½ã¼ã¹ãCè¨èªã§ï¼ã½ã¼ã¹
+#				 ãã¡ã¤ã«ã¨1å¯¾1ã«å¯¾å¿ãããªãã¸ã§ã¯ããã¡ã¤ã«ï¼
+#  KERNEL_LCSRCS: ã«ã¼ãã«ã®ã©ã¤ãã©ãªã«å«ããCè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ã§ï¼
+#				  1ã¤ã®ã½ã¼ã¹ãã¡ã¤ã«ããè¤æ°ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ãç
+#				  æãããã®ï¼
+#  KERNEL_LCOBJS: ä¸ã®ã½ã¼ã¹ãã¡ã¤ã«ããçæããããªãã¸ã§ã¯ããã¡ã¤ã«ï¼
+#  KERNEL_AUX_COBJS: ã­ã¼ãã¢ã¸ã¥ã¼ã«ã«å«ããªããï¼ã«ã¼ãã«ã®ã½ã¼ã¹ãã¡
+#					 ã¤ã«ã¨åããªãã·ã§ã³ãé©ç¨ãã¦ã³ã³ãã¤ã«ãã¹ãï¼ã½ã¼
+#					 ã¹ãCè¨èªã®ãªãã¸ã§ã¯ããã¡ã¤ã«ï¼
+#
+KERNEL_DIR := $(KERNEL_DIR) $(SRCDIR)/kernel
+KERNEL_ASMOBJS := $(KERNEL_ASMOBJS)
+KERNEL_COBJS := $(KERNEL_COBJS)
+KERNEL_CFLAGS := $(KERNEL_CFLAGS) -I$(SRCDIR)/kernel
+ifdef OMIT_MAKEOFFSET
+  OFFSET_H =
+else
+  OFFSET_H = offset.h
+ifndef OFFSET_TF
+  KERNEL_AUX_COBJS := $(KERNEL_AUX_COBJS) makeoffset.o
+endif
+endif
+
+#
+#  ã¿ã¼ã²ãããã¡ã¤ã«ï¼è¤æ°ãåæã«é¸æãã¦ã¯ãªããªãï¼
+#
+all: $(OBJFILE)
+#all: $(OBJNAME).bin
+#all: $(OBJNAME).srec
+
+##### ä»¥ä¸ã¯ç·¨éããªããã¨ #####
+
+#
+#  ç°å¢ã«ä¾å­ããã³ã³ãã¤ã«ãªãã·ã§ã³ã®å®ç¾©
+#
+ifdef DBGENV
+  CDEFS := $(CDEFS) -D$(DBGENV)
+endif
+
+#
+#  å®è¡ç°å¢ã®å¤å®
+#
+ifneq (,$(findstring /cygdrive/,$(PATH)))
+    UNAME := Cygwin
+else
+ifeq ($(OS),Windows_NT)
+    UNAME := Windows
+else
+ifeq ($(UNAME),Linux)
+    UNAME := Linux
+ifeq ($(UNAME),Darwin)
+    UNAME := Darwin
+endif
+endif
+endif
+endif
+
+#
+#  ã«ã¼ãã«ã®ãã¡ã¤ã«æ§æã®å®ç¾©
+#
+include $(SRCDIR)/kernel/Makefile.kernel
+ifdef KERNEL_FUNCOBJS
+  KERNEL_LCSRCS := $(KERNEL_FCSRCS)
+  KERNEL_LCOBJS := $(foreach file,$(KERNEL_FCSRCS),$($(file:.c=)))
+else
+  KERNEL_CFLAGS := -DALLFUNC $(KERNEL_CFLAGS)
+  KERNEL_COBJS := $(KERNEL_COBJS) \
+					$(foreach file,$(KERNEL_FCSRCS),$(file:.c=.o))
+endif
+
+#
+#  ã½ã¼ã¹ãã¡ã¤ã«ã®ãããã£ã¬ã¯ããªã«é¢ããå®ç¾©
+#
+vpath %.c $(KERNEL_DIR) $(SYSSVC_DIR) $(APPL_DIR)
+vpath %.S $(KERNEL_DIR) $(SYSSVC_DIR) $(APPL_DIR)
+vpath %.cfg $(APPL_DIR)
+
+#
+#  ã³ã³ãã¤ã«ã®ããã®å¤æ°ã®å®ç¾©
+#
+KERNEL_LIB_OBJS = $(KERNEL_ASMOBJS) $(KERNEL_COBJS) $(KERNEL_LCOBJS)
+SYSSVC_OBJS = $(SYSSVC_ASMOBJS) $(SYSSVC_COBJS)
+APPL_OBJS = $(APPL_ASMOBJS) $(APPL_COBJS) $(APPL_CXXOBJS)
+ALL_OBJS = $(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \
+											$(END_OBJS) $(HIDDEN_OBJS)
+ifdef KERNEL_LIB
+  ALL_LIBS = $(APPL_LIBS) $(SYSSVC_LIBS) -lkernel $(LIBS)
+  LIBS_DEP = $(filter %.a,$(ALL_LIBS)) $(KERNEL_LIB)/libkernel.a
+  LDFLAGS := $(LDFLAGS) -L$(KERNEL_LIB)
+  REALCLEAN_FILES := libkernel.a $(REALCLEAN_FILES)
+else
+  ALL_LIBS = $(APPL_LIBS) $(SYSSVC_LIBS) libkernel.a $(LIBS)
+  LIBS_DEP = $(filter %.a,$(ALL_LIBS))
+endif
+
+ifdef TEXT_START_ADDRESS
+  LDFLAGS := $(LDFLAGS) -Wl,-Ttext,$(TEXT_START_ADDRESS)
+  CFG1_OUT_LDFLAGS := $(CFG1_OUT_LDFLAGS) -Wl,-Ttext,$(TEXT_START_ADDRESS)
+endif
+ifdef DATA_START_ADDRESS
+  LDFLAGS := $(LDFLAGS) -Wl,-Tdata,$(DATA_START_ADDRESS)
+  CFG1_OUT_LDFLAGS := $(CFG1_OUT_LDFLAGS) -Wl,-Tdata,$(DATA_START_ADDRESS)
+endif
+ifdef LDSCRIPT
+  LDFLAGS := $(LDFLAGS) -T $(LDSCRIPT)
+  CFG1_OUT_LDFLAGS := $(CFG1_OUT_LDFLAGS) -T $(LDSCRIPT)
+endif
+
+#
+#  ãªãã»ãããã¡ã¤ã«ï¼offset.hï¼ã®çæè¦å
+#
+ifdef OFFSET_TF
+offset.h: $(APPL_CFG) kernel_cfg.timestamp
+	$(CFG) --pass 3 --kernel asp $(INCLUDES) \
+				--rom-image cfg1_out.srec --symbol-table cfg1_out.syms \
+				-T $(OFFSET_TF) $(CFG_TABS) $<
+else
+offset.h: makeoffset.s $(SRCDIR)/utils/genoffset
+	$(PERL) $(SRCDIR)/utils/genoffset makeoffset.s > offset.h
+endif
+
+#
+#  ã«ã¼ãã«ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã®çæ
+#
+cfg1_out.c: $(APPL_CFG)
+	$(CFG) --pass 1 --kernel asp $(INCLUDES) $(CFG_TABS) $< 
+	$(CFG) -M cfg1_out.c $(INCLUDES) $< > cfg1_out.c.d
+
+$(CFG2_OUT_SRCS): kernel_cfg.timestamp
+kernel_cfg.timestamp: $(APPL_CFG) \
+						$(START_OBJS) cfg1_out.o $(END_OBJS) $(HIDDEN_OBJS)
+	$(LINK) $(CFLAGS) $(CFG1_OUT_LDFLAGS) -o $(CFG1_OUT) \
+						$(START_OBJS) cfg1_out.o $(END_OBJS)
+	$(NM) -n $(CFG1_OUT) > cfg1_out.syms
+	$(OBJCOPY) -O srec -S $(CFG1_OUT) cfg1_out.srec
+	$(CFG) --pass 2 --kernel asp $(INCLUDES) \
+				-T $(TARGETDIR)/target.tf $(CFG_TABS) $<
+ifeq ($(UNAME), Windows)
+	copy /B kernel_cfg.c +,,
+	echo  -n > kernel_cfg.timestamp
+else
+	touch -r kernel_cfg.c kernel_cfg.timestamp
+endif
+
+#
+#  ã«ã¼ãã«ã©ã¤ãã©ãªãã¡ã¤ã«ã®çæ
+#
+libkernel.a: $(OFFSET_H) $(KERNEL_LIB_OBJS)
+	rm -f libkernel.a
+	$(AR) -rcs libkernel.a $(KERNEL_LIB_OBJS)
+	$(RANLIB) libkernel.a
+
+#
+#  ç¹å¥ãªä¾å­é¢ä¿ã®å®ç¾©
+#
+banner.o: kernel_cfg.timestamp $(filter-out banner.o,$(ALL_OBJS)) $(LIBS_DEP)
+
+#
+#  å
+¨ä½ã®ãªã³ã¯
+#
+$(OBJFILE): $(APPL_CFG) kernel_cfg.timestamp $(ALL_OBJS) $(LIBS_DEP)
+	$(LINK) $(CFLAGS) $(LDFLAGS) -o $(OBJFILE) $(START_OBJS) \
+			$(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) $(ALL_LIBS) $(END_OBJS)
+	$(NM) -n $(OBJFILE) > $(OBJNAME).syms
+	$(OBJCOPY) -O srec -S $(OBJFILE) $(OBJNAME).srec
+	$(CFG) --pass 3 --kernel asp $(INCLUDES) \
+				--rom-image $(OBJNAME).srec --symbol-table $(OBJNAME).syms \
+				-T $(TARGETDIR)/target_check.tf $(CFG_TABS) $<
+
+#
+#  ãã¤ããªãã¡ã¤ã«ã®çæ
+#
+$(OBJNAME).bin: $(OBJFILE)
+	$(OBJCOPY) -O binary -R .bss -S $(OBJFILE) $(OBJNAME).bin
+
+#
+#  Sã¬ã³ã¼ããã¡ã¤ã«ã®çæ
+#
+$(OBJNAME).srec: $(OBJFILE)
+	$(OBJCOPY) -O srec -S $(OBJFILE) $(OBJNAME).srec
+
+#
+#  ã³ã³ãã¤ã«çµæã®æ¶å»
+#
+.PHONY: clean
+clean:
+	rm -f $(OBJFILE) $(OBJNAME).syms $(OBJNAME).srec $(OBJNAME).bin $(OBJFILE).shadow
+	rm -f kernel_cfg.timestamp $(CFG2_OUT_SRCS)
+	rm -f cfg1_out.c $(CFG1_OUT) cfg1_out.syms cfg1_out.srec
+	rm -f kernel_cfg.timestamp $(CFG2_OUT_SRCS);
+	rm -f cfg1_out.c cfg1_out.o $(CFG1_OUT) cfg1_out.syms cfg1_out.srec;
+	rm -f makeoffset.s offset.h;
+ifndef KERNEL_LIB
+	rm -f libkernel.a
+endif
+	rm -f makeoffset.s offset.h
+	rm -f \#* *~ *.o *.d $(CLEAN_FILES)
+
+.PHONY: cleankernel
+cleankernel:
+	rm -rf $(KERNEL_LIB_OBJS)
+	rm -f makeoffset.s offset.h
+
+.PHONY: cleandep
+cleandep:
+	if ! [ -f Makefile.depend ]; then \
+		rm -f kernel_cfg.timestamp $(CFG2_OUT_SRCS); \
+		rm -f cfg1_out.c cfg1_out.o $(CFG1_OUT) cfg1_out.syms cfg1_out.srec; \
+		rm -f makeoffset.s offset.h; \
+	fi
+	rm -f Makefile.depend
+
+.PHONY: realclean
+realclean: cleandep clean
+	rm -f $(REALCLEAN_FILES)
+
+#
+#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãçæãããã¡ã¤ã«ã®ã³ã³ãã¤ã«ã«ã¼ã«ã¨ä¾å­é¢ä¿ä½æ
+#  ã«ã¼ã«ã®å®ç¾©
+#
+#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãçæãããã¡ã¤ã«ã¯ï¼ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ç¨ï¼
+#  ã·ã¹ãã ãµã¼ãã¹ç¨ï¼ã«ã¼ãã«ç¨ã®ãã¹ã¦ã®ãªãã·ã§ã³ãä»ãã¦ã³ã³ãã¤ã«
+#  ããï¼
+#
+ALL_CFG_COBJS = $(CFG_COBJS) cfg1_out.o
+ALL_CFG_ASMOBJS = $(CFG_ASMOBJS)
+CFG_CFLAGS = $(APPL_CFLAGS) $(SYSSVC_CFLAGS) $(KERNEL_CFLAGS)
+
+$(ALL_CFG_COBJS): %.o: %.c
+	$(CC) -c $(CFLAGS) $(CFG_CFLAGS) $<
+
+#$(ALL_CFG_COBJS:.o=.s): %.s: %.c
+#	$(CC) -S $(CFLAGS) $(CFG_CFLAGS) $<
+
+$(ALL_CFG_ASMOBJS): %.o: %.S
+	$(CC) -c $(CFLAGS) $(CFG_CFLAGS) $<
+
+#
+#  ä¾å­é¢ä¿ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ã
+#
+-include *.d
+
+#
+#  éçºãã¼ã«ã®ã³ãã³ãåã®å®ç¾©
+#
+ifeq ($(TOOL),gcc)
+  #
+  #  GNUéçºç°å¢ç¨
+  #
+  ifdef GCC_TARGET
+    GCC_TARGET_PREFIX = $(GCC_TARGET)-
+  else
+    GCC_TARGET_PREFIX =
+  endif
+#
+#  Windowsã®å ´åã¯ãã«ãã¹ã«ãã
+#
+ifeq ($(UNAME),Windows)
+  GCC_PATH_WIN = $(ARDUINO_BASE_DIR_WIN)\hardware\tools\gcc-arm-none-eabi-4.8.3-2014q1\bin
+  CC = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)gcc"
+  CXX = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)g++"
+  AS = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)as"
+  LD = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)ld"
+  AR = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)ar"
+  NM = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)nm"
+  RANLIB = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)ranlib"
+  OBJCOPY = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)objcopy"
+  OBJDUMP = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)objdump"
+else
+  CC = $(GCC_TARGET_PREFIX)gcc
+  CXX = $(GCC_TARGET_PREFIX)g++
+  AS = $(GCC_TARGET_PREFIX)as
+  LD = $(GCC_TARGET_PREFIX)ld
+  AR = $(GCC_TARGET_PREFIX)ar
+  NM = $(GCC_TARGET_PREFIX)nm
+  RANLIB = $(GCC_TARGET_PREFIX)ranlib
+  OBJCOPY = $(GCC_TARGET_PREFIX)objcopy
+  OBJDUMP = $(GCC_TARGET_PREFIX)objdump
+endif
+endif
+
+ifdef USE_CXX
+  LINK = $(CXX)
+else
+  LINK = $(CC)
+endif
+
+#
+#  ã³ã³ãã¤ã«ã«ã¼ã«ã®å®ç¾©
+#
+KERNEL_ALL_COBJS = $(KERNEL_COBJS) $(KERNEL_AUX_COBJS)
+
+$(KERNEL_ALL_COBJS): %.o: %.c
+	$(CC) -c $(CFLAGS) $(KERNEL_CFLAGS) $<
+
+#$(KERNEL_ALL_COBJS:.o=.s): %.s: %.c
+#	$(CC) -S $(CFLAGS) $(KERNEL_CFLAGS) $<
+
+$(KERNEL_LCOBJS): %.o:
+	$(CC) -DTOPPERS_$(*F) -o $@ -c $(CFLAGS) $(KERNEL_CFLAGS) $<
+
+#$(KERNEL_LCOBJS:.o=.s): %.s:
+#	$(CC) -DTOPPERS_$(*F) -o $@ -S $(CFLAGS) $(KERNEL_CFLAGS) $<
+
+$(KERNEL_ASMOBJS): %.o: %.S
+	$(CC) -c $(CFLAGS) $(KERNEL_CFLAGS) $<
+
+$(SYSSVC_COBJS): %.o: %.c
+	$(CC) -c $(CFLAGS) $(SYSSVC_CFLAGS) $<
+
+#$(SYSSVC_COBJS:.o=.s): %.s: %.c
+#	$(CC) -S $(CFLAGS) $(SYSSVC_CFLAGS) $<
+
+$(SYSSVC_ASMOBJS): %.o: %.S
+	$(CC) -c $(CFLAGS) $(SYSSVC_CFLAGS) $<
+
+$(APPL_COBJS): %.o: %.c
+	$(CC) -c $(CFLAGS) $(APPL_CFLAGS) $<
+
+#$(APPL_COBJS:.o=.s): %.s: %.c
+#	$(CC) -S $(CFLAGS) $(APPL_CFLAGS) $<
+
+$(APPL_CXXOBJS): %.o: %.cpp
+	$(CXX) -c $(CFLAGS) $(APPL_CFLAGS) $(CXXFLAGS) $<
+
+#$(APPL_CXXOBJS:.o=.s): %.s: %.cpp
+#	$(CXX) -S $(CFLAGS) $(APPL_CFLAGS) $(CXXFLAGS) $<
+
+$(APPL_ASMOBJS): %.o: %.S
+	$(CC) -c $(CFLAGS) $(APPL_CFLAGS) $<
+
+#
+#  ããã©ã«ãã³ã³ãã¤ã«ã«ã¼ã«ãä¸æ¸ã
+#
+%.o: %.c
+	@echo "*** Default compile rules should not be used."
+	$(CC) -c $(CFLAGS) $<
+
+#%.s: %.c
+#	@echo "*** Default compile rules should not be used."
+#	$(CC) -S $(CFLAGS) $<
+
+%.o: %.cpp
+	@echo "*** Default compile rules should not be used."
+	$(CXX) -c $(CFLAGS) $(CXXFLAGS) $<
+
+#%.s: %.cpp
+#	@echo "*** Default compile rules should not be used."
+#	$(CXX) -S $(CFLAGS) $(CXXFLAGS) $<
+
+%.o: %.S
+	@echo "*** Default compile rules should not be used."
+	$(CC) -c $(CFLAGS) $<
Index: rtos_arduino/trunk/lib/Makefile.rca
===================================================================
--- rtos_arduino/trunk/lib/Makefile.rca	(revision 259)
+++ 	(revision )
@@ -1,626 +1,0 @@
-#
-#  Arduinoã©ã¤ãã©ãªç¨ã®å®ç¾©
-#
-ARDUINO_LIB_DIR = $(RCA_DIR)/arduino_lib
-
-#
-#   ã³ã¢ã©ã¤ãã©ãª
-#
-APPL_COBJS += delay.o \
-              wiring.o wiring_digital.o wiring_analog.o wiring_shift.o \
-              WInterrupts.o \
-              samd21_host.o \
-              dtostrf.o \
-              itoa.o \
-              syscalls.o \
-
-APPL_CXXOBJS += rca_lib.o \
-                variant.o \
-                SERCOM.o Uart.o RingBuffer.o Print.o  \
-                CDC.o HID.o USBCore.o Reset.o \
-                Stream.o \
-                wiring_pulse.o \
-                WMath.o \
-                WString.o \
-                IPAddress.o \
-                Tone.o \
-
-ifeq ($(USE_ETHERNET2), true)
-#
-#   Ethenet2ã©ã¤ãã©ãª
-#
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/Ethernet2/src/ $(RCA_DIR)/arduino_lib/libraries/Ethernet2/src/utility
-APPL_CXXOBJS += Dhcp.o Dns.o Ethernet2.o EthernetClient.o EthernetServer.o EthernetUdp2.o Twitter.o socket.o w5500.o
-APPL_COBJS   += 
-USE_ARDUINO_SPI       = true
-endif
-
-ifeq ($(USE_NCESCAN), true)
-#
-#   NCESCANã©ã¤ãã©ãª
-#
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/NcesCan/
-APPL_CXXOBJS += mcp_can.o
-APPL_COBJS   += 
-USE_ARDUINO_SPI = true
-endif
-
-ifeq ($(USE_NAXESMOTION), true)
-#
-#   NAxesMotionã©ã¤ãã©ãª
-#
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/NAxesMotion $(RCA_DIR)/arduino_lib/libraries/NAxesMotion/utility
-APPL_CXXOBJS += NAxisMotion.o 
-APPL_COBJS   += BNO055.o
-USE_WIRE      = true
-endif
-
-ifeq ($(USE_ARDUINO_SD), true)
-#
-#   SDã©ã¤ãã©ãª
-#
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/SD/src/ $(RCA_DIR)/arduino_lib/libraries/SD/src/utility
-APPL_CXXOBJS += File.o SD.o Sd2Card.o SdFile.o SdVolume.o 
-APPL_COBJS   += 
-endif
-
-ifeq ($(USE_ARDUINO_TFT), true)
-#
-#   TFTã©ã¤ãã©ãª
-#
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/TFT/src/ $(RCA_DIR)/arduino_lib/libraries/TFT/src/utility
-APPL_CXXOBJS += TFT.o Adafruit_GFX.o Adafruit_ST7735.o
-APPL_COBJS   += glcdfont.o
-endif
-
-ifeq ($(USE_WIRE), true)
-#
-#   Wireã©ã¤ãã©ãª
-#
-APPL_DIR     += $(RCA_DIR)/arduino_lib/hardware/arduino/samd/libraries/Wire/
-APPL_CXXOBJS += Wire.o
-APPL_COBJS   += 
-endif
-
-ifeq ($(USE_ARDUINO_SPI), true)
-#
-#   SPIã©ã¤ãã©ãª
-#
-APPL_DIR     += $(RCA_DIR)/arduino_lib/hardware/arduino/samd/libraries/SPI/
-APPL_CXXOBJS += SPI.o
-APPL_COBJS   += 
-endif
-
-ifeq ($(USE_ARDUINO_RTC), true)
-#
-#   RTCã©ã¤ãã©ãª
-#
-APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/RTC/src/
-APPL_CXXOBJS += RTCInt.o
-APPL_COBJS   += 
-endif
-
-
-APPL_DIR += $(RCA_DIR)/lib \
-            $(ARDUINO_LIB_DIR)/hardware/arduino/samd/cores/arduino/ \
-            $(ARDUINO_LIB_DIR)/hardware/arduino/samd/cores/arduino/avr \
-            $(ARDUINO_LIB_DIR)/hardware/arduino/samd/cores/arduino/USB \
-            $(ARDUINO_LIB_DIR)/hardware/arduino/samd/variants/arduino_zero/ 
-
-CDEFS += -Dprintf=iprintf \
-         -DF_CPU=48000000L \
-         -DARDUINO=10710 \
-         -DARDUINO_SAM_ZERO \
-         -DARDUINO_ARCH_SAMD \
-         -D__SAMD21G18A__ \
-         -DUSB_VID=0x2a03 \
-         -DUSB_PID=0x804f \
-         -DUSBCON \
-         -DUSB_MANUFACTURER= \
-         -DTOPPERS_WITH_ARDUINO
-
-CXXLIBS += -lm -lstdc++
-
-CXXFLAGS = -fno-rtti -fno-exceptions
-
-vpath %.cpp $(APPL_DIR) $(TOPPERS_ARDUINO_DIR)/lib
-
-INCLUDES += -I$(TOPPERS_ARDUINO_DIR)/lib
-
-#
-#  Serialã®æ±ã
-#
-ifeq ($(ARDUINO_SERIAL), NOUSE_SERIAL)
-	USE_LOGTASK = true
-endif
-
-ifeq ($(ARDUINO_SERIAL), USE_SERIAL)
-	CDEFS += -DTOPPERS_USE_ARDUINO_SERIAL
-endif
-
-#
-#  ã¿ã¼ã²ããç¥ç§°ã®å®ç¾©
-#
-TARGET = arduino_m0_gcc
-
-#
-#  ãã­ã°ã©ãã³ã°è¨èªã®å®ç¾©
-#
-SRCLANG = c
-ifeq ($(SRCLANG),c)
-  LIBS = -lc
-endif
-ifeq ($(SRCLANG),c++)
-  USE_CXX = true
-  CXXLIBS = -lstdc++ -lm -lc
-  CXXRTS = cxxrt.o newlibrt.o
-endif
-
-#
-#  ãªãã¸ã§ã¯ããã¡ã¤ã«åã®æ¡å¼µå­ã®è¨­å®
-#
-OBJEXT = elf
-
-#
-#  å®è¡ç°å¢ã®å®ç¾©ï¼ã¿ã¼ã²ããä¾å­ã«ä¸æ¸ããããå ´åãããï¼
-#
-DBGENV := 
-
-#
-#  ã«ã¼ãã«ã©ã¤ãã©ãªï¼libkernel.aï¼ã®ãã£ã¬ã¯ããªå
-#  ï¼ã«ã¼ãã«ã©ã¤ãã©ãªãmakeå¯¾è±¡ã«ããæã¯ï¼ç©ºã«å®ç¾©ããï¼
-#
-KERNEL_LIB = 
-
-#
-#  ã«ã¼ãã«ãé¢æ°åä½ã§ã³ã³ãã¤ã«ãããã©ããã®å®ç¾©
-#
-KERNEL_FUNCOBJS = 
-
-#
-#  ãã¬ã¼ã¹ã­ã°ãåå¾ãããã©ããã®å®ç¾©
-#
-ENABLE_TRACE = 
-
-#
-#  ã¦ã¼ãã£ãªãã£ãã­ã°ã©ã ã®åç§°
-#
-PERL = /usr/bin/perl
-CFG = "$(SRCDIR)/cfg/cfg/cfg"
-
-#
-#  ãªãã¸ã§ã¯ããã¡ã¤ã«åã®å®ç¾©
-#
-OBJNAME = rca
-ifdef OBJEXT
-  OBJFILE = $(OBJNAME).$(OBJEXT)
-  CFG1_OUT = cfg1_out.$(OBJEXT)
-else
-  OBJFILE = $(OBJNAME)
-  CFG1_OUT = cfg1_out
-endif
-
-#
-#  ã¿ã¼ã²ããä¾å­é¨ã®ãã£ã¬ã¯ããªã®å®ç¾©
-#
-TARGETDIR = $(SRCDIR)/target/$(TARGET)
-
-#
-#  ã¿ã¼ã²ããä¾å­ã®å®ç¾©ã®ã¤ã³ã¯ã«ã¼ã
-#
-include $(TARGETDIR)/Makefile.target
-
-#
-#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿é¢ä¿ã®å¤æ°ã®å®ç¾©
-#
-CFG_TABS := --api-table $(SRCDIR)/kernel/kernel_api.csv \
-			--cfg1-def-table $(SRCDIR)/kernel/kernel_def.csv $(CFG_TABS)
-
-CFG_ASMOBJS := $(CFG_ASMOBJS)
-CFG_COBJS := kernel_cfg.o $(CFG_COBJS)
-CFG_OBJS := $(CFG_ASMOBJS) $(CFG_COBJS)
-CFG2_OUT_SRCS := kernel_cfg.h kernel_cfg.c $(CFG2_OUT_SRCS)
-
-#
-#  å
-±éã³ã³ãã¤ã«ãªãã·ã§ã³ã®å®ç¾©
-#
-COPTS := $(COPTS) -g -MD
-ifndef OMIT_WARNING_ALL
-  COPTS := $(COPTS) -Wall
-endif
-ifndef OMIT_OPTIMIZATION
-  COPTS := $(COPTS) -Os
-endif
-CDEFS := $(CDEFS) 
-INCLUDES := -I. -I$(SRCDIR)/include -I$(SRCDIR)/arch -I$(SRCDIR) $(INCLUDES)
-LDFLAGS := $(LDFLAGS) 
-CFG1_OUT_LDFLAGS := $(CFG1_OUT_LDFLAGS) 
-LIBS := $(LIBS) $(CXXLIBS)
-CFLAGS = $(COPTS) $(CDEFS) $(INCLUDES)
-
-#
-#  ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ã«é¢ããå®ç¾©
-#
-APPL_DIR += $(SRCDIR)/library
-APPL_COBJS := $(APPL_COBJS) log_output.o vasyslog.o t_perror.o strerror.o
-ifdef APPL_DIR
-  INCLUDES := $(INCLUDES) $(foreach dir,$(APPL_DIR),-I$(dir))
-endif
-
-#
-#  ã·ã¹ãã ãµã¼ãã¹ã«é¢ããå®ç¾©
-#
-SYSSVC_DIR := $(SYSSVC_DIR) $(SRCDIR)/syssvc $(SRCDIR)/library
-SYSSVC_ASMOBJS := $(SYSSVC_ASMOBJS)
-SYSSVC_COBJS := $(SYSSVC_COBJS) banner.o syslog.o \
-				 $(CXXRTS)
-
-ifeq ($(USE_LOGTASK),true)
-	SYSSVC_COBJS := $(SYSSVC_COBJS) serial.o logtask.o
-	CDEFS := $(CDEFS) -DTOPPERS_USE_LOGTASK
-endif
-
-SYSSVC_CFLAGS := $(SYSSVC_CFLAGS)
-SYSSVC_LIBS := $(SYSSVC_LIBS)
-INCLUDES := $(INCLUDES)
-
-#
-#  ã«ã¼ãã«ã«é¢ããå®ç¾©
-#
-#  KERNEL_ASMOBJS: ã«ã¼ãã«ã©ã¤ãã©ãªã«å«ããï¼ã½ã¼ã¹ãã¢ã»ã³ããªè¨èªã®
-#				   ãªãã¸ã§ã¯ããã¡ã¤ã«ï¼
-#  KERNEL_COBJS: ã«ã¼ãã«ã®ã©ã¤ãã©ãªã«å«ããï¼ã½ã¼ã¹ãCè¨èªã§ï¼ã½ã¼ã¹
-#				 ãã¡ã¤ã«ã¨1å¯¾1ã«å¯¾å¿ãããªãã¸ã§ã¯ããã¡ã¤ã«ï¼
-#  KERNEL_LCSRCS: ã«ã¼ãã«ã®ã©ã¤ãã©ãªã«å«ããCè¨èªã®ã½ã¼ã¹ãã¡ã¤ã«ã§ï¼
-#				  1ã¤ã®ã½ã¼ã¹ãã¡ã¤ã«ããè¤æ°ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ãç
-#				  æãããã®ï¼
-#  KERNEL_LCOBJS: ä¸ã®ã½ã¼ã¹ãã¡ã¤ã«ããçæããããªãã¸ã§ã¯ããã¡ã¤ã«ï¼
-#  KERNEL_AUX_COBJS: ã­ã¼ãã¢ã¸ã¥ã¼ã«ã«å«ããªããï¼ã«ã¼ãã«ã®ã½ã¼ã¹ãã¡
-#					 ã¤ã«ã¨åããªãã·ã§ã³ãé©ç¨ãã¦ã³ã³ãã¤ã«ãã¹ãï¼ã½ã¼
-#					 ã¹ãCè¨èªã®ãªãã¸ã§ã¯ããã¡ã¤ã«ï¼
-#
-KERNEL_DIR := $(KERNEL_DIR) $(SRCDIR)/kernel
-KERNEL_ASMOBJS := $(KERNEL_ASMOBJS)
-KERNEL_COBJS := $(KERNEL_COBJS)
-KERNEL_CFLAGS := $(KERNEL_CFLAGS) -I$(SRCDIR)/kernel
-ifdef OMIT_MAKEOFFSET
-  OFFSET_H =
-else
-  OFFSET_H = offset.h
-ifndef OFFSET_TF
-  KERNEL_AUX_COBJS := $(KERNEL_AUX_COBJS) makeoffset.o
-endif
-endif
-
-#
-#  ã¿ã¼ã²ãããã¡ã¤ã«ï¼è¤æ°ãåæã«é¸æãã¦ã¯ãªããªãï¼
-#
-all: $(OBJFILE)
-#all: $(OBJNAME).bin
-#all: $(OBJNAME).srec
-
-##### ä»¥ä¸ã¯ç·¨éããªããã¨ #####
-
-#
-#  ç°å¢ã«ä¾å­ããã³ã³ãã¤ã«ãªãã·ã§ã³ã®å®ç¾©
-#
-ifdef DBGENV
-  CDEFS := $(CDEFS) -D$(DBGENV)
-endif
-
-#
-#  å®è¡ç°å¢ã®å¤å®
-#
-ifneq (,$(findstring /cygdrive/,$(PATH)))
-    UNAME := Cygwin
-else
-ifeq ($(OS),Windows_NT)
-    UNAME := Windows
-else
-ifeq ($(UNAME),Linux)
-    UNAME := Linux
-ifeq ($(UNAME),Darwin)
-    UNAME := Darwin
-endif
-endif
-endif
-endif
-
-#
-#  ã«ã¼ãã«ã®ãã¡ã¤ã«æ§æã®å®ç¾©
-#
-include $(SRCDIR)/kernel/Makefile.kernel
-ifdef KERNEL_FUNCOBJS
-  KERNEL_LCSRCS := $(KERNEL_FCSRCS)
-  KERNEL_LCOBJS := $(foreach file,$(KERNEL_FCSRCS),$($(file:.c=)))
-else
-  KERNEL_CFLAGS := -DALLFUNC $(KERNEL_CFLAGS)
-  KERNEL_COBJS := $(KERNEL_COBJS) \
-					$(foreach file,$(KERNEL_FCSRCS),$(file:.c=.o))
-endif
-
-#
-#  ã½ã¼ã¹ãã¡ã¤ã«ã®ãããã£ã¬ã¯ããªã«é¢ããå®ç¾©
-#
-vpath %.c $(KERNEL_DIR) $(SYSSVC_DIR) $(APPL_DIR)
-vpath %.S $(KERNEL_DIR) $(SYSSVC_DIR) $(APPL_DIR)
-vpath %.cfg $(APPL_DIR)
-
-#
-#  ã³ã³ãã¤ã«ã®ããã®å¤æ°ã®å®ç¾©
-#
-KERNEL_LIB_OBJS = $(KERNEL_ASMOBJS) $(KERNEL_COBJS) $(KERNEL_LCOBJS)
-SYSSVC_OBJS = $(SYSSVC_ASMOBJS) $(SYSSVC_COBJS)
-APPL_OBJS = $(APPL_ASMOBJS) $(APPL_COBJS) $(APPL_CXXOBJS)
-ALL_OBJS = $(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \
-											$(END_OBJS) $(HIDDEN_OBJS)
-ifdef KERNEL_LIB
-  ALL_LIBS = $(APPL_LIBS) $(SYSSVC_LIBS) -lkernel $(LIBS)
-  LIBS_DEP = $(filter %.a,$(ALL_LIBS)) $(KERNEL_LIB)/libkernel.a
-  LDFLAGS := $(LDFLAGS) -L$(KERNEL_LIB)
-  REALCLEAN_FILES := libkernel.a $(REALCLEAN_FILES)
-else
-  ALL_LIBS = $(APPL_LIBS) $(SYSSVC_LIBS) libkernel.a $(LIBS)
-  LIBS_DEP = $(filter %.a,$(ALL_LIBS))
-endif
-
-ifdef TEXT_START_ADDRESS
-  LDFLAGS := $(LDFLAGS) -Wl,-Ttext,$(TEXT_START_ADDRESS)
-  CFG1_OUT_LDFLAGS := $(CFG1_OUT_LDFLAGS) -Wl,-Ttext,$(TEXT_START_ADDRESS)
-endif
-ifdef DATA_START_ADDRESS
-  LDFLAGS := $(LDFLAGS) -Wl,-Tdata,$(DATA_START_ADDRESS)
-  CFG1_OUT_LDFLAGS := $(CFG1_OUT_LDFLAGS) -Wl,-Tdata,$(DATA_START_ADDRESS)
-endif
-ifdef LDSCRIPT
-  LDFLAGS := $(LDFLAGS) -T $(LDSCRIPT)
-  CFG1_OUT_LDFLAGS := $(CFG1_OUT_LDFLAGS) -T $(LDSCRIPT)
-endif
-
-#
-#  ãªãã»ãããã¡ã¤ã«ï¼offset.hï¼ã®çæè¦å
-#
-ifdef OFFSET_TF
-offset.h: $(APPL_CFG) kernel_cfg.timestamp
-	$(CFG) --pass 3 --kernel asp $(INCLUDES) \
-				--rom-image cfg1_out.srec --symbol-table cfg1_out.syms \
-				-T $(OFFSET_TF) $(CFG_TABS) $<
-else
-offset.h: makeoffset.s $(SRCDIR)/utils/genoffset
-	$(PERL) $(SRCDIR)/utils/genoffset makeoffset.s > offset.h
-endif
-
-#
-#  ã«ã¼ãã«ã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ãã¡ã¤ã«ã®çæ
-#
-cfg1_out.c: $(APPL_CFG)
-	$(CFG) --pass 1 --kernel asp $(INCLUDES) $(CFG_TABS) $< 
-	$(CFG) -M cfg1_out.c $(INCLUDES) $< > cfg1_out.c.d
-
-$(CFG2_OUT_SRCS): kernel_cfg.timestamp
-kernel_cfg.timestamp: $(APPL_CFG) \
-						$(START_OBJS) cfg1_out.o $(END_OBJS) $(HIDDEN_OBJS)
-	$(LINK) $(CFLAGS) $(CFG1_OUT_LDFLAGS) -o $(CFG1_OUT) \
-						$(START_OBJS) cfg1_out.o $(END_OBJS)
-	$(NM) -n $(CFG1_OUT) > cfg1_out.syms
-	$(OBJCOPY) -O srec -S $(CFG1_OUT) cfg1_out.srec
-	$(CFG) --pass 2 --kernel asp $(INCLUDES) \
-				-T $(TARGETDIR)/target.tf $(CFG_TABS) $<
-ifeq ($(UNAME), Windows)
-	copy /B kernel_cfg.c +,,
-	echo  -n > kernel_cfg.timestamp
-else
-	touch -r kernel_cfg.c kernel_cfg.timestamp
-endif
-
-#
-#  ã«ã¼ãã«ã©ã¤ãã©ãªãã¡ã¤ã«ã®çæ
-#
-libkernel.a: $(OFFSET_H) $(KERNEL_LIB_OBJS)
-	rm -f libkernel.a
-	$(AR) -rcs libkernel.a $(KERNEL_LIB_OBJS)
-	$(RANLIB) libkernel.a
-
-#
-#  ç¹å¥ãªä¾å­é¢ä¿ã®å®ç¾©
-#
-banner.o: kernel_cfg.timestamp $(filter-out banner.o,$(ALL_OBJS)) $(LIBS_DEP)
-
-#
-#  å
-¨ä½ã®ãªã³ã¯
-#
-$(OBJFILE): $(APPL_CFG) kernel_cfg.timestamp $(ALL_OBJS) $(LIBS_DEP)
-	$(LINK) $(CFLAGS) $(LDFLAGS) -o $(OBJFILE) $(START_OBJS) \
-			$(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) $(ALL_LIBS) $(END_OBJS)
-	$(NM) -n $(OBJFILE) > $(OBJNAME).syms
-	$(OBJCOPY) -O srec -S $(OBJFILE) $(OBJNAME).srec
-	$(CFG) --pass 3 --kernel asp $(INCLUDES) \
-				--rom-image $(OBJNAME).srec --symbol-table $(OBJNAME).syms \
-				-T $(TARGETDIR)/target_check.tf $(CFG_TABS) $<
-
-#
-#  ãã¤ããªãã¡ã¤ã«ã®çæ
-#
-$(OBJNAME).bin: $(OBJFILE)
-	$(OBJCOPY) -O binary -R .bss -S $(OBJFILE) $(OBJNAME).bin
-
-#
-#  Sã¬ã³ã¼ããã¡ã¤ã«ã®çæ
-#
-$(OBJNAME).srec: $(OBJFILE)
-	$(OBJCOPY) -O srec -S $(OBJFILE) $(OBJNAME).srec
-
-#
-#  ã³ã³ãã¤ã«çµæã®æ¶å»
-#
-.PHONY: clean
-clean:
-	rm -f $(OBJFILE) $(OBJNAME).syms $(OBJNAME).srec $(OBJNAME).bin $(OBJFILE).shadow
-	rm -f kernel_cfg.timestamp $(CFG2_OUT_SRCS)
-	rm -f cfg1_out.c $(CFG1_OUT) cfg1_out.syms cfg1_out.srec
-	rm -f kernel_cfg.timestamp $(CFG2_OUT_SRCS);
-	rm -f cfg1_out.c cfg1_out.o $(CFG1_OUT) cfg1_out.syms cfg1_out.srec;
-	rm -f makeoffset.s offset.h;
-ifndef KERNEL_LIB
-	rm -f libkernel.a
-endif
-	rm -f makeoffset.s offset.h
-	rm -f \#* *~ *.o *.d $(CLEAN_FILES)
-
-.PHONY: cleankernel
-cleankernel:
-	rm -rf $(KERNEL_LIB_OBJS)
-	rm -f makeoffset.s offset.h
-
-.PHONY: cleandep
-cleandep:
-	if ! [ -f Makefile.depend ]; then \
-		rm -f kernel_cfg.timestamp $(CFG2_OUT_SRCS); \
-		rm -f cfg1_out.c cfg1_out.o $(CFG1_OUT) cfg1_out.syms cfg1_out.srec; \
-		rm -f makeoffset.s offset.h; \
-	fi
-	rm -f Makefile.depend
-
-.PHONY: realclean
-realclean: cleandep clean
-	rm -f $(REALCLEAN_FILES)
-
-#
-#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãçæãããã¡ã¤ã«ã®ã³ã³ãã¤ã«ã«ã¼ã«ã¨ä¾å­é¢ä¿ä½æ
-#  ã«ã¼ã«ã®å®ç¾©
-#
-#  ã³ã³ãã£ã®ã¥ã¬ã¼ã¿ãçæãããã¡ã¤ã«ã¯ï¼ã¢ããªã±ã¼ã·ã§ã³ãã­ã°ã©ã ç¨ï¼
-#  ã·ã¹ãã ãµã¼ãã¹ç¨ï¼ã«ã¼ãã«ç¨ã®ãã¹ã¦ã®ãªãã·ã§ã³ãä»ãã¦ã³ã³ãã¤ã«
-#  ããï¼
-#
-ALL_CFG_COBJS = $(CFG_COBJS) cfg1_out.o
-ALL_CFG_ASMOBJS = $(CFG_ASMOBJS)
-CFG_CFLAGS = $(APPL_CFLAGS) $(SYSSVC_CFLAGS) $(KERNEL_CFLAGS)
-
-$(ALL_CFG_COBJS): %.o: %.c
-	$(CC) -c $(CFLAGS) $(CFG_CFLAGS) $<
-
-#$(ALL_CFG_COBJS:.o=.s): %.s: %.c
-#	$(CC) -S $(CFLAGS) $(CFG_CFLAGS) $<
-
-$(ALL_CFG_ASMOBJS): %.o: %.S
-	$(CC) -c $(CFLAGS) $(CFG_CFLAGS) $<
-
-#
-#  ä¾å­é¢ä¿ãã¡ã¤ã«ãã¤ã³ã¯ã«ã¼ã
-#
--include *.d
-
-#
-#  éçºãã¼ã«ã®ã³ãã³ãåã®å®ç¾©
-#
-ifeq ($(TOOL),gcc)
-  #
-  #  GNUéçºç°å¢ç¨
-  #
-  ifdef GCC_TARGET
-    GCC_TARGET_PREFIX = $(GCC_TARGET)-
-  else
-    GCC_TARGET_PREFIX =
-  endif
-#
-#  Windowsã®å ´åã¯ãã«ãã¹ã«ãã
-#
-ifeq ($(UNAME),Windows)
-  GCC_PATH_WIN = $(ARDUINO_BASE_DIR_WIN)\hardware\tools\gcc-arm-none-eabi-4.8.3-2014q1\bin
-  CC = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)gcc"
-  CXX = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)g++"
-  AS = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)as"
-  LD = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)ld"
-  AR = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)ar"
-  NM = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)nm"
-  RANLIB = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)ranlib"
-  OBJCOPY = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)objcopy"
-  OBJDUMP = "$(GCC_PATH_WIN)\$(GCC_TARGET_PREFIX)objdump"
-else
-  CC = $(GCC_TARGET_PREFIX)gcc
-  CXX = $(GCC_TARGET_PREFIX)g++
-  AS = $(GCC_TARGET_PREFIX)as
-  LD = $(GCC_TARGET_PREFIX)ld
-  AR = $(GCC_TARGET_PREFIX)ar
-  NM = $(GCC_TARGET_PREFIX)nm
-  RANLIB = $(GCC_TARGET_PREFIX)ranlib
-  OBJCOPY = $(GCC_TARGET_PREFIX)objcopy
-  OBJDUMP = $(GCC_TARGET_PREFIX)objdump
-endif
-endif
-
-ifdef USE_CXX
-  LINK = $(CXX)
-else
-  LINK = $(CC)
-endif
-
-#
-#  ã³ã³ãã¤ã«ã«ã¼ã«ã®å®ç¾©
-#
-KERNEL_ALL_COBJS = $(KERNEL_COBJS) $(KERNEL_AUX_COBJS)
-
-$(KERNEL_ALL_COBJS): %.o: %.c
-	$(CC) -c $(CFLAGS) $(KERNEL_CFLAGS) $<
-
-#$(KERNEL_ALL_COBJS:.o=.s): %.s: %.c
-#	$(CC) -S $(CFLAGS) $(KERNEL_CFLAGS) $<
-
-$(KERNEL_LCOBJS): %.o:
-	$(CC) -DTOPPERS_$(*F) -o $@ -c $(CFLAGS) $(KERNEL_CFLAGS) $<
-
-#$(KERNEL_LCOBJS:.o=.s): %.s:
-#	$(CC) -DTOPPERS_$(*F) -o $@ -S $(CFLAGS) $(KERNEL_CFLAGS) $<
-
-$(KERNEL_ASMOBJS): %.o: %.S
-	$(CC) -c $(CFLAGS) $(KERNEL_CFLAGS) $<
-
-$(SYSSVC_COBJS): %.o: %.c
-	$(CC) -c $(CFLAGS) $(SYSSVC_CFLAGS) $<
-
-#$(SYSSVC_COBJS:.o=.s): %.s: %.c
-#	$(CC) -S $(CFLAGS) $(SYSSVC_CFLAGS) $<
-
-$(SYSSVC_ASMOBJS): %.o: %.S
-	$(CC) -c $(CFLAGS) $(SYSSVC_CFLAGS) $<
-
-$(APPL_COBJS): %.o: %.c
-	$(CC) -c $(CFLAGS) $(APPL_CFLAGS) $<
-
-#$(APPL_COBJS:.o=.s): %.s: %.c
-#	$(CC) -S $(CFLAGS) $(APPL_CFLAGS) $<
-
-$(APPL_CXXOBJS): %.o: %.cpp
-	$(CXX) -c $(CFLAGS) $(APPL_CFLAGS) $(CXXFLAGS) $<
-
-#$(APPL_CXXOBJS:.o=.s): %.s: %.cpp
-#	$(CXX) -S $(CFLAGS) $(APPL_CFLAGS) $(CXXFLAGS) $<
-
-$(APPL_ASMOBJS): %.o: %.S
-	$(CC) -c $(CFLAGS) $(APPL_CFLAGS) $<
-
-#
-#  ããã©ã«ãã³ã³ãã¤ã«ã«ã¼ã«ãä¸æ¸ã
-#
-%.o: %.c
-	@echo "*** Default compile rules should not be used."
-	$(CC) -c $(CFLAGS) $<
-
-#%.s: %.c
-#	@echo "*** Default compile rules should not be used."
-#	$(CC) -S $(CFLAGS) $<
-
-%.o: %.cpp
-	@echo "*** Default compile rules should not be used."
-	$(CXX) -c $(CFLAGS) $(CXXFLAGS) $<
-
-#%.s: %.cpp
-#	@echo "*** Default compile rules should not be used."
-#	$(CXX) -S $(CFLAGS) $(CXXFLAGS) $<
-
-%.o: %.S
-	@echo "*** Default compile rules should not be used."
-	$(CC) -c $(CFLAGS) $<
Index: rtos_arduino/trunk/lib/r2ca.h
===================================================================
--- rtos_arduino/trunk/lib/r2ca.h	(revision 260)
+++ rtos_arduino/trunk/lib/r2ca.h	(revision 260)
@@ -0,0 +1,19 @@
+#ifndef _R2CA_H_
+#define _R2CA_H_
+
+#include <kernel.h>
+#include <t_syslog.h>
+#include <t_stdlib.h>
+
+#include "r2ca_lib.h"
+#undef true
+#undef false
+#include "Arduino.h"
+
+#ifdef RCA_USE_SERIAL3
+extern Uart Serial3;
+#endif /* RCA_USE_SERIAL3 */
+
+#include "kernel_cfg.h"
+#include "r2ca_app.h"
+#endif /* _RCA_H_ */
Index: rtos_arduino/trunk/lib/r2ca_lib.cfg
===================================================================
--- rtos_arduino/trunk/lib/r2ca_lib.cfg	(revision 260)
+++ rtos_arduino/trunk/lib/r2ca_lib.cfg	(revision 260)
@@ -0,0 +1,93 @@
+#include "r2ca_lib.h"
+
+ATT_INI({ TA_NULL, 0, r2ca_init });
+CRE_TSK(R2CA_MAINTASK, { TA_ACT, 0, r2ca_maintask, R2CA_MAINTASK_PRI, R2CA_MAINTASK_STACK_SIZE, NULL });
+
+#if R2CA_NUM_TASK > 0
+CRE_TSK(R2CA_TASK1, { TA_ACT, 0, r2ca_task1, R2CA_TASK1_PRI, R2CA_TASK1_STACK_SIZE, NULL });
+#endif /* R2CA_NUM_TASK > 0 */
+
+#if R2CA_NUM_TASK > 1
+CRE_TSK(R2CA_TASK2, { TA_ACT, 0, r2ca_task2, R2CA_TASK2_PRI, R2CA_TASK2_STACK_SIZE, NULL });
+#endif /* R2CA_NUM_TASK > 1 */
+
+#if R2CA_NUM_TASK > 2
+CRE_TSK(R2CA_TASK3, { TA_ACT, 0, r2ca_task3, R2CA_TASK3_PRI, R2CA_TASK3_STACK_SIZE, NULL });
+#endif /* R2CA_NUM_TASK > 2 */
+
+#if R2CA_NUM_TASK > 3
+CRE_TSK(R2CA_TASK4, { TA_ACT, 0, r2ca_task4, R2CA_TASK4_PRI, R2CA_TASK4_STACK_SIZE, NULL });
+#endif /* R2CA_NUM_TASK > 3 */
+
+#if R2CA_NUM_TASK > 4
+CRE_TSK(R2CA_TASK5, { TA_ACT, 0, r2ca_task5, R2CA_TASK5_PRI, R2CA_TASK5_STACK_SIZE, NULL });
+#endif /* R2CA_NUM_TASK > 4 */
+
+#ifdef R2CA_ENABLE_PROFILING
+CRE_TSK(R2CA_IDLE_TASK, { TA_ACT, 0, r2ca_idle_task, 15, 512, NULL });
+#endif /* R2CA_ENABLE_PROFILING */
+
+//For SysTick
+CRE_CYC(R2CA_CYCHDR, { TA_STA, 0, r2ca_CycHandler, 1, 1});
+
+//For USB (ToDo)Naitiveã«å¤æ´
+DEF_INH((16+7), { TA_NULL, r2ca_USB_Handler });
+CFG_INT((16+7), { TA_NULL, -1 });
+
+#ifdef TOPPERS_USE_ARDUINO_SERIAL
+//For SERCOM5
+DEF_INH((16+14), { TA_NULL, r2ca_SERCOM5_Handler });
+CFG_INT((16+14), { TA_NULL, -1 });
+#endif /* TOPPERS_USE_ARDUINO_SERIAL */
+
+//For SERCOM0(Serial5)
+DEF_INH((16+9), { TA_NULL, r2ca_SERCOM0_Handler });
+CFG_INT((16+9), { TA_NULL, -1 });
+
+#ifdef R2CA_USE_SERIAL3
+//For SERCOM2(Serial3)
+DEF_INH((16+11), { TA_NULL, r2ca_SERCOM2_Handler });
+CFG_INT((16+11), { TA_NULL, -1 });
+#endif /* R2CA_USE_SERIAL3 */
+
+//For SERCOM3(I2C)
+DEF_INH((16+12), { TA_NULL, r2ca_SERCOM3_Handler });
+CFG_INT((16+12), { TA_NULL, -1 });
+
+//For SERCOM4(SPI)
+DEF_INH((16+13), { TA_NULL, r2ca_SERCOM4_Handler });
+CFG_INT((16+13), { TA_NULL, -1 });
+
+//For EIC
+DEF_INH((16+4), { TA_NULL, r2ca_EIC_Handler });
+CFG_INT((16+4), { TA_NULL, -1 });
+
+//For TC5
+DEF_INH((16+20), { TA_NULL, r2ca_TC5_Handler });
+CFG_INT((16+20), { TA_NULL, -1 });
+
+//For RTC
+DEF_INH((16+3), { TA_NULL, r2ca_RTC_Handler });
+CFG_INT((16+3), { TA_NULL, -1 });
+
+//For SPI
+CRE_SEM(SPI_SEM, { TA_TPRI, 1, 1 });
+
+//For ESP8266
+CRE_SEM(ESP8266_SEM, { TA_TPRI, 1, 1 });
+
+//For WIRE(I2C)
+CRE_SEM(WIRE_SEM, { TA_TPRI, 1, 1 });
+
+//For MILKCOCOA
+CRE_SEM(MILKCOCOA_SEM, { TA_TPRI, 1, 1 });
+
+INCLUDE("target_timer.cfg");
+
+#ifdef TOPPERS_USE_LOGTASK
+INCLUDE("syssvc/serial.cfg");
+INCLUDE("syssvc/logtask.cfg");
+#endif /* TOPPERS_USE_LOGTASK */
+
+INCLUDE("syssvc/syslog.cfg");
+INCLUDE("syssvc/banner.cfg");
Index: rtos_arduino/trunk/lib/r2ca_lib.cpp
===================================================================
--- rtos_arduino/trunk/lib/r2ca_lib.cpp	(revision 260)
+++ rtos_arduino/trunk/lib/r2ca_lib.cpp	(revision 260)
@@ -0,0 +1,354 @@
+#include "r2ca.h"
+#include "r2ca_lib.h"
+
+extern "C" {
+extern void yield(void);
+extern void r2ca_ena_int(uint_t intno);
+extern void r2ca_dis_int(uint_t intno);
+}
+
+#ifdef R2CA_ENABLE_PROFILING
+volatile uint32_t r2ca_idle_result;
+volatile uint32_t r2ca_isr_result;
+volatile uint32_t r2ca_dispatch_result;
+volatile uint32_t r2ca_timer_isr_result;
+volatile uint32_t r2ca_usb_isr_result;
+volatile uint32_t r2ca_sercom0_isr_result;
+volatile uint32_t r2ca_sercom2_isr_result;
+volatile uint32_t r2ca_sercom3_isr_result;
+volatile uint32_t r2ca_sercom4_isr_result;
+volatile uint32_t r2ca_sercom5_isr_result;
+volatile uint32_t r2ca_eic_isr_result;
+volatile uint32_t r2ca_tc5_isr_result;
+volatile uint32_t r2ca_rtc_isr_result;
+
+static volatile uint32_t r2ca_idle_cnt;
+static volatile uint32_t r2ca_isr_cnt;
+static volatile uint32_t r2ca_dispatch_cnt;
+static volatile uint32_t r2ca_timer_isr_cnt;
+static volatile uint32_t r2ca_usb_isr_cnt;
+static volatile uint32_t r2ca_sercom0_isr_cnt;
+static volatile uint32_t r2ca_sercom2_isr_cnt;
+static volatile uint32_t r2ca_sercom3_isr_cnt;
+static volatile uint32_t r2ca_sercom4_isr_cnt;
+static volatile uint32_t r2ca_sercom5_isr_cnt;
+static volatile uint32_t r2ca_eic_isr_cnt;
+static volatile uint32_t r2ca_tc5_isr_cnt;
+static volatile uint32_t r2ca_rtc_isr_cnt;     
+static volatile uint32_t r2ca_profiling_cyccnt;
+#endif /* R2CA_ENABLE_PROFILING */
+
+Inline void
+r2ca_di(void){
+	Asm("cpsid f":::"memory");
+}
+
+/*
+ *  FAULTMASKÌNA
+ */
+Inline void
+r2ca_ei(void){
+	Asm("cpsie f":::"memory");
+}
+
+void
+r2ca_init(intptr_t exinf)
+{
+	init(); //wiring.c
+}
+
+void
+r2ca_ena_int(uint_t intno) {
+	if (ena_int(intno + 16) != E_OK) {
+		while(1); //ToDo
+	}
+}
+
+void
+r2ca_dis_int(uint_t intno) {
+	if (dis_int(intno + 16) != E_OK) {
+		while(1); //ToDo
+	}
+}
+
+extern const DeviceVectors exception_table;
+
+static uint32_t time_slice = 0;
+
+/*
+ *  Cyclic Handler
+ */
+void
+r2ca_CycHandler(intptr_t exinf)
+{    
+	int i;
+	if (++time_slice == R2CA_RR_SCHEDULE_CYCLE) {
+		time_slice = 0;
+		for(i = 1; i < 16; i++){
+			if (R2CA_RR_SCHEDULE_PRI & (1 << i)) {
+				irot_rdq(i);
+			}
+		}
+	}
+#ifdef R2CA_ENABLE_PROFILING    
+	r2ca_di();
+	r2ca_isr_cnt++;
+	r2ca_timer_isr_cnt++;
+	r2ca_profiling_cyccnt++;
+	if(r2ca_profiling_cyccnt == R2CA_PROFILING_CYC_MS){
+		r2ca_idle_result=        r2ca_idle_cnt;
+		r2ca_isr_result=         r2ca_isr_cnt;
+		r2ca_dispatch_result=    r2ca_dispatch_cnt;
+		r2ca_timer_isr_result=   r2ca_timer_isr_cnt;
+		r2ca_usb_isr_result=     r2ca_usb_isr_cnt;
+		r2ca_sercom0_isr_result= r2ca_sercom0_isr_cnt;
+		r2ca_sercom2_isr_result= r2ca_sercom2_isr_cnt;        
+		r2ca_sercom3_isr_result= r2ca_sercom3_isr_cnt;
+		r2ca_sercom4_isr_result= r2ca_sercom4_isr_cnt;
+		r2ca_sercom5_isr_result= r2ca_sercom5_isr_cnt;
+		r2ca_eic_isr_result=     r2ca_eic_isr_cnt;
+		r2ca_tc5_isr_result=     r2ca_tc5_isr_cnt;
+		r2ca_rtc_isr_result=     r2ca_rtc_isr_cnt;             
+		r2ca_idle_cnt = 0;
+		r2ca_isr_cnt = 0;
+		r2ca_dispatch_cnt = 0;
+		r2ca_timer_isr_cnt = 0;
+		r2ca_usb_isr_cnt = 0;
+		r2ca_sercom0_isr_cnt = 0;
+		r2ca_sercom2_isr_cnt = 0;        
+		r2ca_sercom3_isr_cnt = 0;
+		r2ca_sercom4_isr_cnt = 0;
+		r2ca_sercom5_isr_cnt = 0;
+		r2ca_eic_isr_cnt = 0;
+		r2ca_tc5_isr_cnt = 0;
+		r2ca_rtc_isr_cnt = 0;
+		r2ca_profiling_cyccnt = 0;
+	}
+	r2ca_ei();
+#endif /* R2CA_ENABLE_PROFILING */    
+	((void(*)(void))(exception_table.pfnSysTick_Handler))();        
+}
+
+/*
+ *  Interrupt Handler
+ */
+void
+r2ca_USB_Handler(void)
+{
+#ifdef R2CA_ENABLE_PROFILING
+	r2ca_di();
+	r2ca_usb_isr_cnt++;
+	r2ca_isr_cnt++;
+	r2ca_ei();
+#endif /* R2CA_ENABLE_PROFILING */    
+	((void(*)(void))(exception_table.pfnUSB_Handler))();
+}
+
+void
+r2ca_SERCOM0_Handler(void)
+{
+#ifdef R2CA_ENABLE_PROFILING
+	r2ca_di();
+	r2ca_sercom0_isr_cnt++;
+	r2ca_isr_cnt++;
+	r2ca_ei();
+#endif /* R2CA_ENABLE_PROFILING */    
+	((void(*)(void))(exception_table.pfnSERCOM0_Handler))();
+}
+
+#ifdef R2CA_USE_SERIAL3
+#define PIN_SERIAL3_RX 49  /* D5 */
+#define PIN_SERIAL3_TX 48  /* D4 */
+
+Uart Serial3(&sercom2, PIN_SERIAL3_RX, PIN_SERIAL3_TX);
+
+void
+r2ca_SERCOM2_Handler(void)
+{
+#ifdef R2CA_ENABLE_PROFILING
+	r2ca_di();
+	r2ca_sercom2_isr_cnt++;
+	r2ca_isr_cnt++;
+	r2ca_ei();
+#endif /* R2CA_ENABLE_PROFILING */
+	Serial3.IrqHandler();
+}
+#endif /* R2CA_USE_SERIAL3 */
+
+void
+r2ca_SERCOM3_Handler(void)
+{
+#ifdef R2CA_ENABLE_PROFILING
+	r2ca_di();
+	r2ca_sercom3_isr_cnt++;
+	r2ca_isr_cnt++;
+	r2ca_ei();
+#endif /* R2CA_ENABLE_PROFILING */    
+	((void(*)(void))(exception_table.pfnSERCOM3_Handler))();
+}
+
+void
+r2ca_SERCOM4_Handler(void)
+{
+#ifdef R2CA_ENABLE_PROFILING
+	r2ca_di();
+	r2ca_sercom4_isr_cnt++;
+	r2ca_isr_cnt++;
+	r2ca_ei();
+#endif /* R2CA_ENABLE_PROFILING */    
+	((void(*)(void))(exception_table.pfnSERCOM4_Handler))();
+}
+
+#ifdef TOPPERS_USE_ARDUINO_SERIAL
+void
+r2ca_SERCOM5_Handler(void)
+{
+#ifdef R2CA_ENABLE_PROFILING
+	r2ca_di();
+	r2ca_sercom5_isr_cnt++;
+	r2ca_isr_cnt++;
+	r2ca_ei();
+#endif /* R2CA_ENABLE_PROFILING */    
+	((void(*)(void))(exception_table.pfnSERCOM5_Handler))();
+}
+#endif /* TOPPERS_USE_ARDUINO_SERIAL */
+
+void
+r2ca_EIC_Handler(void)
+{
+#ifdef R2CA_ENABLE_PROFILING
+	r2ca_di();
+	r2ca_eic_isr_cnt++;
+	r2ca_isr_cnt++;
+	r2ca_ei();
+#endif /* R2CA_ENABLE_PROFILING */    
+	((void(*)(void))(exception_table.pfnEIC_Handler))();
+}
+
+void
+r2ca_TC5_Handler(void)
+{
+#ifdef R2CA_ENABLE_PROFILING
+	r2ca_di();
+	r2ca_tc5_isr_cnt++;
+	r2ca_isr_cnt++;
+	r2ca_ei();
+#endif /* R2CA_ENABLE_PROFILING */    
+	((void(*)(void))(exception_table.pfnTC5_Handler))();
+}
+
+void
+r2ca_RTC_Handler(void)
+{
+#ifdef R2CA_ENABLE_PROFILING
+	r2ca_di();
+	r2ca_rtc_isr_cnt++;
+	r2ca_isr_cnt++;
+	r2ca_ei();
+#endif /* R2CA_ENABLE_PROFILING */
+	((void(*)(void))(exception_table.pfnRTC_Handler))();
+}
+
+/*
+ *  For delay
+ */
+void
+yield(void){
+	time_slice = 0;
+#ifdef R2CA_ENABLE_PROFILING
+	r2ca_di();
+	r2ca_dispatch_cnt++;
+	r2ca_ei();
+#endif /* R2CA_ENABLE_PROFILING */    
+	dly_tsk(0);
+}
+
+extern void setup(void);
+extern void loop(void);
+
+
+const ID task_id[] = {
+#if R2CA_NUM_TASK > 0
+	R2CA_TASK1,
+#endif /* R2CA_NUM_TASK > 0 */
+#if R2CA_NUM_TASK > 1
+	R2CA_TASK2,
+#endif /* R2CA_NUM_TASK > 1 */
+#if R2CA_NUM_TASK > 2
+	R2CA_TASK3,
+#endif /* R2CA_NUM_TASK > 2 */
+#if R2CA_NUM_TASK > 3
+	R2CA_TASK4,
+#endif /* R2CA_NUM_TASK > 3 */
+#if R2CA_NUM_TASK > 4
+	R2CA_TASK5,
+#endif /* R2CA_NUM_TASK > 4 */
+};
+
+void
+r2ca_maintask(intptr_t exinf)
+{
+	int i;
+
+	syslog(LOG_NOTICE, "Arduino Main Task start!");
+
+#ifdef USBCON
+	USBDevice.init();
+	USBDevice.attach();
+#endif /* USBCON */
+    
+	analogReference(AR_DEFAULT);
+    
+	setup();
+    
+	for(i = 0; i < R2CA_NUM_TASK; i++) {
+		act_tsk(task_id[i]);
+	}
+    
+	while(1){
+		loop();
+		if (serialEventRun) serialEventRun();
+	}    
+}
+
+#define R2CA_TASK_BODY(NUM) \
+extern void loop##NUM(void); \
+ \
+void \
+r2ca_task##NUM(intptr_t exinf) \
+{ \
+    while(1){ \
+        loop##NUM(); \
+    }     \
+}
+
+#if R2CA_NUM_TASK > 0
+R2CA_TASK_BODY(1)
+#endif /* R2CA_NUM_TASK > 0 */
+
+#if R2CA_NUM_TASK > 1
+R2CA_TASK_BODY(2)
+#endif /* R2CA_NUM_TASK > 1 */
+
+#if R2CA_NUM_TASK > 2
+R2CA_TASK_BODY(3)
+#endif /* R2CA_NUM_TASK > 2 */
+
+#if R2CA_NUM_TASK > 3
+R2CA_TASK_BODY(4)
+#endif /* R2CA_NUM_TASK > 3 */
+
+#if R2CA_NUM_TASK > 4
+R2CA_TASK_BODY(5)
+#endif /* R2CA_NUM_TASK > 4 */
+
+#ifdef R2CA_ENABLE_PROFILING
+void
+r2ca_idle_task(intptr_t exinf) {
+	while(1){
+		r2ca_di();
+		r2ca_idle_cnt++;
+		r2ca_ei();
+	}
+}
+#endif /* R2CA_ENABLE_PROFILING */
Index: rtos_arduino/trunk/lib/r2ca_lib.h
===================================================================
--- rtos_arduino/trunk/lib/r2ca_lib.h	(revision 260)
+++ rtos_arduino/trunk/lib/r2ca_lib.h	(revision 260)
@@ -0,0 +1,138 @@
+#include "r2ca_app.h"
+
+/*
+ *  Max number of task
+ */
+#define R2CA_NUM_TASK_MAX  5
+
+/*
+ *  Check number of task
+ */
+#if R2CA_NUM_TASK > R2CA_NUM_TASK_MAX
+#error The number of Task is over!
+#endif /* R2CA_NUM_TASK > R2CA_NUM_TASK_MAX */
+
+/*
+ *  Idle task loop count per 10ms at idle state
+ */
+#define IDLE_TASK_IDLE_LOOP_10MS 42178
+
+/*
+ * Default Macro  
+ */
+
+/*
+ *  Priotiry
+ */
+#ifndef R2CA_MAINTASK_PRI
+#define  R2CA_MAINTASK_PRI  5
+#endif /*  R2CA_MAINTASK_SETUP_PRI */
+
+#ifndef R2CA_TASK1_PRI
+#define  R2CA_TASK1_PRI  5
+#endif /*  R2CA_TASK1_SETUP_PRI */
+
+#ifndef R2CA_TASK2_PRI
+#define  R2CA_TASK2_PRI  5
+#endif /*  R2CA_TASK2_SETUP_PRI */
+
+#ifndef R2CA_TASK3_PRI
+#define  R2CA_TASK3_PRI  5
+#endif /*  R2CA_TASK3_SETUP_PRI */
+
+#ifndef R2CA_TASK4_PRI
+#define  R2CA_TASK4_PRI  5
+#endif /*  R2CA_TASK4_SETUP_PRI */
+
+#ifndef R2CA_TASK5_PRI
+#define  R2CA_TASK5_PRI  5
+#endif /*  R2CA_TASK3_SETUP_PRI */
+
+/*
+ *  Stack Size
+ */
+#ifndef R2CA_MAINTASK_STACK_SIZE
+#define R2CA_MAINTASK_STACK_SIZE 2048
+#endif  /* R2CA_MAINTASK_STACK_SIZE */
+
+#ifndef R2CA_TASK1_STACK_SIZE
+#define R2CA_TASK1_STACK_SIZE 1024
+#endif  /* R2CA_TASK1_STACK_SIZE */
+
+#ifndef R2CA_TASK2_STACK_SIZE
+#define R2CA_TASK2_STACK_SIZE 1024
+#endif  /* R2CA_TASK2_STACK_SIZE */
+
+#ifndef R2CA_TASK3_STACK_SIZE
+#define R2CA_TASK3_STACK_SIZE 1024
+#endif  /* R2CA_TASK3_STACK_SIZE */
+
+#ifndef R2CA_TASK4_STACK_SIZE
+#define R2CA_TASK4_STACK_SIZE 1024
+#endif  /* R2CA_TASK4_STACK_SIZE */
+
+#ifndef R2CA_TASK5_STACK_SIZE
+#define R2CA_TASK5_STACK_SIZE 1024
+#endif  /* R2CA_TASK5_STACK_SIZE */
+
+
+/*
+ *  Round Robin Scheduling cycle
+ */
+#ifndef R2CA_RR_SCHEDULE_CYCLE
+#define R2CA_RR_SCHEDULE_CYCLE 1
+#endif /* R2CA_RR_SCHEDULE_CYCLE */
+
+#ifndef R2CA_RR_SCHEDULE_PRI
+#define R2CA_RR_SCHEDULE_PRI 0x0000
+#endif  /* R2CA_RR_SCHEDULE_PRI */
+  
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void r2ca_init(intptr_t exinf);
+extern void r2ca_maintask(intptr_t exinf);
+extern void r2ca_task1(intptr_t exinf);
+extern void r2ca_task2(intptr_t exinf);
+extern void r2ca_task3(intptr_t exinf);
+extern void r2ca_task4(intptr_t exinf);
+extern void r2ca_task5(intptr_t exinf);
+extern void r2ca_CycHandler(intptr_t exinf);
+
+extern void r2ca_USB_Handler(void);
+extern void r2ca_SERCOM0_Handler(void);
+extern void r2ca_SERCOM2_Handler(void);
+extern void r2ca_SERCOM3_Handler(void);
+extern void r2ca_SERCOM4_Handler(void);
+extern void r2ca_SERCOM5_Handler(void);
+extern void r2ca_EIC_Handler(void);
+extern void r2ca_TC5_Handler(void);
+extern void r2ca_RTC_Handler(void);
+
+#ifdef R2CA_ENABLE_PROFILING
+extern void r2ca_idle_task(intptr_t exinf);
+extern volatile uint32_t r2ca_idle_result;
+extern volatile uint32_t r2ca_isr_result;
+extern volatile uint32_t r2ca_dispatch_result;
+extern volatile uint32_t r2ca_timer_isr_result;
+extern volatile uint32_t r2ca_usb_isr_result;
+extern volatile uint32_t r2ca_sercom0_isr_result;
+extern volatile uint32_t r2ca_sercom4_isr_result;
+extern volatile uint32_t r2ca_sercom5_isr_result;
+extern volatile uint32_t r2ca_eic_isr_result;
+extern volatile uint32_t r2ca_tc5_isr_result;
+extern volatile uint32_t r2ca_rtc_isr_result;
+
+#ifdef R2CA_USE_SERIAL3
+extern volatile uint32_t r2ca_sercom3_isr_result;
+#endif /* R2CA_USE_SERIAL3 */
+  
+#endif /* R2CA_ENABLE_PROFILING */
+
+#define WIRE_ENTER_CRITICAL wai_sem(WIRE_SEM);
+#define WIRE_LEAVE_CRITICAL sig_sem(WIRE_SEM);
+
+#ifdef __cplusplus
+}
+#endif
Index: rtos_arduino/trunk/lib/rca.h
===================================================================
--- rtos_arduino/trunk/lib/rca.h	(revision 259)
+++ 	(revision )
@@ -1,19 +1,0 @@
-#ifndef _RCA_H_
-#define _RCA_H_
-
-#include <kernel.h>
-#include <t_syslog.h>
-#include <t_stdlib.h>
-
-#include "rca_lib.h"
-#undef true
-#undef false
-#include "Arduino.h"
-
-#ifdef RCA_USE_SERIAL3
-extern Uart Serial3;
-#endif /* RCA_USE_SERIAL3 */
-
-#include "kernel_cfg.h"
-#include "rca_app.h"
-#endif /* _RCA_H_ */
Index: rtos_arduino/trunk/lib/rca_lib.cfg
===================================================================
--- rtos_arduino/trunk/lib/rca_lib.cfg	(revision 259)
+++ 	(revision )
@@ -1,96 +1,0 @@
-#include "rca_lib.h"
-
-ATT_INI({ TA_NULL, 0, rca_init });
-CRE_TSK(RCA_MAINTASK, { TA_ACT, 0, rca_maintask, RCA_MAINTASK_SETUP_PRI, RCA_MAINTASK_STACK_SIZE, NULL });
-
-//For Setup
-CRE_SEM(SETUP_SEM, { TA_TPRI, 0, 1 });
-
-#if RCA_NUM_TASK > 0
-CRE_TSK(RCA_TASK1, { TA_ACT, 0, rca_task1, RCA_TASK1_SETUP_PRI, RCA_TASK1_STACK_SIZE, NULL });
-#endif /* RCA_NUM_TASK > 0 */
-
-#if RCA_NUM_TASK > 1
-CRE_TSK(RCA_TASK2, { TA_ACT, 0, rca_task2, RCA_TASK2_SETUP_PRI, RCA_TASK2_STACK_SIZE, NULL });
-#endif /* RCA_NUM_TASK > 1 */
-
-#if RCA_NUM_TASK > 2
-CRE_TSK(RCA_TASK3, { TA_ACT, 0, rca_task3, RCA_TASK3_SETUP_PRI, RCA_TASK3_STACK_SIZE, NULL });
-#endif /* RCA_NUM_TASK > 2 */
-
-#if RCA_NUM_TASK > 3
-CRE_TSK(RCA_TASK4, { TA_ACT, 0, rca_task4, RCA_TASK4_SETUP_PRI, RCA_TASK4_STACK_SIZE, NULL });
-#endif /* RCA_NUM_TASK > 3 */
-
-#if RCA_NUM_TASK > 4
-CRE_TSK(RCA_TASK5, { TA_ACT, 0, rca_task5, RCA_TASK5_SETUP_PRI, RCA_TASK5_STACK_SIZE, NULL });
-#endif /* RCA_NUM_TASK > 4 */
-
-#ifdef RCA_ENABLE_PROFILING
-CRE_TSK(RCA_IDLE_TASK, { TA_ACT, 0, rca_idle_task, 15, 512, NULL });
-#endif /* RCA_ENABLE_PROFILING */
-
-//For SysTick
-CRE_CYC(RCA_CYCHDR, { TA_STA, 0, rca_CycHandler, 1, 1});
-
-//For USB (ToDo)Naitiveã«å¤æ´
-DEF_INH((16+7), { TA_NULL, rca_USB_Handler });
-CFG_INT((16+7), { TA_NULL, -1 });
-
-#ifdef TOPPERS_USE_ARDUINO_SERIAL
-//For SERCOM5
-DEF_INH((16+14), { TA_NULL, rca_SERCOM5_Handler });
-CFG_INT((16+14), { TA_NULL, -1 });
-#endif /* TOPPERS_USE_ARDUINO_SERIAL */
-
-//For SERCOM0(Serial5)
-DEF_INH((16+9), { TA_NULL, rca_SERCOM0_Handler });
-CFG_INT((16+9), { TA_NULL, -1 });
-
-#ifdef RCA_USE_SERIAL3
-//For SERCOM2(Serial3)
-DEF_INH((16+11), { TA_NULL, rca_SERCOM2_Handler });
-CFG_INT((16+11), { TA_NULL, -1 });
-#endif /* RCA_USE_SERIAL3 */
-
-//For SERCOM3(I2C)
-DEF_INH((16+12), { TA_NULL, rca_SERCOM3_Handler });
-CFG_INT((16+12), { TA_NULL, -1 });
-
-//For SERCOM4(SPI)
-DEF_INH((16+13), { TA_NULL, rca_SERCOM4_Handler });
-CFG_INT((16+13), { TA_NULL, -1 });
-
-//For EIC
-DEF_INH((16+4), { TA_NULL, rca_EIC_Handler });
-CFG_INT((16+4), { TA_NULL, -1 });
-
-//For TC5
-DEF_INH((16+20), { TA_NULL, rca_TC5_Handler });
-CFG_INT((16+20), { TA_NULL, -1 });
-
-//For RTC
-DEF_INH((16+3), { TA_NULL, rca_RTC_Handler });
-CFG_INT((16+3), { TA_NULL, -1 });
-
-//For SPI
-CRE_SEM(SPI_SEM, { TA_TPRI, 1, 1 });
-
-//For ESP8266
-CRE_SEM(ESP8266_SEM, { TA_TPRI, 1, 1 });
-
-//For WIRE(I2C)
-CRE_SEM(WIRE_SEM, { TA_TPRI, 1, 1 });
-
-//For MILKCOCOA
-CRE_SEM(MILKCOCOA_SEM, { TA_TPRI, 1, 1 });
-
-INCLUDE("target_timer.cfg");
-
-#ifdef TOPPERS_USE_LOGTASK
-INCLUDE("syssvc/serial.cfg");
-INCLUDE("syssvc/logtask.cfg");
-#endif /* TOPPERS_USE_LOGTASK */
-
-INCLUDE("syssvc/syslog.cfg");
-INCLUDE("syssvc/banner.cfg");
Index: rtos_arduino/trunk/lib/rca_lib.cpp
===================================================================
--- rtos_arduino/trunk/lib/rca_lib.cpp	(revision 259)
+++ 	(revision )
@@ -1,346 +1,0 @@
-#include "rca.h"
-#include "rca_lib.h"
-
-extern "C" {
-extern void yield(void);
-extern void rca_ena_int(uint_t intno);
-extern void rca_dis_int(uint_t intno);
-}
-
-#ifdef RCA_ENABLE_PROFILING
-volatile uint32_t rca_idle_result;
-volatile uint32_t rca_isr_result;
-volatile uint32_t rca_dispatch_result;
-volatile uint32_t rca_timer_isr_result;
-volatile uint32_t rca_usb_isr_result;
-volatile uint32_t rca_sercom0_isr_result;
-volatile uint32_t rca_sercom2_isr_result;
-volatile uint32_t rca_sercom3_isr_result;
-volatile uint32_t rca_sercom4_isr_result;
-volatile uint32_t rca_sercom5_isr_result;
-volatile uint32_t rca_eic_isr_result;
-volatile uint32_t rca_tc5_isr_result;
-volatile uint32_t rca_rtc_isr_result;
-
-static volatile uint32_t rca_idle_cnt;
-static volatile uint32_t rca_isr_cnt;
-static volatile uint32_t rca_dispatch_cnt;
-static volatile uint32_t rca_timer_isr_cnt;
-static volatile uint32_t rca_usb_isr_cnt;
-static volatile uint32_t rca_sercom0_isr_cnt;
-static volatile uint32_t rca_sercom2_isr_cnt;
-static volatile uint32_t rca_sercom3_isr_cnt;
-static volatile uint32_t rca_sercom4_isr_cnt;
-static volatile uint32_t rca_sercom5_isr_cnt;
-static volatile uint32_t rca_eic_isr_cnt;
-static volatile uint32_t rca_tc5_isr_cnt;
-static volatile uint32_t rca_rtc_isr_cnt;     
-static volatile uint32_t rca_profiling_cyccnt;
-#endif /* RCA_ENABLE_PROFILING */
-
-Inline void
-rca_di(void){
-	Asm("cpsid f":::"memory");
-}
-
-/*
- *  FAULTMASKÌNA
- */
-Inline void
-rca_ei(void){
-	Asm("cpsie f":::"memory");
-}
-
-void
-rca_init(intptr_t exinf)
-{
-    init(); //wiring.c
-}
-
-void
-rca_ena_int(uint_t intno) {
-    if (ena_int(intno + 16) != E_OK) {
-        while(1); //ToDo
-    }
-
-}
-
-void
-rca_dis_int(uint_t intno) {
-    if (dis_int(intno + 16) != E_OK) {
-        while(1); //ToDo
-    }
-}
-
-extern const DeviceVectors exception_table;
-
-#ifdef RCA_RR_SCHEDULE
-static uint32_t time_slice = 0;
-#endif /* RCA_RR_SCHEDULE */
-
-/*
- *  Cyclic Handler
- */
-void
-rca_CycHandler(intptr_t exinf)
-{    
-#ifdef RCA_RR_SCHEDULE
-    int i;
-    if (++time_slice == RCA_RR_SCHEDULE_CYCLE) {
-        time_slice = 0;
-        for(i = 1; i < 16; i++){
-            if (RCA_RR_SCHEDULE & (1 << i)) {
-                irot_rdq(i);
-            }
-        }
-    }
-#endif /* RCA_RR_SCHEDULE */
-#ifdef RCA_ENABLE_PROFILING    
-    rca_di();
-    rca_isr_cnt++;
-    rca_timer_isr_cnt++;
-    rca_profiling_cyccnt++;
-    if(rca_profiling_cyccnt == RCA_PROFILING_CYC_MS){
-        rca_idle_result=        rca_idle_cnt;
-        rca_isr_result=         rca_isr_cnt;
-        rca_dispatch_result=    rca_dispatch_cnt;
-        rca_timer_isr_result=   rca_timer_isr_cnt;
-        rca_usb_isr_result=     rca_usb_isr_cnt;
-        rca_sercom0_isr_result= rca_sercom0_isr_cnt;
-        rca_sercom2_isr_result= rca_sercom2_isr_cnt;        
-        rca_sercom3_isr_result= rca_sercom3_isr_cnt;
-        rca_sercom4_isr_result= rca_sercom4_isr_cnt;
-        rca_sercom5_isr_result= rca_sercom5_isr_cnt;
-        rca_eic_isr_result=     rca_eic_isr_cnt;
-        rca_tc5_isr_result=     rca_tc5_isr_cnt;
-        rca_rtc_isr_result=     rca_rtc_isr_cnt;             
-        rca_idle_cnt = 0;
-        rca_isr_cnt = 0;
-        rca_dispatch_cnt = 0;
-        rca_timer_isr_cnt = 0;
-        rca_usb_isr_cnt = 0;
-        rca_sercom0_isr_cnt = 0;
-        rca_sercom2_isr_cnt = 0;        
-        rca_sercom3_isr_cnt = 0;
-        rca_sercom4_isr_cnt = 0;
-        rca_sercom5_isr_cnt = 0;
-        rca_eic_isr_cnt = 0;
-        rca_tc5_isr_cnt = 0;
-        rca_rtc_isr_cnt = 0;
-        rca_profiling_cyccnt = 0;
-    }
-    rca_ei();
-#endif /* RCA_ENABLE_PROFILING */    
-    ((void(*)(void))(exception_table.pfnSysTick_Handler))();        
-}
-
-/*
- *  Interrupt Handler
- */
-void
-rca_USB_Handler(void)
-{
-#ifdef RCA_ENABLE_PROFILING
-    rca_di();
-    rca_usb_isr_cnt++;
-    rca_isr_cnt++;
-    rca_ei();
-#endif /* RCA_ENABLE_PROFILING */    
-    ((void(*)(void))(exception_table.pfnUSB_Handler))();
-}
-
-void
-rca_SERCOM0_Handler(void)
-{
-#ifdef RCA_ENABLE_PROFILING
-    rca_di();
-    rca_sercom0_isr_cnt++;
-    rca_isr_cnt++;
-    rca_ei();
-#endif /* RCA_ENABLE_PROFILING */    
-    ((void(*)(void))(exception_table.pfnSERCOM0_Handler))();
-}
-
-#ifdef RCA_USE_SERIAL3
-#define PIN_SERIAL3_RX 49  /* D5 */
-#define PIN_SERIAL3_TX 48  /* D4 */
-
-Uart Serial3(&sercom2, PIN_SERIAL3_RX, PIN_SERIAL3_TX);
-
-void
-rca_SERCOM2_Handler(void)
-{
-#ifdef RCA_ENABLE_PROFILING
-    rca_di();
-    rca_sercom2_isr_cnt++;
-    rca_isr_cnt++;
-    rca_ei();
-#endif /* RCA_ENABLE_PROFILING */
-    Serial3.IrqHandler();
-}
-#endif /* RCA_USE_SERIAL3 */
-
-void
-rca_SERCOM3_Handler(void)
-{
-#ifdef RCA_ENABLE_PROFILING
-    rca_di();
-    rca_sercom3_isr_cnt++;
-    rca_isr_cnt++;
-    rca_ei();
-#endif /* RCA_ENABLE_PROFILING */    
-    ((void(*)(void))(exception_table.pfnSERCOM3_Handler))();
-}
-
-void
-rca_SERCOM4_Handler(void)
-{
-#ifdef RCA_ENABLE_PROFILING
-    rca_di();
-    rca_sercom4_isr_cnt++;
-    rca_isr_cnt++;
-    rca_ei();
-#endif /* RCA_ENABLE_PROFILING */    
-    ((void(*)(void))(exception_table.pfnSERCOM4_Handler))();
-}
-
-#ifdef TOPPERS_USE_ARDUINO_SERIAL
-void
-rca_SERCOM5_Handler(void)
-{
-#ifdef RCA_ENABLE_PROFILING
-    rca_di();
-    rca_sercom5_isr_cnt++;
-    rca_isr_cnt++;
-    rca_ei();
-#endif /* RCA_ENABLE_PROFILING */    
-    ((void(*)(void))(exception_table.pfnSERCOM5_Handler))();
-}
-#endif /* TOPPERS_USE_ARDUINO_SERIAL */
-
-void
-rca_EIC_Handler(void)
-{
-#ifdef RCA_ENABLE_PROFILING
-    rca_di();
-    rca_eic_isr_cnt++;
-    rca_isr_cnt++;
-    rca_ei();
-#endif /* RCA_ENABLE_PROFILING */    
-    ((void(*)(void))(exception_table.pfnEIC_Handler))();
-}
-
-void
-rca_TC5_Handler(void)
-{
-#ifdef RCA_ENABLE_PROFILING
-    rca_di();
-    rca_tc5_isr_cnt++;
-    rca_isr_cnt++;
-    rca_ei();
-#endif /* RCA_ENABLE_PROFILING */    
-    ((void(*)(void))(exception_table.pfnTC5_Handler))();
-}
-
-void
-rca_RTC_Handler(void)
-{
-#ifdef RCA_ENABLE_PROFILING
-    rca_di();
-    rca_rtc_isr_cnt++;
-    rca_isr_cnt++;
-    rca_ei();
-#endif /* RCA_ENABLE_PROFILING */
-    ((void(*)(void))(exception_table.pfnRTC_Handler))();
-}
-
-/*
- *  For delay
- */
-void
-yield(void){
-#ifdef RCA_RR_SCHEDULE    
-    time_slice = 0;
-#endif /* RCA_RR_SCHEDULE */
-#ifdef RCA_ENABLE_PROFILING
-    rca_di();
-    rca_dispatch_cnt++;
-    rca_ei();
-#endif /* RCA_ENABLE_PROFILING */    
-    dly_tsk(0);
-}
-
-extern void setup(void);
-extern void loop(void);
-
-void
-rca_maintask(intptr_t exinf)
-{
-    syslog(LOG_NOTICE, "Arduino Main Task start!");
-    dly_tsk(1);
-#ifdef USBCON
-    USBDevice.init();
-    USBDevice.attach();
-#endif /* USBCON */
-    
-    analogReference(AR_DEFAULT);
-    
-    setup();
-    
-    sig_sem(SETUP_SEM);
-    
-    chg_pri(0, RCA_MAINTASK_LOOP_PRI);
-    
-    while(1){
-        loop();
-        if (serialEventRun) serialEventRun();
-    }    
-}
-
-#define RCA_TASK_BODY(NUM) \
-extern void task##NUM##_setup(void); \
-extern void task##NUM##_loop(void); \
- \
-void \
-rca_task##NUM(intptr_t exinf) \
-{ \
-    wai_sem(SETUP_SEM);\
-    task##NUM##_setup(); \
-    sig_sem(SETUP_SEM);\
-    chg_pri(0, RCA_TASK##NUM##_LOOP_PRI); \
-         \
-    while(1){ \
-        task##NUM##_loop(); \
-    }     \
-}
-
-#if RCA_NUM_TASK > 0
-RCA_TASK_BODY(1)
-#endif /* RCA_NUM_TASK > 0 */
-
-#if RCA_NUM_TASK > 1
-RCA_TASK_BODY(2)
-#endif /* RCA_NUM_TASK > 1 */
-
-#if RCA_NUM_TASK > 2
-RCA_TASK_BODY(3)
-#endif /* RCA_NUM_TASK > 2 */
-
-#if RCA_NUM_TASK > 3
-RCA_TASK_BODY(4)
-#endif /* RCA_NUM_TASK > 3 */
-
-#if RCA_NUM_TASK > 4
-RCA_TASK_BODY(5)
-#endif /* RCA_NUM_TASK > 4 */
-
-#ifdef RCA_ENABLE_PROFILING
-void
-rca_idle_task(intptr_t exinf) {
-    while(1){
-        rca_di();
-        rca_idle_cnt++;
-        rca_ei();
-    }
-}
-#endif /* RCA_ENABLE_PROFILING */
Index: rtos_arduino/trunk/lib/rca_lib.h
===================================================================
--- rtos_arduino/trunk/lib/rca_lib.h	(revision 259)
+++ 	(revision )
@@ -1,158 +1,0 @@
-#include "rca_app.h"
-
-/*
- *  Max number of task
- */
-#define RCA_NUM_TASK_MAX  5
-
-/*
- *  Check number of task
- */
-#if RCA_NUM_TASK > RCA_NUM_TASK_MAX
-#error The number of Task is over!
-#endif /* RCA_NUM_TASK > RCA_NUM_TASK_MAX */
-
-/*
- *  Idle task loop count per 10ms at idle state
- */
-#define IDLE_TASK_IDLE_LOOP_10MS 42178
-
-/*
- * Default Macro  
- */
-
-/*
- *  Priotiry
- */
-#ifndef RCA_MAINTASK_SETUP_PRI
-#define  RCA_MAINTASK_SETUP_PRI  5
-#endif /*  RCA_MAINTASK_SETUP_PRI */
-
-#ifndef RCA_MAINTASK_LOOP_PRI
-#define  RCA_MAINTASK_LOOP_PRI  5
-#endif /*  RCA_MAINTASK_SETUP_PRI */
-
-#ifndef RCA_TASK1_SETUP_PRI
-#define  RCA_TASK1_SETUP_PRI  5
-#endif /*  RCA_TASK1_SETUP_PRI */
-
-#ifndef RCA_TASK1_LOOP_PRI
-#define  RCA_TASK1_LOOP_PRI  5
-#endif /*  RCA_TASK1_SETUP_PRI */
-
-#ifndef RCA_TASK2_SETUP_PRI
-#define  RCA_TASK2_SETUP_PRI  5
-#endif /*  RCA_TASK2_SETUP_PRI */
-
-#ifndef RCA_TASK2_LOOP_PRI
-#define  RCA_TASK2_LOOP_PRI  5
-#endif /*  RCA_TASK2_SETUP_PRI */
-
-#ifndef RCA_TASK3_SETUP_PRI
-#define  RCA_TASK3_SETUP_PRI  5
-#endif /*  RCA_TASK3_SETUP_PRI */
-
-#ifndef RCA_TASK3_LOOP_PRI
-#define  RCA_TASK3_LOOP_PRI  5
-#endif /*  RCA_TASK3_SETUP_PRI */
-
-#ifndef RCA_TASK4_SETUP_PRI
-#define  RCA_TASK4_SETUP_PRI  5
-#endif /*  RCA_TASK4_SETUP_PRI */
-
-#ifndef RCA_TASK4_LOOP_PRI
-#define  RCA_TASK4_LOOP_PRI  5
-#endif /*  RCA_TASK4_SETUP_PRI */
-
-#ifndef RCA_TASK5_SETUP_PRI
-#define  RCA_TASK5_SETUP_PRI  5
-#endif /*  RCA_TASK5_SETUP_PRI */
-
-#ifndef RCA_TASK5_LOOP_PRI
-#define  RCA_TASK5_LOOP_PRI  5
-#endif /*  RCA_TASK3_SETUP_PRI */
-
-/*
- *  Stack Size
- */
-#ifndef RCA_MAINTASK_STACK_SIZE
-#define RCA_MAINTASK_STACK_SIZE 2048
-#endif  /* RCA_MAINTASK_STACK_SIZE */
-
-#ifndef RCA_TASK1_STACK_SIZE
-#define RCA_TASK1_STACK_SIZE 1024
-#endif  /* RCA_TASK1_STACK_SIZE */
-
-#ifndef RCA_TASK2_STACK_SIZE
-#define RCA_TASK2_STACK_SIZE 1024
-#endif  /* RCA_TASK2_STACK_SIZE */
-
-#ifndef RCA_TASK3_STACK_SIZE
-#define RCA_TASK3_STACK_SIZE 1024
-#endif  /* RCA_TASK3_STACK_SIZE */
-
-#ifndef RCA_TASK4_STACK_SIZE
-#define RCA_TASK4_STACK_SIZE 1024
-#endif  /* RCA_TASK4_STACK_SIZE */
-
-#ifndef RCA_TASK5_STACK_SIZE
-#define RCA_TASK5_STACK_SIZE 1024
-#endif  /* RCA_TASK5_STACK_SIZE */
-
-
-/*
- *  Round Robin Scheduling cycle
- */
-#ifndef RCA_RR_SCHEDULE_CYCLE
-#define RCA_RR_SCHEDULE_CYCLE 1
-#endif /* RCA_RR_SCHEDULE_CYCLE */
-  
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern void rca_init(intptr_t exinf);
-extern void rca_maintask(intptr_t exinf);
-extern void rca_task1(intptr_t exinf);
-extern void rca_task2(intptr_t exinf);
-extern void rca_task3(intptr_t exinf);
-extern void rca_task4(intptr_t exinf);
-extern void rca_task5(intptr_t exinf);
-extern void rca_CycHandler(intptr_t exinf);
-
-extern void rca_USB_Handler(void);
-extern void rca_SERCOM0_Handler(void);
-extern void rca_SERCOM2_Handler(void);
-extern void rca_SERCOM3_Handler(void);
-extern void rca_SERCOM4_Handler(void);
-extern void rca_SERCOM5_Handler(void);
-extern void rca_EIC_Handler(void);
-extern void rca_TC5_Handler(void);
-extern void rca_RTC_Handler(void);
-
-#ifdef RCA_ENABLE_PROFILING
-extern void rca_idle_task(intptr_t exinf);
-extern volatile uint32_t rca_idle_result;
-extern volatile uint32_t rca_isr_result;
-extern volatile uint32_t rca_dispatch_result;
-extern volatile uint32_t rca_timer_isr_result;
-extern volatile uint32_t rca_usb_isr_result;
-extern volatile uint32_t rca_sercom0_isr_result;
-extern volatile uint32_t rca_sercom4_isr_result;
-extern volatile uint32_t rca_sercom5_isr_result;
-extern volatile uint32_t rca_eic_isr_result;
-extern volatile uint32_t rca_tc5_isr_result;
-extern volatile uint32_t rca_rtc_isr_result;
-
-#ifdef RCA_USE_SERIAL3
-extern volatile uint32_t rca_sercom3_isr_result;
-#endif /* RCA_USE_SERIAL3 */
-  
-#endif /* RCA_ENABLE_PROFILING */
-
-#define WIRE_ENTER_CRITICAL wai_sem(WIRE_SEM);
-#define WIRE_LEAVE_CRITICAL sig_sem(WIRE_SEM);
-
-#ifdef __cplusplus
-}
-#endif
