Index: rtos_arduino/trunk/README.txt
===================================================================
--- rtos_arduino/trunk/README.txt	(revision 136)
+++ rtos_arduino/trunk/README.txt	(revision 137)
@@ -1,5 +1,5 @@
 =====================================================================
        TOPPERS RTE/RTOS compatible with Arduino libraries : RCA  
-                                   Last Modified:2015 Nov 24 23:46:50
+                                   Last Modified:2015 Nov 25 00:27:39
 =====================================================================
 
@@ -304,4 +304,16 @@
 #endif /* defined(ARDUINO_ARCH_SAMD) */    
 
+
+hardware/arduino/samd/cores/arduino/wiring_analog.c
+å
+é ­ã«ä»¥ä¸ãè¿½å ï¼
+
+// Wait for synchronization of registers between the clock domains
+static __inline__ void syncDAC() __attribute__((always_inline, unused));
+static void syncDAC() {
+  while (DAC->STATUS.bit.SYNCBUSY == 1)
+    ;
+}
+
 âTOPPERSå¯¾å¿
 /hardware/tools/CMSIS/CMSIS/Include/core_cm0plus.h : 646è¡ç®
Index: rtos_arduino/trunk/arduino_lib/hardware/arduino/samd/cores/arduino/wiring_analog.c
===================================================================
--- rtos_arduino/trunk/arduino_lib/hardware/arduino/samd/cores/arduino/wiring_analog.c	(revision 136)
+++ rtos_arduino/trunk/arduino_lib/hardware/arduino/samd/cores/arduino/wiring_analog.c	(revision 137)
@@ -30,4 +30,11 @@
 static int ADC_RESOLUTION = 12;
 static int DAC_RESOLUTION = 10;
+
+// Wait for synchronization of registers between the clock domains
+static __inline__ void syncDAC() __attribute__((always_inline, unused));
+static void syncDAC() {
+  while (DAC->STATUS.bit.SYNCBUSY == 1)
+    ;
+}
 
 void analogReadResolution(int res) {
Index: rtos_arduino/trunk/examples/Basic/Makefile
===================================================================
--- rtos_arduino/trunk/examples/Basic/Makefile	(revision 137)
+++ rtos_arduino/trunk/examples/Basic/Makefile	(revision 137)
@@ -0,0 +1,54 @@
+#
+#  ã¿ã¼ã²ããã®æå®ï¼Makefile.targetã§ä¸æ¸ããããã®ãé²ãããï¼
+#
+all:
+
+#
+#  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
+#
+APPL_CXXOBJS += rca_app.o
+APPL_COBJS   += 
+APPL_CFG      = rca_app.cfg
+
+#
+#  Serialã®æ±ã
+#   ARDUINO_SERIAL
+#    NOUSE_SERIAL
+#    USE_SERIAL
+#    USE_SERIALUSB_AS_SERIAL
+#    USE_SERIAL5_AS_SERIAL
+#
+#ARDUINO_SERIAL = NOUSE_SERIAL
+ARDUINO_SERIAL = USE_SERIAL
+#ARDUINO_SERIAL = USE_SERIALUSB_AS_SERIAL
+#ARDUINO_SERIAL = USE_SERIAL5_AS_SERIAL
+
+#
+#  ã©ã¤ãã©ãªã®ä½¿ç¨
+#  
+#USE_ARDUINO_SPI = true
+#USE_ARDUINO_NCESCAN = true
+#USE_ARDUINO_SD  = true
+#USE_ARDUINO_TFT = true
+#USE_ETHERNET2 = true
+#USE_NAXESMOTION = true
+USE_ARDUINO_RTC = true
+
+#
+#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+RCA_DIR = ../..
+
+#
+#  ASPã½ã¼ã¹ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+SRCDIR = ../../asp_1.9.2
+
+#
+#  ãã®ä»ã®ãªãã·ã§ã³
+#
+APPL_CFLAGS =
+APPL_LIBS =
+APPL_DIR = 
+
+include $(RCA_DIR)/lib/Makefile.rca
Index: rtos_arduino/trunk/examples/Basic/do_clean.bat
===================================================================
--- rtos_arduino/trunk/examples/Basic/do_clean.bat	(revision 137)
+++ rtos_arduino/trunk/examples/Basic/do_clean.bat	(revision 137)
@@ -0,0 +1,3 @@
+call ../do_path.bat
+make clean
+pause
Index: rtos_arduino/trunk/examples/Basic/do_debug.bat
===================================================================
--- rtos_arduino/trunk/examples/Basic/do_debug.bat	(revision 137)
+++ rtos_arduino/trunk/examples/Basic/do_debug.bat	(revision 137)
@@ -0,0 +1,4 @@
+call ../do_path.bat
+make ocd
+make db
+taskkill /F /IM openocd.exe
Index: rtos_arduino/trunk/examples/Basic/do_make.bat
===================================================================
--- rtos_arduino/trunk/examples/Basic/do_make.bat	(revision 137)
+++ rtos_arduino/trunk/examples/Basic/do_make.bat	(revision 137)
@@ -0,0 +1,3 @@
+call ../do_path.bat
+make all
+pause
Index: rtos_arduino/trunk/examples/Basic/do_run.bat
===================================================================
--- rtos_arduino/trunk/examples/Basic/do_run.bat	(revision 137)
+++ rtos_arduino/trunk/examples/Basic/do_run.bat	(revision 137)
@@ -0,0 +1,2 @@
+call ../do_path.bat
+make run
Index: rtos_arduino/trunk/examples/Basic/pitches.h
===================================================================
--- rtos_arduino/trunk/examples/Basic/pitches.h	(revision 137)
+++ rtos_arduino/trunk/examples/Basic/pitches.h	(revision 137)
@@ -0,0 +1,90 @@
+#define NOTE_B0  31
+#define NOTE_C1  33
+#define NOTE_CS1 35
+#define NOTE_D1  37
+#define NOTE_DS1 39
+#define NOTE_E1  41
+#define NOTE_F1  44
+#define NOTE_FS1 46
+#define NOTE_G1  49
+#define NOTE_GS1 52
+#define NOTE_A1  55
+#define NOTE_AS1 58
+#define NOTE_B1  62
+#define NOTE_C2  65
+#define NOTE_CS2 69
+#define NOTE_D2  73
+#define NOTE_DS2 78
+#define NOTE_E2  82
+#define NOTE_F2  87
+#define NOTE_FS2 93
+#define NOTE_G2  98
+#define NOTE_GS2 104
+#define NOTE_A2  110
+#define NOTE_AS2 117
+#define NOTE_B2  123
+#define NOTE_C3  131
+#define NOTE_CS3 139
+#define NOTE_D3  147
+#define NOTE_DS3 156
+#define NOTE_E3  165
+#define NOTE_F3  175
+#define NOTE_FS3 185
+#define NOTE_G3  196
+#define NOTE_GS3 208
+#define NOTE_A3  220
+#define NOTE_AS3 233
+#define NOTE_B3  247
+#define NOTE_C4  262
+#define NOTE_CS4 277
+#define NOTE_D4  294
+#define NOTE_DS4 311
+#define NOTE_E4  330
+#define NOTE_F4  349
+#define NOTE_FS4 370
+#define NOTE_G4  392
+#define NOTE_GS4 415
+#define NOTE_A4  440
+#define NOTE_AS4 466
+#define NOTE_B4  494
+#define NOTE_C5  523
+#define NOTE_CS5 554
+#define NOTE_D5  587
+#define NOTE_DS5 622
+#define NOTE_E5  659
+#define NOTE_F5  698
+#define NOTE_FS5 740
+#define NOTE_G5  784
+#define NOTE_GS5 831
+#define NOTE_A5  880
+#define NOTE_AS5 932
+#define NOTE_B5  988
+#define NOTE_C6  1047
+#define NOTE_CS6 1109
+#define NOTE_D6  1175
+#define NOTE_DS6 1245
+#define NOTE_E6  1319
+#define NOTE_F6  1397
+#define NOTE_FS6 1480
+#define NOTE_G6  1568
+#define NOTE_GS6 1661
+#define NOTE_A6  1760
+#define NOTE_AS6 1865
+#define NOTE_B6  1976
+#define NOTE_C7  2093
+#define NOTE_CS7 2217
+#define NOTE_D7  2349
+#define NOTE_DS7 2489
+#define NOTE_E7  2637
+#define NOTE_F7  2794
+#define NOTE_FS7 2960
+#define NOTE_G7  3136
+#define NOTE_GS7 3322
+#define NOTE_A7  3520
+#define NOTE_AS7 3729
+#define NOTE_B7  3951
+#define NOTE_C8  4186
+#define NOTE_CS8 4435
+#define NOTE_D8  4699
+#define NOTE_DS8 4978
+
Index: rtos_arduino/trunk/examples/Basic/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/Basic/rca.atsln	(revision 137)
+++ rtos_arduino/trunk/examples/Basic/rca.atsln	(revision 137)
@@ -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}") = "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 137)
+++ rtos_arduino/trunk/examples/Basic/rca.componentinfo.xml	(revision 137)
@@ -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/Basic/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/Basic/rca.cproj	(revision 137)
+++ rtos_arduino/trunk/examples/Basic/rca.cproj	(revision 137)
@@ -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>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 137)
+++ rtos_arduino/trunk/examples/Basic/rca_app.cfg	(revision 137)
@@ -0,0 +1,8 @@
+/*
+ *  $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 137)
+++ rtos_arduino/trunk/examples/Basic/rca_app.cpp	(revision 137)
@@ -0,0 +1,310 @@
+#include "rca.h"
+
+#define BLINK
+//#define toneMelody
+//#define USBUART
+//#define SERIALUSB
+//#define SERIAL5
+//#define ATTACHINTERRUPT
+//#define ANALOGWRITE
+//#define ANALOGREAD
+//#define RTC_ALARM
+
+#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 */
Index: rtos_arduino/trunk/examples/Basic/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/Basic/rca_app.h	(revision 137)
+++ rtos_arduino/trunk/examples/Basic/rca_app.h	(revision 137)
@@ -0,0 +1,6 @@
+#ifndef _RCA_APP_H_
+#define _RCA_APP_H_
+
+#define RCA_NUM_TASK 0
+
+#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_Sensor/Adafruit_Sensor.h
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_Sensor/Adafruit_Sensor.h	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_Sensor/Adafruit_Sensor.h	(revision 137)
@@ -0,0 +1,154 @@
+/*
+* Copyright (C) 2008 The Android Open Source Project
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software< /span>
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+/* Update by K. Townsend (Adafruit Industries) for lighter typedefs, and
+ * extended sensor support to include color, voltage and current */
+ 
+#ifndef _ADAFRUIT_SENSOR_H
+#define _ADAFRUIT_SENSOR_H
+
+#if ARDUINO >= 100
+ #include "Arduino.h"
+ #include "Print.h"
+#else
+ #include "WProgram.h"
+#endif
+
+/* Intentionally modeled after sensors.h in the Android API:
+ * https://github.com/android/platform_hardware_libhardware/blob/master/include/hardware/sensors.h */
+
+/* Constants */
+#define SENSORS_GRAVITY_EARTH             (9.80665F)              /**< Earth's gravity in m/s^2 */
+#define SENSORS_GRAVITY_MOON              (1.6F)                  /**< The moon's gravity in m/s^2 */
+#define SENSORS_GRAVITY_SUN               (275.0F)                /**< The sun's gravity in m/s^2 */
+#define SENSORS_GRAVITY_STANDARD          (SENSORS_GRAVITY_EARTH)
+#define SENSORS_MAGFIELD_EARTH_MAX        (60.0F)                 /**< Maximum magnetic field on Earth's surface */
+#define SENSORS_MAGFIELD_EARTH_MIN        (30.0F)                 /**< Minimum magnetic field on Earth's surface */
+#define SENSORS_PRESSURE_SEALEVELHPA      (1013.25F)              /**< Average sea level pressure is 1013.25 hPa */
+#define SENSORS_DPS_TO_RADS               (0.017453293F)          /**< Degrees/s to rad/s multiplier */
+#define SENSORS_GAUSS_TO_MICROTESLA       (100)                   /**< Gauss to micro-Tesla multiplier */
+
+/** Sensor types */
+typedef enum
+{
+  SENSOR_TYPE_ACCELEROMETER         = (1),   /**< Gravity + linear acceleration */
+  SENSOR_TYPE_MAGNETIC_FIELD        = (2),
+  SENSOR_TYPE_ORIENTATION           = (3),
+  SENSOR_TYPE_GYROSCOPE             = (4),
+  SENSOR_TYPE_LIGHT                 = (5),
+  SENSOR_TYPE_PRESSURE              = (6),
+  SENSOR_TYPE_PROXIMITY             = (8),
+  SENSOR_TYPE_GRAVITY               = (9),
+  SENSOR_TYPE_LINEAR_ACCELERATION   = (10),  /**< Acceleration not including gravity */
+  SENSOR_TYPE_ROTATION_VECTOR       = (11),
+  SENSOR_TYPE_RELATIVE_HUMIDITY     = (12),
+  SENSOR_TYPE_AMBIENT_TEMPERATURE   = (13),
+  SENSOR_TYPE_VOLTAGE               = (15),
+  SENSOR_TYPE_CURRENT               = (16),
+  SENSOR_TYPE_COLOR                 = (17)
+} sensors_type_t;
+
+/** struct sensors_vec_s is used to return a vector in a common format. */
+typedef struct {
+    union {
+        float v[3];
+        struct {
+            float x;
+            float y;
+            float z;
+        };
+        /* Orientation sensors */
+        struct {
+            float roll;    /**< Rotation around the longitudinal axis (the plane body, 'X axis'). Roll is positive and increasing when moving downward. -90°<=roll<=90° */
+            float pitch;   /**< Rotation around the lateral axis (the wing span, 'Y axis'). Pitch is positive and increasing when moving upwards. -180°<=pitch<=180°) */
+            float heading; /**< Angle between the longitudinal axis (the plane body) and magnetic north, measured clockwise when viewing from the top of the device. 0-359° */
+        };
+    };
+    int8_t status;
+    uint8_t reserved[3];
+} sensors_vec_t;
+
+/** struct sensors_color_s is used to return color data in a common format. */
+typedef struct {
+    union {
+        float c[3];
+        /* RGB color space */
+        struct {
+            float r;       /**< Red component */
+            float g;       /**< Green component */
+            float b;       /**< Blue component */
+        };
+    };
+    uint32_t rgba;         /**< 24-bit RGBA value */
+} sensors_color_t;
+
+/* Sensor event (36 bytes) */
+/** struct sensor_event_s is used to provide a single sensor event in a common format. */
+typedef struct
+{
+    int32_t version;                          /**< must be sizeof(struct sensors_event_t) */
+    int32_t sensor_id;                        /**< unique sensor identifier */
+    int32_t type;                             /**< sensor type */
+    int32_t reserved0;                        /**< reserved */
+    int32_t timestamp;                        /**< time is in milliseconds */
+    union
+    {
+        float           data[4];
+        sensors_vec_t   acceleration;         /**< acceleration values are in meter per second per second (m/s^2) */
+        sensors_vec_t   magnetic;             /**< magnetic vector values are in micro-Tesla (uT) */
+        sensors_vec_t   orientation;          /**< orientation values are in degrees */
+        sensors_vec_t   gyro;                 /**< gyroscope values are in rad/s */
+        float           temperature;          /**< temperature is in degrees centigrade (Celsius) */
+        float           distance;             /**< distance in centimeters */
+        float           light;                /**< light in SI lux units */
+        float           pressure;             /**< pressure in hectopascal (hPa) */
+        float           relative_humidity;    /**< relative humidity in percent */
+        float           current;              /**< current in milliamps (mA) */
+        float           voltage;              /**< voltage in volts (V) */
+        sensors_color_t color;                /**< color in RGB component values */
+    };
+} sensors_event_t;
+
+/* Sensor details (40 bytes) */
+/** struct sensor_s is used to describe basic information about a specific sensor. */
+typedef struct
+{
+    char     name[12];                        /**< sensor name */
+    int32_t  version;                         /**< version of the hardware + driver */
+    int32_t  sensor_id;                       /**< unique sensor identifier */
+    int32_t  type;                            /**< this sensor's type (ex. SENSOR_TYPE_LIGHT) */
+    float    max_value;                       /**< maximum value of this sensor's value in SI units */
+    float    min_value;                       /**< minimum value of this sensor's value in SI units */
+    float    resolution;                      /**< smallest difference between two values reported by this sensor */
+    int32_t  min_delay;                       /**< min delay in microseconds between events. zero = not a constant rate */
+} sensor_t;
+
+class Adafruit_Sensor {
+ public:
+  // Constructor(s)
+  Adafruit_Sensor() {}
+  virtual ~Adafruit_Sensor() {}
+
+  // These must be defined by the subclass
+    virtual void enableAutoRange(bool enabled) {};
+    virtual bool getEvent(sensors_event_t*){};
+    virtual void getSensor(sensor_t*){};
+  
+ private:
+  bool _autoRange;
+};
+
+#endif
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_Sensor/README.md
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_Sensor/README.md	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_Sensor/README.md	(revision 137)
@@ -0,0 +1,221 @@
+# Adafruit Unified Sensor Driver #
+
+Many small embedded systems exist to collect data from sensors, analyse the data, and either take an appropriate action or send that sensor data to another system for processing.
+
+One of the many challenges of embedded systems design is the fact that parts you used today may be out of production tomorrow, or system requirements may change and you may need to choose a different sensor down the road.
+
+Creating new drivers is a relatively easy task, but integrating them into existing systems is both error prone and time consuming since sensors rarely use the exact same units of measurement.
+
+By reducing all data to a single **sensors\_event\_t** 'type' and settling on specific, **standardised SI units** for each sensor family the same sensor types return values that are comparable with any other similar sensor.  This enables you to switch sensor models with very little impact on the rest of the system, which can help mitigate some of the risks and problems of sensor availability and code reuse.
+
+The unified sensor abstraction layer is also useful for data-logging and data-transmission since you only have one well-known type to log or transmit over the air or wire.
+
+## Unified Sensor Drivers ##
+
+The following drivers are based on the Adafruit Unified Sensor Driver:
+
+**Accelerometers**
+  - [Adafruit\_ADXL345](https://github.com/adafruit/Adafruit_ADXL345)
+  - [Adafruit\_LSM303DLHC](https://github.com/adafruit/Adafruit_LSM303DLHC)
+  - [Adafruit\_MMA8451\_Library](https://github.com/adafruit/Adafruit_MMA8451_Library)
+
+**Gyroscope**
+  - [Adafruit\_L3GD20\_U](https://github.com/adafruit/Adafruit_L3GD20_U)
+
+**Light**
+  - [Adafruit\_TSL2561](https://github.com/adafruit/Adafruit_TSL2561)
+  - [Adafruit\_TSL2591\_Library](https://github.com/adafruit/Adafruit_TSL2591_Library)
+
+**Magnetometers**
+  - [Adafruit\_LSM303DLHC](https://github.com/adafruit/Adafruit_LSM303DLHC)
+  - [Adafruit\_HMC5883\_Unified](https://github.com/adafruit/Adafruit_HMC5883_Unified)
+  
+**Barometric Pressure**
+  - [Adafruit\_BMP085\_Unified](https://github.com/adafruit/Adafruit_BMP085_Unified)
+  - [Adafruit\_BMP183\_Unified\_Library](https://github.com/adafruit/Adafruit_BMP183_Unified_Library)
+
+**Humidity & Temperature**
+  - [Adafruit\_DHT\_Unified](https://github.com/adafruit/Adafruit_DHT_Unified)
+
+**Orientation**
+ - [Adafruit_BNO055](https://github.com/adafruit/Adafruit_BNO055)
+
+## How Does it Work? ##
+
+Any driver that supports the Adafruit unified sensor abstraction layer will implement the Adafruit\_Sensor base class.  There are two main typedefs and one enum defined in Adafruit_Sensor.h that are used to 'abstract' away the sensor details and values:
+
+**Sensor Types (sensors\_type\_t)**
+
+These pre-defined sensor types are used to properly handle the two related typedefs below, and allows us determine what types of units the sensor uses, etc.
+
+```
+/** Sensor types */
+typedef enum
+{
+  SENSOR_TYPE_ACCELEROMETER         = (1),
+  SENSOR_TYPE_MAGNETIC_FIELD        = (2),
+  SENSOR_TYPE_ORIENTATION           = (3),
+  SENSOR_TYPE_GYROSCOPE             = (4),
+  SENSOR_TYPE_LIGHT                 = (5),
+  SENSOR_TYPE_PRESSURE              = (6),
+  SENSOR_TYPE_PROXIMITY             = (8),
+  SENSOR_TYPE_GRAVITY               = (9),
+  SENSOR_TYPE_LINEAR_ACCELERATION   = (10),
+  SENSOR_TYPE_ROTATION_VECTOR       = (11),
+  SENSOR_TYPE_RELATIVE_HUMIDITY     = (12),
+  SENSOR_TYPE_AMBIENT_TEMPERATURE   = (13),
+  SENSOR_TYPE_VOLTAGE               = (15),
+  SENSOR_TYPE_CURRENT               = (16),
+  SENSOR_TYPE_COLOR                 = (17)
+} sensors_type_t;
+```
+
+**Sensor Details (sensor\_t)**
+
+This typedef describes the specific capabilities of this sensor, and allows us to know what sensor we are using beneath the abstraction layer.
+
+```
+/* Sensor details (40 bytes) */
+/** struct sensor_s is used to describe basic information about a specific sensor. */
+typedef struct
+{
+    char     name[12];
+    int32_t  version;
+    int32_t  sensor_id;
+    int32_t  type;
+    float    max_value;
+    float    min_value;
+    float    resolution;
+    int32_t  min_delay;
+} sensor_t;
+```
+
+The individual fields are intended to be used as follows:
+
+- **name**: The sensor name or ID, up to a maximum of twelve characters (ex. "MPL115A2")
+- **version**: The version of the sensor HW and the driver to allow us to differentiate versions of the board or driver
+- **sensor\_id**: A unique sensor identifier that is used to differentiate this specific sensor instance from any others that are present on the system or in the sensor network
+- **type**: The sensor type, based on **sensors\_type\_t** in sensors.h
+- **max\_value**: The maximum value that this sensor can return (in the appropriate SI unit)
+- **min\_value**: The minimum value that this sensor can return (in the appropriate SI unit)
+- **resolution**: The smallest difference between two values that this sensor can report (in the appropriate SI unit)
+- **min\_delay**: The minimum delay in microseconds between two sensor events, or '0' if there is no constant sensor rate
+
+**Sensor Data/Events (sensors\_event\_t)**
+
+This typedef is used to return sensor data from any sensor supported by the abstraction layer, using standard SI units and scales.
+
+```
+/* Sensor event (36 bytes) */
+/** struct sensor_event_s is used to provide a single sensor event in a common format. */
+typedef struct
+{
+    int32_t version;
+    int32_t sensor_id;
+    int32_t type;
+    int32_t reserved0;
+    int32_t timestamp;
+    union
+    {
+        float           data[4];
+        sensors_vec_t   acceleration;
+        sensors_vec_t   magnetic;
+        sensors_vec_t   orientation;
+        sensors_vec_t   gyro;
+        float           temperature;
+        float           distance;
+        float           light;
+        float           pressure;
+        float           relative_humidity;
+        float           current;
+        float           voltage;
+        sensors_color_t color;
+    };
+} sensors_event_t;
+```
+It includes the following fields:
+
+- **version**: Contain 'sizeof(sensors\_event\_t)' to identify which version of the API we're using in case this changes in the future
+- **sensor\_id**: A unique sensor identifier that is used to differentiate this specific sensor instance from any others that are present on the system or in the sensor network (must match the sensor\_id value in the corresponding sensor\_t enum above!)
+- **type**: the sensor type, based on **sensors\_type\_t** in sensors.h
+- **timestamp**: time in milliseconds when the sensor value was read
+- **data[4]**: An array of four 32-bit values that allows us to encapsulate any type of sensor data via a simple union (further described below)
+
+**Required Functions**
+
+In addition to the two standard types and the sensor type enum, all drivers based on Adafruit_Sensor must also implement the following two functions:
+
+```
+bool getEvent(sensors_event_t*);
+```
+Calling this function will populate the supplied sensors\_event\_t reference with the latest available sensor data.  You should call this function as often as you want to update your data.
+
+```
+void getSensor(sensor_t*);
+```
+Calling this function will provide some basic information about the sensor (the sensor name, driver version, min and max values, etc.
+
+**Standardised SI values for sensors\_event\_t**
+
+A key part of the abstraction layer is the standardisation of values on SI units of a particular scale, which is accomplished via the data[4] union in sensors\_event\_t above.  This 16 byte union includes fields for each main sensor type, and uses the following SI units and scales:
+
+- **acceleration**: values are in **meter per second per second** (m/s^2)
+- **magnetic**: values are in **micro-Tesla** (uT)
+- **orientation**: values are in **degrees**
+- **gyro**: values are in **rad/s**
+- **temperature**: values in **degrees centigrade** (Celsius) 
+- **distance**: values are in **centimeters**
+- **light**: values are in **SI lux** units
+- **pressure**: values are in **hectopascal** (hPa)
+- **relative\_humidity**: values are in **percent**
+- **current**: values are in **milliamps** (mA)
+- **voltage**: values are in **volts** (V)
+- **color**: values are in 0..1.0 RGB channel luminosity and 32-bit RGBA format
+
+## The Unified Driver Abstraction Layer in Practice ##
+
+Using the unified sensor abstraction layer is relatively easy once a compliant driver has been created.
+
+Every compliant sensor can now be read using a single, well-known 'type' (sensors\_event\_t), and there is a standardised way of interrogating a sensor about its specific capabilities (via sensor\_t).
+
+An example of reading the [TSL2561](https://github.com/adafruit/Adafruit_TSL2561) light sensor can be seen below:
+
+```
+ Adafruit_TSL2561 tsl = Adafruit_TSL2561(TSL2561_ADDR_FLOAT, 12345);
+ ...
+ /* Get a new sensor event */ 
+ sensors_event_t event;
+ tsl.getEvent(&event);
+ 
+ /* Display the results (light is measured in lux) */
+ if (event.light)
+ {
+   Serial.print(event.light); Serial.println(" lux");
+ }
+ else
+ {
+   /* If event.light = 0 lux the sensor is probably saturated
+      and no reliable data could be generated! */
+   Serial.println("Sensor overload");
+ }
+```
+
+Similarly, we can get the basic technical capabilities of this sensor with the following code:
+
+```
+ sensor_t sensor;
+ 
+ sensor_t sensor;
+ tsl.getSensor(&sensor);
+
+ /* Display the sensor details */
+ 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("");
+```
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_Sensor/library.properties
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_Sensor/library.properties	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_Sensor/library.properties	(revision 137)
@@ -0,0 +1,9 @@
+name=Adafruit Unified Sensor
+version=1.0.2
+author=Adafruit <info@adafruit.com>
+maintainer=Adafruit <info@adafruit.com>
+sentence=Required for all Adafruit Unified Sensor based libraries.
+paragraph=A unified sensor abstraction layer used by many Adafruit sensor libraries.
+category=Sensors
+url=https://github.com/adafruit/Adafruit_Sensor
+architectures=*
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_TMP007_Library/Adafruit_TMP007.cpp
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_TMP007_Library/Adafruit_TMP007.cpp	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_TMP007_Library/Adafruit_TMP007.cpp	(revision 137)
@@ -0,0 +1,153 @@
+/*************************************************** 
+  This is a library for the TMP007 Temp Sensor
+
+  Designed specifically to work with the Adafruit TMP007 Breakout 
+  ----> https://www.adafruit.com/products/2023
+
+  These displays use I2C to communicate, 2 pins are required to  
+  interface
+  Adafruit invests time and resources providing this open source code, 
+  please support Adafruit and open-source hardware by purchasing 
+  products from Adafruit!
+
+  Written by Limor Fried/Ladyada for Adafruit Industries.  
+  BSD license, all text above must be included in any redistribution
+ ****************************************************/
+
+#include "Adafruit_TMP007.h"
+//#include <util/delay.h>
+
+//#define TESTDIE 0x0C78
+//#define TESTVOLT 0xFEED
+
+Adafruit_TMP007::Adafruit_TMP007(uint8_t i2caddr) {
+  _addr = i2caddr;
+}
+
+
+boolean Adafruit_TMP007::begin(uint16_t samplerate) {
+  Wire.begin();
+  write16(TMP007_CONFIG, TMP007_CFG_MODEON | TMP007_CFG_ALERTEN | 
+	  TMP007_CFG_TRANSC | samplerate);
+  write16(TMP007_STATMASK, TMP007_STAT_ALERTEN |TMP007_STAT_CRTEN);
+  // enable conversion ready alert
+  uint16_t did;
+  did = read16(TMP007_DEVID);
+#ifdef TMP007_DEBUG
+  Serial.print("did = 0x"); Serial.println(did, HEX);
+#endif
+  if (did != 0x78) return false;
+  return true;
+}
+
+//////////////////////////////////////////////////////
+
+double Adafruit_TMP007::readDieTempC(void) {
+   double Tdie = readRawDieTemperature();
+   Tdie *= 0.03125; // convert to celsius
+#ifdef TMP007_DEBUG
+   Serial.print("Tdie = "); Serial.print(Tdie); Serial.println(" C");
+#endif
+   return Tdie;
+}
+
+double Adafruit_TMP007::readObjTempC(void) {
+  int16_t raw = read16(TMP007_TOBJ);
+  // invalid
+  if (raw & 0x1) return NAN;
+  raw >>=2;
+
+  double Tobj = raw;
+  Tobj *= 0.03125; // convert to celsius
+#ifdef TMP007_DEBUG
+   Serial.print("Tobj = "); Serial.print(Tobj); Serial.println(" C");
+#endif
+   return Tobj;
+}
+
+
+
+int16_t Adafruit_TMP007::readRawDieTemperature(void) {
+  int16_t raw = read16(TMP007_TDIE);
+
+#if TMP007_DEBUG == 1
+
+#ifdef TESTDIE
+  raw = TESTDIE;
+#endif
+
+  Serial.print("Raw Tambient: 0x"); Serial.print (raw, HEX);
+  
+
+  float v = raw/4;
+  v *= 0.03125;
+  Serial.print(" ("); Serial.print(v); Serial.println(" *C)");
+#endif
+  raw >>= 2;
+  return raw;
+}
+
+int16_t Adafruit_TMP007::readRawVoltage(void) {
+  int16_t raw;
+
+  raw = read16(TMP007_VOBJ);
+
+#if TMP007_DEBUG == 1
+
+#ifdef TESTVOLT
+  raw = TESTVOLT;
+#endif
+
+  Serial.print("Raw voltage: 0x"); Serial.print (raw, HEX);
+  float v = raw;
+  v *= 156.25;
+  v /= 1000;
+  Serial.print(" ("); Serial.print(v); Serial.println(" uV)");
+#endif
+  return raw; 
+}
+
+
+/*********************************************************************/
+
+uint16_t Adafruit_TMP007::read16(uint8_t a) {
+  uint16_t ret;
+
+  Wire.beginTransmission(_addr); // start transmission to device 
+#if (ARDUINO >= 100)
+  Wire.write(a); // sends register address to read from
+#else
+  Wire.send(a); // sends register address to read from
+#endif
+  Wire.endTransmission(); // end transmission
+  
+  Wire.beginTransmission(_addr); // start transmission to device 
+  Wire.requestFrom(_addr, (uint8_t)2);// send data n-bytes read
+#if (ARDUINO >= 100)
+  ret = Wire.read(); // receive DATA
+  ret <<= 8;
+  ret |= Wire.read(); // receive DATA
+#else
+  ret = Wire.receive(); // receive DATA
+  ret <<= 8;
+  ret |= Wire.receive(); // receive DATA
+#endif
+  Wire.endTransmission(); // end transmission
+
+  return ret;
+}
+
+void Adafruit_TMP007::write16(uint8_t a, uint16_t d) {
+  Wire.beginTransmission(_addr); // start transmission to device 
+#if (ARDUINO >= 100)
+  Wire.write(a); // sends register address to read from
+  Wire.write(d>>8);  // write data
+  Wire.write(d);  // write data
+#else
+  Wire.send(a); // sends register address to read from
+  Wire.send(d>>8);  // write data
+  Wire.send(d);  // write data
+#endif
+  Wire.endTransmission(); // end transmission
+}
+
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_TMP007_Library/Adafruit_TMP007.h
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_TMP007_Library/Adafruit_TMP007.h	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_TMP007_Library/Adafruit_TMP007.h	(revision 137)
@@ -0,0 +1,68 @@
+/*************************************************** 
+  This is a library for the TMP007 Temp Sensor
+
+  Designed specifically to work with the Adafruit TMP007 Breakout 
+  ----> https://www.adafruit.com/products/2023
+
+  These displays use I2C to communicate, 2 pins are required to  
+  interface
+  Adafruit invests time and resources providing this open source code, 
+  please support Adafruit and open-source hardware by purchasing 
+  products from Adafruit!
+
+  Written by Limor Fried/Ladyada for Adafruit Industries.  
+  BSD license, all text above must be included in any redistribution
+ ****************************************************/
+
+#if (ARDUINO >= 100)
+ #include "Arduino.h"
+#else
+ #include "WProgram.h"
+#endif
+#include "Wire.h"
+
+// uncomment for debugging!
+//#define TMP007_DEBUG 1
+
+#define TMP007_VOBJ       0x00
+#define TMP007_TDIE       0x01
+#define TMP007_CONFIG     0x02
+#define TMP007_TOBJ       0x03
+#define TMP007_STATUS     0x04
+#define TMP007_STATMASK   0x05
+
+#define TMP007_CFG_RESET    0x8000
+#define TMP007_CFG_MODEON   0x1000
+#define TMP007_CFG_1SAMPLE  0x0000
+#define TMP007_CFG_2SAMPLE  0x0200
+#define TMP007_CFG_4SAMPLE  0x0400
+#define TMP007_CFG_8SAMPLE  0x0600
+#define TMP007_CFG_16SAMPLE 0x0800
+#define TMP007_CFG_ALERTEN  0x0100
+#define TMP007_CFG_ALERTF   0x0080
+#define TMP007_CFG_TRANSC   0x0040
+
+#define TMP007_STAT_ALERTEN 0x8000
+#define TMP007_STAT_CRTEN   0x4000
+
+#define TMP007_I2CADDR 0x40
+#define TMP007_DEVID 0x1F
+
+
+
+class Adafruit_TMP007  {
+ public:
+  Adafruit_TMP007(uint8_t addr = TMP007_I2CADDR);
+  boolean begin(uint16_t samplerate = 0);  // by default go highres
+
+  int16_t readRawDieTemperature(void);
+  int16_t readRawVoltage(void);
+  double readObjTempC(void);
+  double readDieTempC(void);
+
+ private:
+  uint8_t _addr;
+  uint16_t read16(uint8_t addr);
+  void write16(uint8_t addr, uint16_t data);
+};
+
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_TMP007_Library/README.txt
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_TMP007_Library/README.txt	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_TMP007_Library/README.txt	(revision 137)
@@ -0,0 +1,22 @@
+This is a library for the Adafruit TMP007 Infrared Thermopile Sensor
+
+Designed specifically to work with the Adafruit TMP007 Breakout 
+  ----> https://www.adafruit.com/products/2023
+
+These displays use I2C to communicate, 2 pins are required to interface
+Adafruit invests time and resources providing this open source code, 
+please support Adafruit and open-source hardware by purchasing 
+products from Adafruit!
+
+Check out the links above for our tutorials and wiring diagrams 
+
+Adafruit invests time and resources providing this open source code, 
+please support Adafruit and open-source hardware by purchasing 
+products from Adafruit!
+
+Written by Limor Fried/Ladyada for Adafruit Industries.  
+BSD license, all text above must be included in any redistribution
+
+To download. click the ZIP button on the right, rename the uncompressed folder Adafruit_TMP007. Check that the Adafruit_TMP007 folder contains Adafruit_TMP007.cpp and Adafruit_TMP007.h
+
+Place the Adafruit_TMP007 library folder your <arduinosketchfolder>/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_TMP007_Library/examples/tmp007/tmp007.ino
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_TMP007_Library/examples/tmp007/tmp007.ino	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_TMP007_Library/examples/tmp007/tmp007.ino	(revision 137)
@@ -0,0 +1,50 @@
+/*************************************************** 
+  This is an example for the TMP007 Barometric Pressure & Temp Sensor
+
+  Designed specifically to work with the Adafruit TMP007 Breakout 
+  ----> https://www.adafruit.com/products/2023
+  
+  These displays use I2C to communicate, 2 pins are required to  
+  interface
+  Adafruit invests time and resources providing this open source code, 
+  please support Adafruit and open-source hardware by purchasing 
+  products from Adafruit!
+
+  Written by Limor Fried/Ladyada for Adafruit Industries.  
+  BSD license, all text above must be included in any redistribution
+ ****************************************************/
+
+#include <Wire.h>
+#include "Adafruit_TMP007.h"
+
+// Connect VCC to +3V (its a quieter supply than the 5V supply on an Arduino
+// Gnd -> Gnd
+// SCL connects to the I2C clock pin. On newer boards this is labeled with SCL
+// otherwise, on the Uno, this is A5 on the Mega it is 21 and on the Leonardo/Micro digital 3
+// SDA connects to the I2C data pin. On newer boards this is labeled with SDA
+// otherwise, on the Uno, this is A4 on the Mega it is 20 and on the Leonardo/Micro digital 2
+
+Adafruit_TMP007 tmp007;
+//Adafruit_TMP007 tmp007(0x41);  // start with a diferent i2c address!
+
+void setup() { 
+  Serial.begin(9600);
+  Serial.println("Adafruit TMP007 example");
+
+  // you can also use tmp007.begin(TMP007_CFG_1SAMPLE) or 2SAMPLE/4SAMPLE/8SAMPLE to have
+  // lower precision, higher rate sampling. default is TMP007_CFG_16SAMPLE which takes
+  // 4 seconds per reading (16 samples)
+  if (! tmp007.begin()) {
+    Serial.println("No sensor found");
+    while (1);
+  }
+}
+
+void loop() {
+   float objt = tmp007.readObjTempC();
+   Serial.print("Object Temperature: "); Serial.print(objt); Serial.println("*C");
+   float diet = tmp007.readDieTempC();
+   Serial.print("Die Temperature: "); Serial.print(diet); Serial.println("*C");
+   
+   delay(4000); // 4 seconds per reading for 16 samples per reading
+}
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_TMP007_Library/library.properties
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_TMP007_Library/library.properties	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_TMP007_Library/library.properties	(revision 137)
@@ -0,0 +1,9 @@
+name=Adafruit TMP007 Library
+version=1.0.1
+author=Adafruit
+maintainer=Adafruit <info@adafruit.com>
+sentence=Arduino library for Adafruit TMP007 Thermopile sensor Breakout
+paragraph=Arduino library for Adafruit TMP007 Thermopile sensor Breakout
+category=Sensors
+url=https://github.com/adafruit/Adafruit_TMP007_Library
+architectures=*
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_TSL2591_Library/Adafruit_TSL2591.cpp
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_TSL2591_Library/Adafruit_TSL2591.cpp	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_TSL2591_Library/Adafruit_TSL2591.cpp	(revision 137)
@@ -0,0 +1,400 @@
+/**************************************************************************/
+/*! 
+    @file     Adafruit_TSL2591.cpp
+    @author   KT0WN (adafruit.com)
+
+    This is a library for the Adafruit TSL2591 breakout board
+    This library works with the Adafruit TSL2591 breakout 
+    ----> https://www.adafruit.com/products/1980
+	
+    Check out the links above for our tutorials and wiring diagrams 
+    These chips use I2C to communicate
+	
+    Adafruit invests time and resources providing this open source code, 
+    please support Adafruit and open-source hardware by purchasing 
+    products from Adafruit!
+
+    @section LICENSE
+
+    Software License Agreement (BSD License)
+
+    Copyright (c) 2014 Adafruit Industries
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+    1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+    2. 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.
+    3. Neither the name of the copyright holders nor the
+    names of its 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 ''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 THE COPYRIGHT HOLDER 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.
+*/
+/**************************************************************************/
+#if defined(ESP8266)
+#include <pgmspace.h>
+#else
+#include <avr/pgmspace.h>
+#endif
+#if defined(__AVR__)
+#include <util/delay.h>
+#endif
+#include <stdlib.h>
+
+#include "Adafruit_TSL2591.h"
+
+Adafruit_TSL2591::Adafruit_TSL2591(int32_t sensorID) 
+{
+  _initialized = false;
+  _integration = TSL2591_INTEGRATIONTIME_100MS;
+  _gain        = TSL2591_GAIN_MED;
+  _sensorID    = sensorID;
+
+  // we cant do wire initialization till later, because we havent loaded Wire yet
+}
+
+boolean Adafruit_TSL2591::begin(void) 
+{
+  Wire.begin();
+
+  /*
+  for (uint8_t i=0; i<0x20; i++) 
+  {
+    uint8_t id = read8(0x12);
+    Serial.print("$"); Serial.print(i, HEX); 
+    Serial.print(" = 0x"); Serial.println(read8(i), HEX);
+  }
+  */
+
+  uint8_t id = read8(0x12);
+  if (id == 0x50 ) 
+  {
+    //Serial.println("Found Adafruit_TSL2591");
+  } 
+  else 
+  {
+    return false;
+  }
+  
+  _initialized = true;
+
+  // Set default integration time and gain
+  setTiming(_integration);
+  setGain(_gain);
+  
+  // Note: by default, the device is in power down mode on bootup
+  disable();
+
+  return true;
+}
+
+void Adafruit_TSL2591::enable(void)
+{
+  if (!_initialized)
+  {
+    if (!begin())
+    {
+      return;
+    }
+  }
+
+  // Enable the device by setting the control bit to 0x01
+  write8(TSL2591_COMMAND_BIT | TSL2591_REGISTER_ENABLE, TSL2591_ENABLE_POWERON | TSL2591_ENABLE_AEN | TSL2591_ENABLE_AIEN);
+}
+
+void Adafruit_TSL2591::disable(void)
+{
+  if (!_initialized)
+  {
+    if (!begin())
+    {
+      return;
+    }
+  }
+
+  // Disable the device by setting the control bit to 0x00
+  write8(TSL2591_COMMAND_BIT | TSL2591_REGISTER_ENABLE, TSL2591_ENABLE_POWEROFF);
+}
+
+void Adafruit_TSL2591::setGain(tsl2591Gain_t gain) 
+{
+  if (!_initialized)
+  {
+    if (!begin())
+    {
+      return;
+    }
+  }
+
+  enable();
+  _gain = gain;
+  write8(TSL2591_COMMAND_BIT | TSL2591_REGISTER_CONTROL, _integration | _gain);  
+  disable();
+}
+
+tsl2591Gain_t Adafruit_TSL2591::getGain()
+{
+  return _gain;
+}
+
+void Adafruit_TSL2591::setTiming(tsl2591IntegrationTime_t integration)
+{
+  if (!_initialized)
+  {
+    if (!begin())
+    {
+      return;
+    }
+  }
+
+  enable();
+  _integration = integration;
+  write8(TSL2591_COMMAND_BIT | TSL2591_REGISTER_CONTROL, _integration | _gain);  
+  disable();
+}
+
+tsl2591IntegrationTime_t Adafruit_TSL2591::getTiming()
+{
+  return _integration;
+}
+
+uint32_t Adafruit_TSL2591::calculateLux(uint16_t ch0, uint16_t ch1)
+{
+  uint16_t atime, again;
+  float    cpl, lux1, lux2, lux;
+  uint32_t chan0, chan1;
+
+  // Check for overflow conditions first
+  if ((ch0 == 0xFFFF) | (ch1 == 0xFFFF))
+  {
+    // Signal an overflow
+    return 0;
+  }
+
+  // Note: This algorithm is based on preliminary coefficients
+  // provided by AMS and may need to be updated in the future
+  
+  switch (_integration)
+  {
+    case TSL2591_INTEGRATIONTIME_100MS :
+      atime = 100.0F;
+      break;
+    case TSL2591_INTEGRATIONTIME_200MS :
+      atime = 200.0F;
+      break;
+    case TSL2591_INTEGRATIONTIME_300MS :
+      atime = 300.0F;
+      break;
+    case TSL2591_INTEGRATIONTIME_400MS :
+      atime = 400.0F;
+      break;
+    case TSL2591_INTEGRATIONTIME_500MS :
+      atime = 500.0F;
+      break;
+    case TSL2591_INTEGRATIONTIME_600MS :
+      atime = 600.0F;
+      break;
+    default: // 100ms
+      atime = 100.0F;
+      break;
+  }
+  
+  switch (_gain)
+  {
+    case TSL2591_GAIN_LOW :
+      again = 1.0F;
+      break;
+    case TSL2591_GAIN_MED :
+      again = 25.0F;
+      break;
+    case TSL2591_GAIN_HIGH :
+      again = 428.0F;
+      break;
+    case TSL2591_GAIN_MAX :
+      again = 9876.0F;
+      break;
+    default:
+      again = 1.0F;
+      break;
+  }
+
+  // cpl = (ATIME * AGAIN) / DF
+  cpl = (atime * again) / TSL2591_LUX_DF;
+  
+  lux1 = ( (float)ch0 - (TSL2591_LUX_COEFB * (float)ch1) ) / cpl;
+  lux2 = ( ( TSL2591_LUX_COEFC * (float)ch0 ) - ( TSL2591_LUX_COEFD * (float)ch1 ) ) / cpl;
+  
+  // The highest value is the approximate lux equivalent
+  lux = lux1 > lux2 ? lux1 : lux2;
+
+  // Signal I2C had no errors
+  return (uint32_t)lux;
+}
+
+uint32_t Adafruit_TSL2591::getFullLuminosity (void)
+{
+  if (!_initialized)
+  {
+    if (!begin())
+    {
+      return 0;
+    }
+  }
+
+  // Enable the device
+  enable();
+
+  // Wait x ms for ADC to complete
+  for (uint8_t d=0; d<=_integration; d++) 
+  {
+    delay(120);
+  }
+
+  uint32_t x;
+  x = read16(TSL2591_COMMAND_BIT | TSL2591_REGISTER_CHAN1_LOW);
+  x <<= 16;
+  x |= read16(TSL2591_COMMAND_BIT | TSL2591_REGISTER_CHAN0_LOW);
+
+  disable();
+
+  return x;
+}
+
+uint16_t Adafruit_TSL2591::getLuminosity (uint8_t channel) 
+{
+  uint32_t x = getFullLuminosity();
+
+  if (channel == TSL2591_FULLSPECTRUM) 
+  {
+    // Reads two byte value from channel 0 (visible + infrared)
+    return (x & 0xFFFF);
+  } 
+  else if (channel == TSL2591_INFRARED) 
+  {
+    // Reads two byte value from channel 1 (infrared)
+    return (x >> 16);
+  } 
+  else if (channel == TSL2591_VISIBLE) 
+  {
+    // Reads all and subtracts out just the visible!
+    return ( (x & 0xFFFF) - (x >> 16));
+  }
+  
+  // unknown channel!
+  return 0;
+}
+
+uint8_t Adafruit_TSL2591::read8(uint8_t reg)
+{
+  Wire.beginTransmission(TSL2591_ADDR);
+  Wire.write(0x80 | 0x20 | reg); // command bit, normal mode
+  Wire.endTransmission();
+
+  Wire.requestFrom(TSL2591_ADDR, 1);
+  while (! Wire.available());
+  return Wire.read();
+}
+
+uint16_t Adafruit_TSL2591::read16(uint8_t reg)
+{
+  uint16_t x; 
+  uint16_t t;
+
+  Wire.beginTransmission(TSL2591_ADDR);
+#if ARDUINO >= 100
+  Wire.write(reg);
+#else
+  Wire.send(reg);
+#endif
+  Wire.endTransmission();
+
+  Wire.requestFrom(TSL2591_ADDR, 2);
+#if ARDUINO >= 100
+  t = Wire.read();
+  x = Wire.read();
+#else
+  t = Wire.receive();
+  x = Wire.receive();
+#endif
+  x <<= 8;
+  x |= t;
+  return x;
+}
+
+void Adafruit_TSL2591::write8 (uint8_t reg, uint8_t value)
+{
+  Wire.beginTransmission(TSL2591_ADDR);
+#if ARDUINO >= 100
+  Wire.write(reg);
+  Wire.write(value);
+#else
+  Wire.send(reg);
+  Wire.send(value);
+#endif
+  Wire.endTransmission();
+}
+
+/**************************************************************************/
+/*!
+    @brief  Gets the most recent sensor event
+*/
+/**************************************************************************/
+bool Adafruit_TSL2591::getEvent(sensors_event_t *event)
+{
+  uint16_t ir, full;
+  uint32_t lum = getFullLuminosity();
+  /* Early silicon seems to have issues when there is a sudden jump in */
+  /* light levels. :( To work around this for now sample the sensor 2x */
+  lum = getFullLuminosity();
+  ir = lum >> 16;
+  full = lum & 0xFFFF;  
+  
+  /* Clear the event */
+  memset(event, 0, sizeof(sensors_event_t));
+  
+  event->version   = sizeof(sensors_event_t);
+  event->sensor_id = _sensorID;
+  event->type      = SENSOR_TYPE_LIGHT;
+  event->timestamp = millis();
+
+  /* Calculate the actual lux value */
+  /* 0 = sensor overflow (too much light) */
+  event->light = calculateLux(full, ir);
+  
+  return true;
+}
+
+/**************************************************************************/
+/*!
+    @brief  Gets the sensor_t data
+*/
+/**************************************************************************/
+void Adafruit_TSL2591::getSensor(sensor_t *sensor)
+{
+  /* Clear the sensor_t object */
+  memset(sensor, 0, sizeof(sensor_t));
+
+  /* Insert the sensor name in the fixed length char array */
+  strncpy (sensor->name, "TSL2591", sizeof(sensor->name) - 1);
+  sensor->name[sizeof(sensor->name)- 1] = 0;
+  sensor->version     = 1;
+  sensor->sensor_id   = _sensorID;
+  sensor->type        = SENSOR_TYPE_LIGHT;
+  sensor->min_delay   = 0;
+  sensor->max_value   = 88000.0;
+  sensor->min_value   = 0.0;
+  sensor->resolution  = 1.0;
+}
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_TSL2591_Library/Adafruit_TSL2591.h
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_TSL2591_Library/Adafruit_TSL2591.h	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_TSL2591_Library/Adafruit_TSL2591.h	(revision 137)
@@ -0,0 +1,152 @@
+/**************************************************************************/
+/*! 
+    @file     Adafruit_TSL2591.h
+    @author   KT0WN (adafruit.com)
+
+    This is a library for the Adafruit TSL2591 breakout board
+    This library works with the Adafruit TSL2591 breakout 
+    ----> https://www.adafruit.com/products/1980
+	
+    Check out the links above for our tutorials and wiring diagrams 
+    These chips use I2C to communicate
+ 
+    Adafruit invests time and resources providing this open source code, 
+    please support Adafruit and open-source hardware by purchasing 
+    products from Adafruit!
+
+    @section LICENSE
+
+    Software License Agreement (BSD License)
+
+    Copyright (c) 2014 Adafruit Industries
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+    1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+    2. 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.
+    3. Neither the name of the copyright holders nor the
+    names of its 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 ''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 THE COPYRIGHT HOLDER 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.
+*/
+/**************************************************************************/
+
+#ifndef _TSL2591_H_
+#define _TSL2591_H_
+
+#if ARDUINO >= 100
+ #include <Arduino.h>
+#else
+ #include <WProgram.h>
+#endif
+#include <Adafruit_Sensor.h>
+#include <Wire.h>
+
+#define TSL2591_VISIBLE           (2)       // channel 0 - channel 1
+#define TSL2591_INFRARED          (1)       // channel 1
+#define TSL2591_FULLSPECTRUM      (0)       // channel 0
+
+#define TSL2591_ADDR              (0x29)
+#define TSL2591_READBIT           (0x01)
+
+#define TSL2591_COMMAND_BIT       (0xA0)    // bits 7 and 5 for 'command normal'
+#define TSL2591_CLEAR_BIT         (0x40)    // Clears any pending interrupt (write 1 to clear)
+#define TSL2591_WORD_BIT          (0x20)    // 1 = read/write word (rather than byte)
+#define TSL2591_BLOCK_BIT         (0x10)    // 1 = using block read/write
+
+#define TSL2591_ENABLE_POWERON    (0x01)
+#define TSL2591_ENABLE_POWEROFF   (0x00)
+#define TSL2591_ENABLE_AEN        (0x02)
+#define TSL2591_ENABLE_AIEN       (0x10)
+
+#define TSL2591_CONTROL_RESET     (0x80)
+
+#define TSL2591_LUX_DF            (408.0F)
+#define TSL2591_LUX_COEFB         (1.64F)  // CH0 coefficient 
+#define TSL2591_LUX_COEFC         (0.59F)  // CH1 coefficient A
+#define TSL2591_LUX_COEFD         (0.86F)  // CH2 coefficient B
+
+enum
+{
+  TSL2591_REGISTER_ENABLE           = 0x00,
+  TSL2591_REGISTER_CONTROL          = 0x01,
+  TSL2591_REGISTER_THRESHHOLDL_LOW  = 0x02,
+  TSL2591_REGISTER_THRESHHOLDL_HIGH = 0x03,
+  TSL2591_REGISTER_THRESHHOLDH_LOW  = 0x04,
+  TSL2591_REGISTER_THRESHHOLDH_HIGH = 0x05,
+  TSL2591_REGISTER_INTERRUPT        = 0x06,
+  TSL2591_REGISTER_CRC              = 0x08,
+  TSL2591_REGISTER_ID               = 0x0A,
+  TSL2591_REGISTER_CHAN0_LOW        = 0x14,
+  TSL2591_REGISTER_CHAN0_HIGH       = 0x15,
+  TSL2591_REGISTER_CHAN1_LOW        = 0x16,
+  TSL2591_REGISTER_CHAN1_HIGH       = 0x17
+};
+
+typedef enum
+{
+  TSL2591_INTEGRATIONTIME_100MS     = 0x00,
+  TSL2591_INTEGRATIONTIME_200MS     = 0x01,
+  TSL2591_INTEGRATIONTIME_300MS     = 0x02,
+  TSL2591_INTEGRATIONTIME_400MS     = 0x03,
+  TSL2591_INTEGRATIONTIME_500MS     = 0x04,
+  TSL2591_INTEGRATIONTIME_600MS     = 0x05,
+}
+tsl2591IntegrationTime_t;
+
+typedef enum
+{
+  TSL2591_GAIN_LOW                  = 0x00,    // low gain (1x)
+  TSL2591_GAIN_MED                  = 0x10,    // medium gain (25x)
+  TSL2591_GAIN_HIGH                 = 0x20,    // medium gain (428x)
+  TSL2591_GAIN_MAX                  = 0x30,    // max gain (9876x)
+}
+tsl2591Gain_t;
+
+class Adafruit_TSL2591 : public Adafruit_Sensor
+{
+ public:
+  Adafruit_TSL2591(int32_t sensorID = -1);
+  
+  boolean   begin   ( void );
+  void      enable  ( void );
+  void      disable ( void );
+  void      write8  ( uint8_t r, uint8_t v );
+  uint16_t  read16  ( uint8_t reg );
+  uint8_t   read8   ( uint8_t reg );
+
+  uint32_t  calculateLux  ( uint16_t ch0, uint16_t ch1 );
+  void      setGain       ( tsl2591Gain_t gain );
+  void      setTiming     ( tsl2591IntegrationTime_t integration );
+  uint16_t  getLuminosity (uint8_t channel );
+  uint32_t  getFullLuminosity ( );
+
+  tsl2591IntegrationTime_t getTiming();
+  tsl2591Gain_t            getGain();
+  
+  /* Unified Sensor API Functions */  
+  bool getEvent  ( sensors_event_t* );
+  void getSensor ( sensor_t* );
+
+ private:
+  tsl2591IntegrationTime_t _integration;
+  tsl2591Gain_t _gain;
+  int32_t _sensorID;
+
+  boolean _initialized;
+};
+#endif
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_TSL2591_Library/README.txt
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_TSL2591_Library/README.txt	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_TSL2591_Library/README.txt	(revision 137)
@@ -0,0 +1,9 @@
+This is an Arduino library for the TSL2591 digital luminosity (light) sensors. 
+
+Pick one up at http://www.adafruit.com/products/1980
+
+To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_TSL2591. Check that the Adafruit_TSL2591 folder contains Adafruit_TSL2591.cpp and Adafruit_TSL2591.h
+
+Place the Adafruit_TSL2591 library folder your <arduinosketchfolder>/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.
+
+You'll also need the Adafruit_Sensor library from https://github.com/adafruit/Adafruit_Sensor
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_TSL2591_Library/examples/tsl2591/tsl2591.ino
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_TSL2591_Library/examples/tsl2591/tsl2591.ino	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_TSL2591_Library/examples/tsl2591/tsl2591.ino	(revision 137)
@@ -0,0 +1,198 @@
+/* TSL2591 Digital Light Sensor */
+/* Dynamic Range: 600M:1 */
+/* Maximum Lux: 88K */
+
+#include <Wire.h>
+#include <Adafruit_Sensor.h>
+#include "Adafruit_TSL2591.h"
+
+// Example for demonstrating the TSL2591 library - public domain!
+
+// connect SCL to analog 5
+// connect SDA to analog 4
+// connect Vin to 3.3-5V DC
+// connect GROUND to common ground
+
+Adafruit_TSL2591 tsl = Adafruit_TSL2591(2591); // pass in a number for the sensor identifier (for your use later)
+
+/**************************************************************************/
+/*
+    Displays some basic information on this sensor from the unified
+    sensor API sensor_t type (see Adafruit_Sensor for more information)
+*/
+/**************************************************************************/
+void displaySensorDetails(void)
+{
+  sensor_t sensor;
+  tsl.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 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)
+  tsl.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!
+  tsl.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 = tsl.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((tsl.getTiming() + 1) * 100, DEC); 
+  Serial.println(" ms");
+  Serial.println("------------------------------------");
+  Serial.println("");
+}
+
+/**************************************************************************/
+/*
+    Program entry point for the Arduino sketch
+*/
+/**************************************************************************/
+void setup(void) 
+{
+  Serial.begin(115200);
+  
+  Serial.println("Starting Adafruit TSL2591 Test!");
+  
+  if (tsl.begin()) 
+  {
+    Serial.println("Found a TSL2591 sensor");
+  } 
+  else 
+  {
+    Serial.println("No sensor found ... check your wiring?");
+    while (1);
+  }
+    
+  /* Display some basic information on this sensor */
+  displaySensorDetails();
+  
+  /* Configure the sensor */
+  configureSensor();
+    
+  // Now we're ready to get readings ... move on to loop()!
+}
+
+/**************************************************************************/
+/*
+    Shows how to perform a basic read on visible, full spectrum or
+    infrared light (returns raw 16-bit ADC values)
+*/
+/**************************************************************************/
+void simpleRead(void)
+{
+  // Simple data read example. Just read the infrared, fullspecrtrum diode 
+  // or 'visible' (difference between the two) channels.
+  // This can take 100-600 milliseconds! Uncomment whichever of the following you want to read
+  uint16_t x = tsl.getLuminosity(TSL2591_VISIBLE);
+  //uint16_t x = tsl.getLuminosity(TSL2591_FULLSPECTRUM);
+  //uint16_t x = tsl.getLuminosity(TSL2591_INFRARED);
+
+  Serial.print("[ "); Serial.print(millis()); Serial.print(" ms ] ");
+  Serial.print("Luminosity: ");
+  Serial.println(x, DEC);
+}
+
+/**************************************************************************/
+/*
+    Show how to read IR and Full Spectrum at once and convert to lux
+*/
+/**************************************************************************/
+void advancedRead(void)
+{
+  // More advanced data read example. Read 32 bits with top 16 bits IR, bottom 16 bits full spectrum
+  // That way you can do whatever math and comparisons you want!
+  uint32_t lum = tsl.getFullLuminosity();
+  uint16_t ir, full;
+  ir = lum >> 16;
+  full = lum & 0xFFFF;
+  Serial.print("[ "); Serial.print(millis()); Serial.print(" ms ] ");
+  Serial.print("IR: "); Serial.print(ir);  Serial.print("  ");
+  Serial.print("Full: "); Serial.print(full); Serial.print("  ");
+  Serial.print("Visible: "); Serial.print(full - ir); Serial.print("  ");
+  Serial.print("Lux: "); Serial.println(tsl.calculateLux(full, ir));
+}
+
+/**************************************************************************/
+/*
+    Performs a read using the Adafruit Unified Sensor API.
+*/
+/**************************************************************************/
+void unifiedSensorAPIRead(void)
+{
+  /* Get a new sensor event */ 
+  sensors_event_t event;
+  tsl.getEvent(&event);
+ 
+  /* Display the results (light is measured in lux) */
+  Serial.print("[ "); Serial.print(event.timestamp); Serial.print(" ms ] ");
+  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");
+  }
+}
+
+/**************************************************************************/
+/*
+    Arduino loop function, called once 'setup' is complete (your own code
+    should go here)
+*/
+/**************************************************************************/
+void loop(void) 
+{ 
+  // simpleRead(); 
+  // advancedRead();
+  unifiedSensorAPIRead();
+  
+  delay(250);
+}
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_TSL2591_Library/library.properties
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_TSL2591_Library/library.properties	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_TSL2591_Library/library.properties	(revision 137)
@@ -0,0 +1,9 @@
+name=Adafruit TSL2591 Library
+version=1.0.2
+author=Adafruit
+maintainer=Adafruit <info@adafruit.com>
+sentence=Library for the TSL2591 digital luminosity (light) sensors.
+paragraph=Library for the TSL2591 digital luminosity (light) sensors.
+category=Sensors
+url=https://github.com/adafruit/Adafruit_TSL2591_Library
+architectures=*
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_VCNL4000/Adafruit_VCNL4000.cpp
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_VCNL4000/Adafruit_VCNL4000.cpp	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_VCNL4000/Adafruit_VCNL4000.cpp	(revision 137)
@@ -0,0 +1,180 @@
+#if ARDUINO >= 100
+ #include "Arduino.h"
+#else
+ #include "WProgram.h"
+#endif
+
+#ifdef __AVR_ATtiny85__
+ #include "TinyWireM.h"
+ #define Wire TinyWireM
+#else
+ #include <Wire.h>
+#endif
+
+#include "Adafruit_VCNL4000.h"
+
+/**************************************************************************/
+/*! 
+    @brief  Instantiates a new VCNL4000 class
+*/
+/**************************************************************************/
+Adafruit_VCNL4000::Adafruit_VCNL4000() {
+}
+
+/**************************************************************************/
+/*! 
+    @brief  Setups the HW
+*/
+/**************************************************************************/
+boolean Adafruit_VCNL4000::begin(uint8_t addr) {
+  _i2caddr = addr;
+  Wire.begin();
+
+  uint8_t rev = read8(VCNL4000_PRODUCTID);
+  //Serial.println(rev, HEX);
+  if ((rev & 0xF0) != 0x10) {
+      return false;
+  }
+  
+  setLEDcurrent(20);
+  setFrequency(VCNL4000_781K25);
+  write8(VCNL4000_PROXINITYADJUST, 0x81);
+    
+  return true;
+}
+ 
+
+/**************************************************************************/
+/*! 
+    @brief  Get and set the LED current draw
+*/
+/**************************************************************************/
+
+void Adafruit_VCNL4000::setLEDcurrent(uint8_t c) {
+  if (c > 20) c = 20;
+  write8(VCNL4000_IRLED, c);
+}
+
+uint8_t Adafruit_VCNL4000::getLEDcurrent(void) {
+  return read8(VCNL4000_IRLED);
+}
+
+/**************************************************************************/
+/*! 
+    @brief  Get and set the measurement signal frequency
+*/
+/**************************************************************************/
+
+void Adafruit_VCNL4000::setFrequency(vcnl4000_freq f) {
+  write8(VCNL4000_SIGNALFREQ, f);
+}
+
+
+/**************************************************************************/
+/*! 
+    @brief  Get proximity measurement
+*/
+/**************************************************************************/
+
+uint16_t  Adafruit_VCNL4000::readProximity(void) {
+  write8(VCNL4000_COMMAND, VCNL4000_MEASUREPROXIMITY);
+  while (1) {
+    //Serial.println(read8(VCNL4000_INTSTAT), HEX);
+    uint8_t result = read8(VCNL4000_COMMAND);
+    //Serial.print("Ready = 0x"); Serial.println(result, HEX);
+    if (result & VCNL4000_PROXIMITYREADY) {
+      return read16(VCNL4000_PROXIMITYDATA);
+    }
+    delay(1);
+  }
+}
+
+uint16_t  Adafruit_VCNL4000::readAmbient(void) {
+  write8(VCNL4000_COMMAND, VCNL4000_MEASUREAMBIENT);
+  while (1) {
+    //Serial.println(read8(VCNL4000_INTSTAT), HEX);
+    uint8_t result = read8(VCNL4000_COMMAND);
+    //Serial.print("Ready = 0x"); Serial.println(result, HEX);
+    if (result & VCNL4000_AMBIENTREADY) {
+      return read16(VCNL4000_AMBIENTDATA);
+    }
+    delay(1);
+  }
+}
+
+/**************************************************************************/
+/*! 
+    @brief  I2C low level interfacing
+*/
+/**************************************************************************/
+
+
+// Read 1 byte from the VCNL4000 at 'address'
+uint8_t Adafruit_VCNL4000::read8(uint8_t address)
+{
+  uint8_t data;
+
+  Wire.beginTransmission(_i2caddr);
+#if ARDUINO >= 100
+  Wire.write(address);
+#else
+  Wire.send(address);
+#endif
+  Wire.endTransmission();
+
+  delayMicroseconds(170);  // delay required
+
+  Wire.requestFrom(_i2caddr, (uint8_t)1);
+  while(!Wire.available());
+
+#if ARDUINO >= 100
+  return Wire.read();
+#else
+  return Wire.receive();
+#endif
+}
+
+
+// Read 2 byte from the VCNL4000 at 'address'
+uint16_t Adafruit_VCNL4000::read16(uint8_t address)
+{
+  uint16_t data;
+
+  Wire.beginTransmission(_i2caddr);
+#if ARDUINO >= 100
+  Wire.write(address);
+#else
+  Wire.send(address);
+#endif
+  Wire.endTransmission();
+
+  Wire.requestFrom(_i2caddr, (uint8_t)2);
+  while(!Wire.available());
+#if ARDUINO >= 100
+  data = Wire.read();
+  data <<= 8;
+  while(!Wire.available());
+  data |= Wire.read();
+#else
+  data = Wire.receive();
+  data <<= 8;
+  while(!Wire.available());
+  data |= Wire.receive();
+#endif
+  
+  return data;
+}
+
+// write 1 byte
+void Adafruit_VCNL4000::write8(uint8_t address, uint8_t data)
+{
+  Wire.beginTransmission(_i2caddr);
+#if ARDUINO >= 100
+  Wire.write(address);
+  Wire.write(data);  
+#else
+  Wire.send(address);
+  Wire.send(data);  
+#endif
+  Wire.endTransmission();
+}
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_VCNL4000/Adafruit_VCNL4000.h
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_VCNL4000/Adafruit_VCNL4000.h	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_VCNL4000/Adafruit_VCNL4000.h	(revision 137)
@@ -0,0 +1,79 @@
+/**************************************************************************/
+/*! 
+    @file     Adafruit_VCNL4000.h
+    @author   K. Townsend (Adafruit Industries)
+	@license  BSD (see license.txt)
+	
+	This is a library for the Adafruit VCNL4000 Temp Sensor breakout board
+	----> http://www.adafruit.com/products/1782
+	
+	Adafruit invests time and resources providing this open source code, 
+	please support Adafruit and open-source hardware by purchasing 
+	products from Adafruit!
+
+	@section  HISTORY
+
+    v1.0  - First release
+*/
+/**************************************************************************/
+
+#if ARDUINO >= 100
+ #include "Arduino.h"
+#else
+ #include "WProgram.h"
+#endif
+
+#ifdef __AVR_ATtiny85__
+ #include "TinyWireM.h"
+ #define Wire TinyWireM
+#else
+ #include <Wire.h>
+#endif
+
+// the i2c address
+#define VCNL4000_I2CADDR_DEFAULT 0x13
+
+// commands and constants
+#define VCNL4000_COMMAND 0x80
+#define VCNL4000_PRODUCTID 0x81
+#define VCNL4000_IRLED 0x83
+#define VCNL4000_AMBIENTPARAMETER 0x84
+#define VCNL4000_AMBIENTDATA 0x85
+#define VCNL4000_AMBIENTDATA 0x85
+#define VCNL4000_PROXIMITYDATA 0x87
+#define VCNL4000_SIGNALFREQ 0x89
+#define VCNL4000_PROXINITYADJUST 0x8A
+
+typedef enum
+  {
+    VCNL4000_3M125   = 0,
+    VCNL4000_1M5625  = 1,
+    VCNL4000_781K25  = 2,
+    VCNL4000_390K625 = 3,
+  } vcnl4000_freq;
+
+#define VCNL4000_MEASUREAMBIENT 0x10
+#define VCNL4000_MEASUREPROXIMITY 0x08
+#define VCNL4000_AMBIENTREADY 0x40
+#define VCNL4000_PROXIMITYREADY 0x20
+  
+class Adafruit_VCNL4000 {
+ public:
+  Adafruit_VCNL4000();
+  boolean begin(uint8_t a = VCNL4000_I2CADDR_DEFAULT);  
+
+  uint8_t getLEDcurrent(void);
+  void setLEDcurrent(uint8_t c);
+
+  void setFrequency(vcnl4000_freq f);
+  uint16_t readProximity(void);
+  uint16_t readAmbient(void);
+
+ private:
+
+  void write8(uint8_t address, uint8_t data);
+  uint16_t read16(uint8_t address);
+  uint8_t read8(uint8_t address);
+
+  uint8_t _i2caddr;
+};
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_VCNL4000/README.md
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_VCNL4000/README.md	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_VCNL4000/README.md	(revision 137)
@@ -0,0 +1,21 @@
+Adafruit_VCNL4010
+================
+
+This is the Adafruit VCNL4010 Proximity I2C sensor library
+
+Tested and works great with the Aadafruit VCNL4010 Breakout Board 
+  * http://www.adafruit.com/products/466
+
+This chip uses I2C to communicate, 2 pins are required to interface
+
+Adafruit invests time and resources providing this open source code, 
+please support Adafruit and open-source hardware by purchasing 
+products from Adafruit!
+
+Written by Kevin Townsend/Limor Fried for Adafruit Industries.  
+BSD license, check license.txt for more information
+All text above must be included in any redistribution
+
+To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_VCNL4010. Check that the Adafruit_VCNL4010 folder contains Adafruit_VCNL4010.cpp and Adafruit_VCNL4010.h
+
+Place the Adafruit_VCNL4010 library folder your arduinosketchfolder/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_VCNL4000/examples/vcnl4010test/vcnl4010test.ino
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_VCNL4000/examples/vcnl4010test/vcnl4010test.ino	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_VCNL4000/examples/vcnl4010test/vcnl4010test.ino	(revision 137)
@@ -0,0 +1,22 @@
+#include <Wire.h>
+#include "Adafruit_VCNL4010.h"
+
+Adafruit_VCNL4010 vcnl;
+
+void setup() {
+  Serial.begin(9600);
+  Serial.println("VCNL4010 test");
+
+  if (! vcnl.begin()){
+    Serial.println("Sensor not found :(");
+    while (1);
+  }
+  Serial.println("Found VCNL4010");
+}
+
+
+void loop() {
+   Serial.print("Ambient: "); Serial.println(vcnl.readAmbient());
+   Serial.print("Proimity: "); Serial.println(vcnl.readProximity());
+   delay(100);
+}
Index: rtos_arduino/trunk/examples/CompositeExample/Adafruit_VCNL4000/license.txt
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Adafruit_VCNL4000/license.txt	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Adafruit_VCNL4000/license.txt	(revision 137)
@@ -0,0 +1,26 @@
+Software License Agreement (BSD License)
+
+Copyright (c) 2012, Adafruit Industries
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+2. 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.
+3. Neither the name of the copyright holders nor the
+names of its 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 ''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 THE COPYRIGHT HOLDER 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.
Index: rtos_arduino/trunk/examples/CompositeExample/Makefile
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/Makefile	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/Makefile	(revision 137)
@@ -0,0 +1,66 @@
+#
+#  ã¿ã¼ã²ããã®æå®ï¼Makefile.targetã§ä¸æ¸ããããã®ãé²ãããï¼
+#
+all:
+
+#
+#  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
+#
+APPL_CXXOBJS += rca_app.o
+APPL_COBJS   += 
+APPL_CFG      = rca_app.cfg
+
+#
+#  Serialã®æ±ã
+#   ARDUINO_SERIAL
+#    NOUSE_SERIAL
+#    USE_SERIAL
+#
+#ARDUINO_SERIAL = NOUSE_SERIAL
+ARDUINO_SERIAL = USE_SERIAL
+
+#
+#  ã©ã¤ãã©ãªã®ä½¿ç¨
+#  
+#USE_ARDUINO_SPI = true
+#USE_ARDUINO_NCESCAN = true
+USE_ARDUINO_SD  = true
+USE_ARDUINO_TFT = true
+#USE_ETHERNET2 = true
+#USE_NAXESMOTION = true
+USE_WIRE = true
+
+#
+#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+RCA_DIR = ../..
+
+#
+#  ASPã®ã½ã¼ã¹ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+SRCDIR = ../../asp_1.9.2
+
+#
+#  ãã®ä»ã®ãªãã·ã§ã³
+#
+APPL_CFLAGS +=
+APPL_LIBS +=
+APPL_DIR     += 
+
+
+
+APPL_DIR     += ./Adafruit_TMP007_Library
+APPL_CXXOBJS += Adafruit_TMP007.o
+APPL_COBJS   += 
+USE_ARDUINO_SPI  = true
+
+APPL_DIR     += Adafruit_TSL2591_Library ./Adafruit_Sensor
+APPL_CXXOBJS += Adafruit_TSL2591.o
+
+APPL_DIR     += Adafruit_VCNL4000
+APPL_CXXOBJS += Adafruit_VCNL4000.o
+
+APPL_DIR     += $(RCA_DIR)/arduino_lib/libraries/ESP8266
+APPL_CXXOBJS += ESP8266.o
+
+include $(RCA_DIR)/lib/Makefile.rca
Index: rtos_arduino/trunk/examples/CompositeExample/do_clean.bat
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/do_clean.bat	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/do_clean.bat	(revision 137)
@@ -0,0 +1,3 @@
+call ../do_path.bat
+make clean
+pause
Index: rtos_arduino/trunk/examples/CompositeExample/do_debug.bat
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/do_debug.bat	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/do_debug.bat	(revision 137)
@@ -0,0 +1,4 @@
+call ../do_path.bat
+make ocd
+make db
+taskkill /F /IM openocd.exe
Index: rtos_arduino/trunk/examples/CompositeExample/do_make.bat
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/do_make.bat	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/do_make.bat	(revision 137)
@@ -0,0 +1,3 @@
+call ../do_path.bat
+make all
+pause
Index: rtos_arduino/trunk/examples/CompositeExample/do_run.bat
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/do_run.bat	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/do_run.bat	(revision 137)
@@ -0,0 +1,2 @@
+call ../do_path.bat
+make run
Index: rtos_arduino/trunk/examples/CompositeExample/i2c_lcd.h
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/i2c_lcd.h	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/i2c_lcd.h	(revision 137)
@@ -0,0 +1,75 @@
+#include <Wire.h>
+
+#define I2CLCD_ADDR 0x3e  
+byte lcd_contrast = 35;  
+
+void i2clcd_cmd(byte x) {
+  Wire.beginTransmission(I2CLCD_ADDR);
+  Wire.write((uint8_t)0b00000000); // CO = 0,RS = 0
+  Wire.write(x);
+  Wire.endTransmission();
+}
+   
+void i2clcd_clear() {
+  i2clcd_cmd(0b00000001);
+}
+ 
+void i2clcd_contdata(byte x) {
+  Wire.write(0b11000000); // CO = 1, RS = 1
+  Wire.write(x);
+}
+ 
+void i2clcd_lastdata(byte x) {
+  Wire.write(0b01000000); // CO = 0, RS = 1
+  Wire.write(x);
+}
+ 
+void i2clcd_printStr(const char *s) {
+  Wire.beginTransmission(I2CLCD_ADDR);
+  while (*s) {
+    if (*(s + 1)) {
+      i2clcd_contdata(*s);
+    } else {
+      i2clcd_lastdata(*s);
+    }
+    s++;
+  }
+  Wire.endTransmission();
+}
+ 
+void i2clcd_setCursor(byte x, byte y) {
+  i2clcd_cmd(0x80 | (y * 0x40 + x));
+}
+ 
+void i2clcd_printInt(int num) {
+    char int2str[10];
+    String str(num);    
+    str.getBytes((unsigned char*)int2str, 10);
+    i2clcd_printStr(int2str);
+}
+
+void i2clcd_printfloat(float num) {
+    char float2str[10];
+    String str1((int)num);
+    String str2((int)((num-(int)num)*100));
+    str1 += '.' + str2;
+    str1.getBytes((unsigned char*)(float2str), 10);
+    float2str[str1.length()] = '\0';
+    i2clcd_printStr(float2str);
+}
+
+void i2clcd_begin() {
+  Wire.begin();
+  i2clcd_cmd(0b00111000); // function set
+  i2clcd_cmd(0b00111001); // function set
+  i2clcd_cmd(0b00000100); // EntryModeSet
+  i2clcd_cmd(0b00010100); // interval osc
+  i2clcd_cmd(0b01110000 | (lcd_contrast & 0xF)); // lcd_contrast Low
+  i2clcd_cmd(0b01011100 | ((lcd_contrast >> 4) & 0x3)); // contast High/icon/power
+  i2clcd_cmd(0b01101100); // follower control
+  delay(200);
+  i2clcd_cmd(0b00111000); // function set
+  i2clcd_cmd(0b00001100); // Display On
+  i2clcd_cmd(0b00000001); // Clear Display
+  delay(2);
+}
Index: rtos_arduino/trunk/examples/CompositeExample/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/rca.atsln	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/rca.atsln	(revision 137)
@@ -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}") = "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 137)
+++ rtos_arduino/trunk/examples/CompositeExample/rca.componentinfo.xml	(revision 137)
@@ -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/CompositeExample/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/CompositeExample/rca.cproj	(revision 137)
+++ rtos_arduino/trunk/examples/CompositeExample/rca.cproj	(revision 137)
@@ -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>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 137)
+++ rtos_arduino/trunk/examples/CompositeExample/rca_app.cfg	(revision 137)
@@ -0,0 +1,6 @@
+/*
+ *  $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 137)
+++ rtos_arduino/trunk/examples/CompositeExample/rca_app.cpp	(revision 137)
@@ -0,0 +1,876 @@
+#include "rca.h"
+#include "i2c_lcd.h"
+
+#define LED1_PORT 2
+#define LED2_PORT 3
+
+#define SSID       "0024_MYNET"
+#define PASSWORD   "yf-19_yf-21_plus"
+
+#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 137)
+++ rtos_arduino/trunk/examples/CompositeExample/rca_app.h	(revision 137)
@@ -0,0 +1,19 @@
+#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/MultiTask/Makefile
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/Makefile	(revision 137)
+++ rtos_arduino/trunk/examples/MultiTask/Makefile	(revision 137)
@@ -0,0 +1,43 @@
+#
+#  ã¿ã¼ã²ããã®æå®ï¼Makefile.targetã§ä¸æ¸ããããã®ãé²ãããï¼
+#
+all:
+
+#
+#  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
+#
+APPL_CXXOBJS += rca_app.o
+APPL_COBJS   += 
+APPL_CFG      = rca_app.cfg
+
+#
+#  Serialã®æ±ã
+#   ARDUINO_SERIAL
+#    NOUSE_SERIAL
+#    USE_SERIAL
+#    USE_SERIALUSB_AS_SERIAL
+#    USE_SERIAL5_AS_SERIAL
+#
+#ARDUINO_SERIAL = NOUSE_SERIAL
+ARDUINO_SERIAL = USE_SERIAL
+#ARDUINO_SERIAL = USE_SERIALUSB_AS_SERIAL
+#ARDUINO_SERIAL = USE_SERIAL5_AS_SERIAL
+
+#
+#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+RCA_DIR = ../..
+
+#
+#  ASPã®ã½ã¼ã¹ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+SRCDIR = ../../asp_1.9.2
+
+#
+#  ãã®ä»ã®ãªãã·ã§ã³
+#
+APPL_CFLAGS =
+APPL_LIBS =
+APPL_DIR = 
+
+include $(RCA_DIR)/lib/Makefile.rca
Index: rtos_arduino/trunk/examples/MultiTask/do_clean.bat
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/do_clean.bat	(revision 137)
+++ rtos_arduino/trunk/examples/MultiTask/do_clean.bat	(revision 137)
@@ -0,0 +1,3 @@
+call ../do_path.bat
+make clean
+pause
Index: rtos_arduino/trunk/examples/MultiTask/do_debug.bat
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/do_debug.bat	(revision 137)
+++ rtos_arduino/trunk/examples/MultiTask/do_debug.bat	(revision 137)
@@ -0,0 +1,4 @@
+call ../do_path.bat
+make ocd
+make db
+taskkill /F /IM openocd.exe
Index: rtos_arduino/trunk/examples/MultiTask/do_make.bat
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/do_make.bat	(revision 137)
+++ rtos_arduino/trunk/examples/MultiTask/do_make.bat	(revision 137)
@@ -0,0 +1,3 @@
+call ../do_path.bat
+make all
+pause
Index: rtos_arduino/trunk/examples/MultiTask/do_run.bat
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/do_run.bat	(revision 137)
+++ rtos_arduino/trunk/examples/MultiTask/do_run.bat	(revision 137)
@@ -0,0 +1,2 @@
+call ../do_path.bat
+make run
Index: rtos_arduino/trunk/examples/MultiTask/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/rca.atsln	(revision 137)
+++ rtos_arduino/trunk/examples/MultiTask/rca.atsln	(revision 137)
@@ -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}") = "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 137)
+++ rtos_arduino/trunk/examples/MultiTask/rca.componentinfo.xml	(revision 137)
@@ -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/MultiTask/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/MultiTask/rca.cproj	(revision 137)
+++ rtos_arduino/trunk/examples/MultiTask/rca.cproj	(revision 137)
@@ -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>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 137)
+++ rtos_arduino/trunk/examples/MultiTask/rca_app.cfg	(revision 137)
@@ -0,0 +1,8 @@
+/*
+ *  $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 137)
+++ rtos_arduino/trunk/examples/MultiTask/rca_app.cpp	(revision 137)
@@ -0,0 +1,90 @@
+#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(" .");    
+    delay(2000);
+}
+
+int task3_loop_cnt = 0;
+
+/*
+ *  For TASK3
+ */
+void task3_setup() {
+    Serial5.begin(115200);
+    Serial5.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 137)
+++ rtos_arduino/trunk/examples/MultiTask/rca_app.h	(revision 137)
@@ -0,0 +1,8 @@
+#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/NAxesMotion/Makefile
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/Makefile	(revision 137)
+++ rtos_arduino/trunk/examples/NAxesMotion/Makefile	(revision 137)
@@ -0,0 +1,54 @@
+#
+#  ã¿ã¼ã²ããã®æå®ï¼Makefile.targetã§ä¸æ¸ããããã®ãé²ãããï¼
+#
+all:
+
+#
+#  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
+#
+APPL_CXXOBJS += rca_app.o
+APPL_COBJS   += 
+APPL_CFG      = rca_app.cfg
+
+#
+#  Serialã®æ±ã
+#   ARDUINO_SERIAL
+#    NOUSE_SERIAL
+#    USE_SERIAL
+#    USE_SERIALUSB_AS_SERIAL
+#    USE_SERIAL5_AS_SERIAL
+#
+#ARDUINO_SERIAL = NOUSE_SERIAL
+ARDUINO_SERIAL = USE_SERIAL
+#ARDUINO_SERIAL = USE_SERIALUSB_AS_SERIAL
+#ARDUINO_SERIAL = USE_SERIAL5_AS_SERIAL
+
+#
+#  ã©ã¤ãã©ãªã®ä½¿ç¨
+#  
+#USE_ARDUINO_SPI = true
+#USE_ARDUINO_NCESCAN = true
+#USE_ARDUINO_SD  = true
+#USE_ARDUINO_TFT = true
+#USE_ETHERNET2 = true
+USE_NAXESMOTION = true
+#USE_ARDUINO_RTC = true
+
+#
+#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+RCA_DIR = ../..
+
+#
+#  ASPã®ã½ã¼ã¹ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+SRCDIR = ../../asp_1.9.2
+
+#
+#  ãã®ä»ã®ãªãã·ã§ã³
+#
+APPL_CFLAGS =
+APPL_LIBS =
+APPL_DIR = 
+
+include $(RCA_DIR)/lib/Makefile.rca
Index: rtos_arduino/trunk/examples/NAxesMotion/do_clean.bat
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/do_clean.bat	(revision 137)
+++ rtos_arduino/trunk/examples/NAxesMotion/do_clean.bat	(revision 137)
@@ -0,0 +1,3 @@
+call ../do_path.bat
+make clean
+pause
Index: rtos_arduino/trunk/examples/NAxesMotion/do_debug.bat
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/do_debug.bat	(revision 137)
+++ rtos_arduino/trunk/examples/NAxesMotion/do_debug.bat	(revision 137)
@@ -0,0 +1,4 @@
+call ../do_path.bat
+make ocd
+make db
+taskkill /F /IM openocd.exe
Index: rtos_arduino/trunk/examples/NAxesMotion/do_make.bat
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/do_make.bat	(revision 137)
+++ rtos_arduino/trunk/examples/NAxesMotion/do_make.bat	(revision 137)
@@ -0,0 +1,3 @@
+call ../do_path.bat
+make all
+pause
Index: rtos_arduino/trunk/examples/NAxesMotion/do_run.bat
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/do_run.bat	(revision 137)
+++ rtos_arduino/trunk/examples/NAxesMotion/do_run.bat	(revision 137)
@@ -0,0 +1,2 @@
+call ../do_path.bat
+make run
Index: rtos_arduino/trunk/examples/NAxesMotion/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/rca.atsln	(revision 137)
+++ rtos_arduino/trunk/examples/NAxesMotion/rca.atsln	(revision 137)
@@ -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}") = "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 137)
+++ rtos_arduino/trunk/examples/NAxesMotion/rca.componentinfo.xml	(revision 137)
@@ -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/NAxesMotion/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/NAxesMotion/rca.cproj	(revision 137)
+++ rtos_arduino/trunk/examples/NAxesMotion/rca.cproj	(revision 137)
@@ -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>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 137)
+++ rtos_arduino/trunk/examples/NAxesMotion/rca_app.cfg	(revision 137)
@@ -0,0 +1,8 @@
+/*
+ *  $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 137)
+++ rtos_arduino/trunk/examples/NAxesMotion/rca_app.cpp	(revision 137)
@@ -0,0 +1,237 @@
+#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 137)
+++ rtos_arduino/trunk/examples/NAxesMotion/rca_app.h	(revision 137)
@@ -0,0 +1,6 @@
+#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 137)
+++ rtos_arduino/trunk/examples/NCESCan/Makefile	(revision 137)
@@ -0,0 +1,56 @@
+#
+#  ã¿ã¼ã²ããã®æå®ï¼Makefile.targetã§ä¸æ¸ããããã®ãé²ãããï¼
+#
+all:
+
+#
+#  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
+#
+APPL_CXXOBJS += rca_app.o
+APPL_COBJS   += 
+APPL_CFG      = rca_app.cfg
+
+#
+#  Serialã®æ±ã
+#   ARDUINO_SERIAL
+#    NOUSE_SERIAL
+#    USE_SERIAL
+#    USE_SERIALUSB_AS_SERIAL
+#    USE_SERIAL5_AS_SERIAL
+#
+#ARDUINO_SERIAL = NOUSE_SERIAL
+ARDUINO_SERIAL = USE_SERIAL
+#ARDUINO_SERIAL = USE_SERIALUSB_AS_SERIAL
+#ARDUINO_SERIAL = USE_SERIAL5_AS_SERIAL
+
+#
+#  ã©ã¤ãã©ãªã®ä½¿ç¨
+#  
+#USE_ARDUINO_SPI = true
+#USE_ARDUINO_NCESCAN = true
+#USE_ARDUINO_SD  = true
+#USE_ARDUINO_TFT = true
+#USE_ARDUINO_RTC = true
+#USE_ETHERNET2 = true
+#USE_NAXESMOTION = true
+USE_NCESCAN = true
+
+
+#
+#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+RCA_DIR = ../..
+
+#
+#  ASPã®ã½ã¼ã¹ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+SRCDIR = ../../asp_1.9.2
+
+#
+#  ãã®ä»ã®ãªãã·ã§ã³
+#
+APPL_CFLAGS =
+APPL_LIBS =
+APPL_DIR = 
+
+include $(RCA_DIR)/lib/Makefile.rca
Index: rtos_arduino/trunk/examples/NCESCan/do_clean.bat
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/do_clean.bat	(revision 137)
+++ rtos_arduino/trunk/examples/NCESCan/do_clean.bat	(revision 137)
@@ -0,0 +1,3 @@
+call ../do_path.bat
+make clean
+pause
Index: rtos_arduino/trunk/examples/NCESCan/do_debug.bat
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/do_debug.bat	(revision 137)
+++ rtos_arduino/trunk/examples/NCESCan/do_debug.bat	(revision 137)
@@ -0,0 +1,4 @@
+call ../do_path.bat
+make ocd
+make db
+taskkill /F /IM openocd.exe
Index: rtos_arduino/trunk/examples/NCESCan/do_make.bat
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/do_make.bat	(revision 137)
+++ rtos_arduino/trunk/examples/NCESCan/do_make.bat	(revision 137)
@@ -0,0 +1,3 @@
+call ../do_path.bat
+make all
+pause
Index: rtos_arduino/trunk/examples/NCESCan/do_run.bat
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/do_run.bat	(revision 137)
+++ rtos_arduino/trunk/examples/NCESCan/do_run.bat	(revision 137)
@@ -0,0 +1,2 @@
+call ../do_path.bat
+make run
Index: rtos_arduino/trunk/examples/NCESCan/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/rca.atsln	(revision 137)
+++ rtos_arduino/trunk/examples/NCESCan/rca.atsln	(revision 137)
@@ -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}") = "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 137)
+++ rtos_arduino/trunk/examples/NCESCan/rca.componentinfo.xml	(revision 137)
@@ -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/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/rca.cproj	(revision 137)
+++ rtos_arduino/trunk/examples/NCESCan/rca.cproj	(revision 137)
@@ -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>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 137)
+++ rtos_arduino/trunk/examples/NCESCan/rca_app.cfg	(revision 137)
@@ -0,0 +1,8 @@
+/*
+ *  $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 137)
+++ rtos_arduino/trunk/examples/NCESCan/rca_app.cpp	(revision 137)
@@ -0,0 +1,149 @@
+#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, 0x00);
+    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);        
+        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(2000);
+}
Index: rtos_arduino/trunk/examples/NCESCan/rca_app.h
===================================================================
--- rtos_arduino/trunk/examples/NCESCan/rca_app.h	(revision 137)
+++ rtos_arduino/trunk/examples/NCESCan/rca_app.h	(revision 137)
@@ -0,0 +1,6 @@
+#ifndef _RCA_APP_H_
+#define _RCA_APP_H_
+
+#define RCA_NUM_TASK 1
+
+#endif /* _RCA_APP_H_ */
Index: rtos_arduino/trunk/examples/Profiling/Makefile
===================================================================
--- rtos_arduino/trunk/examples/Profiling/Makefile	(revision 137)
+++ rtos_arduino/trunk/examples/Profiling/Makefile	(revision 137)
@@ -0,0 +1,54 @@
+#
+#  ã¿ã¼ã²ããã®æå®ï¼Makefile.targetã§ä¸æ¸ããããã®ãé²ãããï¼
+#
+all:
+
+#
+#  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
+#
+APPL_CXXOBJS += rca_app.o
+APPL_COBJS   += 
+APPL_CFG      = rca_app.cfg
+
+#
+#  Serialã®æ±ã
+#   ARDUINO_SERIAL
+#    NOUSE_SERIAL
+#    USE_SERIAL
+#    USE_SERIALUSB_AS_SERIAL
+#    USE_SERIAL5_AS_SERIAL
+#
+#ARDUINO_SERIAL = NOUSE_SERIAL
+ARDUINO_SERIAL = USE_SERIAL
+#ARDUINO_SERIAL = USE_SERIALUSB_AS_SERIAL
+#ARDUINO_SERIAL = USE_SERIAL5_AS_SERIAL
+
+#
+#  ã©ã¤ãã©ãªã®ä½¿ç¨
+#  
+#USE_ARDUINO_SPI = true
+#USE_ARDUINO_NCESCAN = true
+#USE_ARDUINO_SD  = true
+#USE_ARDUINO_TFT = true
+#USE_ETHERNET2 = true
+USE_NAXESMOTION = true
+#USE_ARDUINO_RTC = true
+
+#
+#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+RCA_DIR = ../..
+
+#
+#  ASPã®ã½ã¼ã¹ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+SRCDIR = ../../asp_1.9.2
+
+#
+#  ãã®ä»ã®ãªãã·ã§ã³
+#
+APPL_CFLAGS =
+APPL_LIBS =
+APPL_DIR = 
+
+include $(RCA_DIR)/lib/Makefile.rca
Index: rtos_arduino/trunk/examples/Profiling/do_clean.bat
===================================================================
--- rtos_arduino/trunk/examples/Profiling/do_clean.bat	(revision 137)
+++ rtos_arduino/trunk/examples/Profiling/do_clean.bat	(revision 137)
@@ -0,0 +1,3 @@
+call ../do_path.bat
+make clean
+pause
Index: rtos_arduino/trunk/examples/Profiling/do_debug.bat
===================================================================
--- rtos_arduino/trunk/examples/Profiling/do_debug.bat	(revision 137)
+++ rtos_arduino/trunk/examples/Profiling/do_debug.bat	(revision 137)
@@ -0,0 +1,4 @@
+call ../do_path.bat
+make ocd
+make db
+taskkill /F /IM openocd.exe
Index: rtos_arduino/trunk/examples/Profiling/do_make.bat
===================================================================
--- rtos_arduino/trunk/examples/Profiling/do_make.bat	(revision 137)
+++ rtos_arduino/trunk/examples/Profiling/do_make.bat	(revision 137)
@@ -0,0 +1,3 @@
+call ../do_path.bat
+make all
+pause
Index: rtos_arduino/trunk/examples/Profiling/do_run.bat
===================================================================
--- rtos_arduino/trunk/examples/Profiling/do_run.bat	(revision 137)
+++ rtos_arduino/trunk/examples/Profiling/do_run.bat	(revision 137)
@@ -0,0 +1,2 @@
+call ../do_path.bat
+make run
Index: rtos_arduino/trunk/examples/Profiling/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/Profiling/rca.atsln	(revision 137)
+++ rtos_arduino/trunk/examples/Profiling/rca.atsln	(revision 137)
@@ -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}") = "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 137)
+++ rtos_arduino/trunk/examples/Profiling/rca.componentinfo.xml	(revision 137)
@@ -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/Profiling/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/Profiling/rca.cproj	(revision 137)
+++ rtos_arduino/trunk/examples/Profiling/rca.cproj	(revision 137)
@@ -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>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 137)
+++ rtos_arduino/trunk/examples/Profiling/rca_app.cfg	(revision 137)
@@ -0,0 +1,8 @@
+/*
+ *  $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 137)
+++ rtos_arduino/trunk/examples/Profiling/rca_app.cpp	(revision 137)
@@ -0,0 +1,85 @@
+#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 137)
+++ rtos_arduino/trunk/examples/Profiling/rca_app.h	(revision 137)
@@ -0,0 +1,9 @@
+#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 137)
+++ rtos_arduino/trunk/examples/RRScheduling/Makefile	(revision 137)
@@ -0,0 +1,43 @@
+#
+#  ã¿ã¼ã²ããã®æå®ï¼Makefile.targetã§ä¸æ¸ããããã®ãé²ãããï¼
+#
+all:
+
+#
+#  ã¢ããªã±ã¼ã·ã§ã³ãã¡ã¤ã«
+#
+APPL_CXXOBJS += rca_app.o
+APPL_COBJS   += 
+APPL_CFG      = rca_app.cfg
+
+#
+#  Serialã®æ±ã
+#   ARDUINO_SERIAL
+#    NOUSE_SERIAL
+#    USE_SERIAL
+#    USE_SERIALUSB_AS_SERIAL
+#    USE_SERIAL5_AS_SERIAL
+#
+#ARDUINO_SERIAL = NOUSE_SERIAL
+ARDUINO_SERIAL = USE_SERIAL
+#ARDUINO_SERIAL = USE_SERIALUSB_AS_SERIAL
+#ARDUINO_SERIAL = USE_SERIAL5_AS_SERIAL
+
+#
+#  RCAã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+RCA_DIR = ../..
+
+#
+#  ASPã®ã½ã¼ã¹ãã¡ã¤ã«ã®ãã£ã¬ã¯ããªã®å®ç¾©
+#
+SRCDIR = ../../asp_1.9.2
+
+#
+#  ãã®ä»ã®ãªãã·ã§ã³
+#
+APPL_CFLAGS =
+APPL_LIBS =
+APPL_DIR = 
+
+include $(RCA_DIR)/lib/Makefile.rca
Index: rtos_arduino/trunk/examples/RRScheduling/do_clean.bat
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/do_clean.bat	(revision 137)
+++ rtos_arduino/trunk/examples/RRScheduling/do_clean.bat	(revision 137)
@@ -0,0 +1,3 @@
+call ../do_path.bat
+make clean
+pause
Index: rtos_arduino/trunk/examples/RRScheduling/do_debug.bat
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/do_debug.bat	(revision 137)
+++ rtos_arduino/trunk/examples/RRScheduling/do_debug.bat	(revision 137)
@@ -0,0 +1,4 @@
+call ../do_path.bat
+make ocd
+make db
+taskkill /F /IM openocd.exe
Index: rtos_arduino/trunk/examples/RRScheduling/do_make.bat
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/do_make.bat	(revision 137)
+++ rtos_arduino/trunk/examples/RRScheduling/do_make.bat	(revision 137)
@@ -0,0 +1,3 @@
+call ../do_path.bat
+make all
+pause
Index: rtos_arduino/trunk/examples/RRScheduling/do_run.bat
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/do_run.bat	(revision 137)
+++ rtos_arduino/trunk/examples/RRScheduling/do_run.bat	(revision 137)
@@ -0,0 +1,2 @@
+call ../do_path.bat
+make run
Index: rtos_arduino/trunk/examples/RRScheduling/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/rca.atsln	(revision 137)
+++ rtos_arduino/trunk/examples/RRScheduling/rca.atsln	(revision 137)
@@ -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}") = "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 137)
+++ rtos_arduino/trunk/examples/RRScheduling/rca.componentinfo.xml	(revision 137)
@@ -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/RRScheduling/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/RRScheduling/rca.cproj	(revision 137)
+++ rtos_arduino/trunk/examples/RRScheduling/rca.cproj	(revision 137)
@@ -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>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 137)
+++ rtos_arduino/trunk/examples/RRScheduling/rca_app.cfg	(revision 137)
@@ -0,0 +1,8 @@
+/*
+ *  $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 137)
+++ rtos_arduino/trunk/examples/RRScheduling/rca_app.cpp	(revision 137)
@@ -0,0 +1,86 @@
+#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 137)
+++ rtos_arduino/trunk/examples/RRScheduling/rca_app.h	(revision 137)
@@ -0,0 +1,11 @@
+#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/proj_base/do_clean.bat
===================================================================
--- rtos_arduino/trunk/examples/proj_base/do_clean.bat	(revision 137)
+++ rtos_arduino/trunk/examples/proj_base/do_clean.bat	(revision 137)
@@ -0,0 +1,3 @@
+call ../do_path.bat
+make clean
+pause
Index: rtos_arduino/trunk/examples/proj_base/do_debug.bat
===================================================================
--- rtos_arduino/trunk/examples/proj_base/do_debug.bat	(revision 137)
+++ rtos_arduino/trunk/examples/proj_base/do_debug.bat	(revision 137)
@@ -0,0 +1,4 @@
+call ../do_path.bat
+make ocd
+make db
+taskkill /F /IM openocd.exe
Index: rtos_arduino/trunk/examples/proj_base/do_make.bat
===================================================================
--- rtos_arduino/trunk/examples/proj_base/do_make.bat	(revision 137)
+++ rtos_arduino/trunk/examples/proj_base/do_make.bat	(revision 137)
@@ -0,0 +1,3 @@
+call ../do_path.bat
+make all
+pause
Index: rtos_arduino/trunk/examples/proj_base/do_run.bat
===================================================================
--- rtos_arduino/trunk/examples/proj_base/do_run.bat	(revision 137)
+++ rtos_arduino/trunk/examples/proj_base/do_run.bat	(revision 137)
@@ -0,0 +1,2 @@
+call ../do_path.bat
+make run
Index: rtos_arduino/trunk/examples/proj_base/rca.atsln
===================================================================
--- rtos_arduino/trunk/examples/proj_base/rca.atsln	(revision 137)
+++ rtos_arduino/trunk/examples/proj_base/rca.atsln	(revision 137)
@@ -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}") = "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 137)
+++ rtos_arduino/trunk/examples/proj_base/rca.componentinfo.xml	(revision 137)
@@ -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/proj_base/rca.cproj
===================================================================
--- rtos_arduino/trunk/examples/proj_base/rca.cproj	(revision 137)
+++ rtos_arduino/trunk/examples/proj_base/rca.cproj	(revision 137)
@@ -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>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>
