Index: asp3_tinet_ecnl_rx/trunk/app4_aircon/.cproject
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app4_aircon/.cproject	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/app4_aircon/.cproject	(revision 364)
@@ -22,5 +22,5 @@
 			<storageModule moduleId="com.renesas.cdt.managedbuild.core.toolchainInfo">
 				<option id="toolchain.id" value="RENESAS_GCC_RX"/>
-				<option id="toolchain.version" value="4.8.4.201703"/>
+				<option id="toolchain.version" value="4.8.4.201803"/>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
@@ -37,5 +37,5 @@
 							<option id="com.renesas.cdt.managedbuild.gcc.core.option.debug.warnStackSize.415917897" name="Warn if stack size exceeds the limit (-Wstack-usage) (H')" superClass="com.renesas.cdt.managedbuild.gcc.core.option.debug.warnStackSize" useByScannerDiscovery="false" value="100" valueType="string"/>
 							<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.renesas.cdt.managedbuild.gcc.core.targetPlatform.1411531115" isAbstract="false" osList="all" superClass="com.renesas.cdt.managedbuild.gcc.core.targetPlatform"/>
-							<builder buildPath="${workspace_loc:/app4_aircon}/Debug" id="com.renesas.cdt.managedbuild.gcc.core.builder.414701081" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="GCC for Renesas Builder" parallelBuildOn="false" superClass="com.renesas.cdt.managedbuild.gcc.core.builder"/>
+							<builder buildPath="${workspace_loc:/app4_aircon}/Debug" id="com.renesas.cdt.managedbuild.gcc.core.builder.414701081" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="GCC for Renesas Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.renesas.cdt.managedbuild.gcc.core.builder"/>
 							<tool id="com.renesas.cdt.managedbuild.gcc.rx.tool.libgen.164426586" name="Library Generator" superClass="com.renesas.cdt.managedbuild.gcc.rx.tool.libgen">
 								<option id="com.renesas.cdt.managedbuild.gcc.rx.option.selectlibrary.2048565838" name="Select Library" superClass="com.renesas.cdt.managedbuild.gcc.rx.option.selectlibrary" useByScannerDiscovery="true" value="com.renesas.cdt.managedbuild.gcc.core.option.librarygenerator.settings.selectLibrary.newLib" valueType="enumerated"/>
@@ -91,5 +91,5 @@
 			<storageModule moduleId="com.renesas.cdt.managedbuild.core.toolchainInfo">
 				<option id="toolchain.id" value="RENESAS_GCC_RX"/>
-				<option id="toolchain.version" value="4.8.4.201703"/>
+				<option id="toolchain.version" value="4.8.4.201803"/>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
@@ -106,5 +106,5 @@
 							<option id="com.renesas.cdt.managedbuild.gcc.core.option.debug.warnStackSize.1916252483" name="Warn if stack size exceeds the limit (-Wstack-usage) (H')" superClass="com.renesas.cdt.managedbuild.gcc.core.option.debug.warnStackSize" useByScannerDiscovery="false" value="100" valueType="string"/>
 							<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.renesas.cdt.managedbuild.gcc.core.targetPlatform.2125057454" isAbstract="false" osList="all" superClass="com.renesas.cdt.managedbuild.gcc.core.targetPlatform"/>
-							<builder buildPath="${workspace_loc:/app4_aircon}/DebugCitrus" id="com.renesas.cdt.managedbuild.gcc.core.builder.1414769322" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="GCC for Renesas Builder" parallelBuildOn="false" superClass="com.renesas.cdt.managedbuild.gcc.core.builder"/>
+							<builder buildPath="${workspace_loc:/app4_aircon}/DebugCitrus" id="com.renesas.cdt.managedbuild.gcc.core.builder.1414769322" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="GCC for Renesas Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.renesas.cdt.managedbuild.gcc.core.builder"/>
 							<tool id="com.renesas.cdt.managedbuild.gcc.rx.tool.libgen.431256842" name="Library Generator" superClass="com.renesas.cdt.managedbuild.gcc.rx.tool.libgen">
 								<option id="com.renesas.cdt.managedbuild.gcc.rx.option.selectlibrary.1885500969" name="Select Library" superClass="com.renesas.cdt.managedbuild.gcc.rx.option.selectlibrary" useByScannerDiscovery="true" value="com.renesas.cdt.managedbuild.gcc.core.option.librarygenerator.settings.selectLibrary.newLib" valueType="enumerated"/>
@@ -160,5 +160,5 @@
 			<storageModule moduleId="com.renesas.cdt.managedbuild.core.toolchainInfo">
 				<option id="toolchain.id" value="RENESAS_GCC_RX"/>
-				<option id="toolchain.version" value="4.8.4.201703"/>
+				<option id="toolchain.version" value="4.8.4.201803"/>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
@@ -175,5 +175,5 @@
 							<option id="com.renesas.cdt.managedbuild.gcc.core.option.debug.warnStackSize.1958295650" name="Warn if stack size exceeds the limit (-Wstack-usage) (H')" superClass="com.renesas.cdt.managedbuild.gcc.core.option.debug.warnStackSize" useByScannerDiscovery="false" value="100" valueType="string"/>
 							<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.renesas.cdt.managedbuild.gcc.core.targetPlatform.1394526678" isAbstract="false" osList="all" superClass="com.renesas.cdt.managedbuild.gcc.core.targetPlatform"/>
-							<builder buildPath="${workspace_loc:/app4_aircon}/DebugEther" id="com.renesas.cdt.managedbuild.gcc.core.builder.1946140985" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="GCC for Renesas Builder" parallelBuildOn="false" superClass="com.renesas.cdt.managedbuild.gcc.core.builder"/>
+							<builder buildPath="${workspace_loc:/app4_aircon}/DebugEther" id="com.renesas.cdt.managedbuild.gcc.core.builder.1946140985" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="GCC for Renesas Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.renesas.cdt.managedbuild.gcc.core.builder"/>
 							<tool id="com.renesas.cdt.managedbuild.gcc.rx.tool.libgen.284884303" name="Library Generator" superClass="com.renesas.cdt.managedbuild.gcc.rx.tool.libgen">
 								<option id="com.renesas.cdt.managedbuild.gcc.rx.option.selectlibrary.1809039592" name="Select Library" superClass="com.renesas.cdt.managedbuild.gcc.rx.option.selectlibrary" useByScannerDiscovery="true" value="com.renesas.cdt.managedbuild.gcc.core.option.librarygenerator.settings.selectLibrary.newLib" valueType="enumerated"/>
@@ -224,4 +224,6 @@
 	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
 	<storageModule moduleId="refreshScope" versionNumber="2">
+		<configuration configurationName="DebugEther"/>
+		<configuration configurationName="DebugCitrus"/>
 		<configuration configurationName="Debug">
 			<resource resourceType="PROJECT" workspacePath="/app4_aircon"/>
Index: asp3_tinet_ecnl_rx/trunk/app4_aircon/Debug/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app4_aircon/Debug/Makefile	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/app4_aircon/Debug/Makefile	(revision 364)
@@ -155,4 +155,10 @@
 
 #
+#  gdicサービスの定義
+#
+
+include $(SRCDIR)/gdic/adafruit_ssd1306/Makefile.config
+
+#
 #  共通コンパイルオプションの定義
 #
@@ -167,5 +173,5 @@
 	CDEFS := -DTOPPERS_OMIT_TECS $(CDEFS)
 endif
-CDEFS := $(CDEFS) -DDHCP4_CLI_CFG -DUSE_PING -DUSE_RESOLVER -DUSE_NETAPP_SUBR -DECHONET_USE_MALLOC -DRamDisk=binary_______ntshell_src_rom_fs_bin_start
+CDEFS := $(CDEFS) -DDHCP4_CLI_CFG -DUSE_PING -DUSE_RESOLVER -DUSE_NETAPP_SUBR -DNOUSE_MPF_NET_BUF -DECHONET_USE_MALLOC -DRamDisk=binary_______ntshell_src_rom_fs_bin_start
 INCLUDES := -I. -I$(SRCDIR)/include -I$(SRCDIR) \
 	-I$(SRCDIR)/../btstack/include \
@@ -175,5 +181,5 @@
 	-I$(SRCDIR)/../usbhost/src \
 	$(INCLUDES)
-LDFLAGS := $(LDFLAGS) -Wl,-Map=$(OBJNAME).map,--cref -L.
+LDFLAGS := $(LDFLAGS) -L.
 LIBS := $(LIBS) $(CXXLIBS)
 CFLAGS = $(COPTS) $(CDEFS) $(INCLUDES)
@@ -185,4 +191,7 @@
 APPLDIRS := $(APPLDIRS) ../../ntshell/tlsf ../../ntshell/fatfs ../../ntshell/ntshell ../../ntshell/ntshell/core ../../ntshell/ntshell/util ../../ntshell/src
 APPL_COBJS := $(APPL_COBJS) mbed_api.o netcmd.o fdtable.o io_stub.o socket_stub.o ffarch.o diskio.o ff.o mmc_rspi.o ccsbcs.o ntshell.o text_editor.o text_history.o usrcmd.o vtrecv.o vtsend.o ntlibc.o ntstdio.o ntopt.o syscall.o tlsf.o
+APPLDIRS := $(APPLDIRS) ../../ntshell/lcd
+APPL_COBJS := $(APPL_COBJS) draw_font.o shnm12_font.o
+APPL_CFLAGS := $(APPL_CFLAGS) -DADAFRUIT_SSD1306 -DSHNM12_FONT
 
 #
@@ -209,34 +218,35 @@
 endif
 
-
-#
-#  ネットワークサービスの定義
-#
-NO_USE_TINET_LIBRARY = true
-
-#  ネットワークインタフェースの選択、何れか一つ選択する。
-NET_IF = ether
-
-#  イーサネット・ディバイスドライバの選択
-NET_DEV = if_btusb
-
-#  ネットワーク層の選択
-#SUPPORT_INET6 = true
-SUPPORT_INET4 = true
-
-#  API に組込む機能の選択
-#API_CFG_IP4MAPPED_ADDR = true
-
-#  トランスポート層の選択
-SUPPORT_TCP = true
-SUPPORT_UDP = true
-
-# IGMPを有効に設定
-SUPPORT_IGMP = true
-
-#
-#  ネットワークサービスの Makefile のインクルード
-#
-include $(SRCDIR)/$(TINETDIR)/Makefile.tinet
+ifdef TINETDIR
+	#
+	#  ネットワークサービスの定義
+	#
+	NO_USE_TINET_LIBRARY = true
+
+	#  ネットワークインタフェースの選択、何れか一つ選択する。
+	NET_IF = ether
+
+	#  イーサネット・ディバイスドライバの選択
+	NET_DEV = if_btusb
+
+	#  ネットワーク層の選択
+	#SUPPORT_INET6 = true
+	SUPPORT_INET4 = true
+
+	#  API に組込む機能の選択
+	#API_CFG_IP4MAPPED_ADDR = true
+
+	#  トランスポート層の選択
+	SUPPORT_TCP = true
+	SUPPORT_UDP = true
+
+	# IGMPを有効に設定
+	SUPPORT_IGMP = true
+
+	#
+	#  ネットワークサービスの Makefile のインクルード
+	#
+	include $(SRCDIR)/$(TINETDIR)/Makefile.tinet
+endif
 
 #
@@ -271,6 +281,11 @@
 #  コンフィギュレータに関する定義
 #
-CFG_TRB := -T $(TINET_ROOT)/tinet.trb:tcpip -T ../../ntshell/echonet/echonet.trb:echonet -T $(TARGETDIR)/target_kernel.trb:kernel
-CFG_TABS := --api-table $(TINET_ROOT)/tcpip_api.def:tcpip \
+ifndef TINETDIR
+  CFG_TRB := -T $(TARGETDIR)/target_kernel.trb
+  CFG_TABS := --api-table $(SRCDIR)/kernel/kernel_api.def \
+			--symval-table $(SRCDIR)/kernel/kernel_sym.def $(CFG_TABS)
+else
+  CFG_TRB := -T $(TINET_ROOT)/tinet.trb:tcpip -T ../../ntshell/echonet/echonet.trb:echonet -T $(TARGETDIR)/target_kernel.trb:kernel
+  CFG_TABS := --api-table $(TINET_ROOT)/tcpip_api.def:tcpip \
 			--api-table ../../ntshell/echonet/echonet_api.def:echonet \
 			--api-table $(SRCDIR)/kernel/kernel_api.def:kernel \
@@ -278,4 +293,5 @@
 			--symval-table ../../ntshell/echonet/echonet_sym.def \
 			--symval-table $(SRCDIR)/kernel/kernel_sym.def $(CFG_TABS)
+endif
 CFG_ASMOBJS := $(CFG_ASMOBJS)
 CFG_COBJS := kernel_cfg.o echonet_cfg.o $(CFG_COBJS)
@@ -423,4 +439,11 @@
 
 #
+#  並列makeのための依存関係の定義
+#
+$(APPL_OBJS) $(SYSSVC_OBJS): | kernel_cfg.timestamp
+$(APPL_ASMOBJS) $(SYSSVC_ASMOBJS) $(KERNEL_ASMOBJS) $(CFG_ASMOBJS): \
+														| offset.timestamp
+
+#
 #  特別な依存関係の定義
 #
@@ -431,5 +454,5 @@
 #
 $(OBJFILE): $(ALL_OBJS) $(LIBS_DEP)
-	$(LINK) $(CFLAGS) $(LDFLAGS) $(OBJ_LDFLAGS) -o $(OBJFILE) \
+	$(LINK) $(CFLAGS) $(LDFLAGS) $(OBJ_LDFLAGS) -o $(OBJFILE) -Wl,-Map=$(OBJNAME).map,--cref \
 			$(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \
 			-Wl,--start-group $(ALL_LIBS) -Wl,--end-group $(END_OBJS)
Index: asp3_tinet_ecnl_rx/trunk/app4_aircon/DebugCitrus/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app4_aircon/DebugCitrus/Makefile	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/app4_aircon/DebugCitrus/Makefile	(revision 364)
@@ -155,4 +155,10 @@
 
 #
+#  gdicサービスの定義
+#
+
+include $(SRCDIR)/gdic/adafruit_ssd1306/Makefile.config
+
+#
 #  共通コンパイルオプションの定義
 #
@@ -167,5 +173,5 @@
 	CDEFS := -DTOPPERS_OMIT_TECS $(CDEFS)
 endif
-CDEFS := $(CDEFS) -DDHCP4_CLI_CFG -DUSE_PING -DUSE_RESOLVER -DUSE_NETAPP_SUBR -DECHONET_USE_MALLOC -DRamDisk=binary_______ntshell_src_rom_fs_bin_start
+CDEFS := $(CDEFS) -DDHCP4_CLI_CFG -DUSE_PING -DUSE_RESOLVER -DUSE_NETAPP_SUBR -DNOUSE_MPF_NET_BUF -DECHONET_USE_MALLOC -DRamDisk=binary_______ntshell_src_rom_fs_bin_start
 INCLUDES := -I. -I$(SRCDIR)/include -I$(SRCDIR) \
 	-I$(SRCDIR)/../btstack/include \
@@ -175,5 +181,5 @@
 	-I$(SRCDIR)/../usbhost/src \
 	$(INCLUDES)
-LDFLAGS := $(LDFLAGS) -Wl,-Map=$(OBJNAME).map,--cref -L.
+LDFLAGS := $(LDFLAGS) -L.
 LIBS := $(LIBS) $(CXXLIBS)
 CFLAGS = $(COPTS) $(CDEFS) $(INCLUDES)
@@ -185,4 +191,7 @@
 APPLDIRS := $(APPLDIRS) ../../ntshell/tlsf ../../ntshell/fatfs ../../ntshell/ntshell ../../ntshell/ntshell/core ../../ntshell/ntshell/util ../../ntshell/src
 APPL_COBJS := $(APPL_COBJS) mbed_api.o netcmd.o fdtable.o io_stub.o socket_stub.o ffarch.o diskio.o ff.o mmc_rspi.o ccsbcs.o ntshell.o text_editor.o text_history.o usrcmd.o vtrecv.o vtsend.o ntlibc.o ntstdio.o ntopt.o syscall.o tlsf.o
+APPLDIRS := $(APPLDIRS) ../../ntshell/lcd
+APPL_COBJS := $(APPL_COBJS) draw_font.o shnm12_font.o
+APPL_CFLAGS := $(APPL_CFLAGS) -DADAFRUIT_SSD1306 -DSHNM12_FONT
 
 #
@@ -209,34 +218,35 @@
 endif
 
-
-#
-#  ネットワークサービスの定義
-#
-NO_USE_TINET_LIBRARY = true
-
-#  ネットワークインタフェースの選択、何れか一つ選択する。
-NET_IF = ether
-
-#  イーサネット・ディバイスドライバの選択
-NET_DEV = if_btusb
-
-#  ネットワーク層の選択
-#SUPPORT_INET6 = true
-SUPPORT_INET4 = true
-
-#  API に組込む機能の選択
-#API_CFG_IP4MAPPED_ADDR = true
-
-#  トランスポート層の選択
-SUPPORT_TCP = true
-SUPPORT_UDP = true
-
-# IGMPを有効に設定
-SUPPORT_IGMP = true
-
-#
-#  ネットワークサービスの Makefile のインクルード
-#
-include $(SRCDIR)/$(TINETDIR)/Makefile.tinet
+ifdef TINETDIR
+	#
+	#  ネットワークサービスの定義
+	#
+	NO_USE_TINET_LIBRARY = true
+
+	#  ネットワークインタフェースの選択、何れか一つ選択する。
+	NET_IF = ether
+
+	#  イーサネット・ディバイスドライバの選択
+	NET_DEV = if_btusb
+
+	#  ネットワーク層の選択
+	#SUPPORT_INET6 = true
+	SUPPORT_INET4 = true
+
+	#  API に組込む機能の選択
+	#API_CFG_IP4MAPPED_ADDR = true
+
+	#  トランスポート層の選択
+	SUPPORT_TCP = true
+	SUPPORT_UDP = true
+
+	# IGMPを有効に設定
+	SUPPORT_IGMP = true
+
+	#
+	#  ネットワークサービスの Makefile のインクルード
+	#
+	include $(SRCDIR)/$(TINETDIR)/Makefile.tinet
+endif
 
 #
@@ -271,6 +281,11 @@
 #  コンフィギュレータに関する定義
 #
-CFG_TRB := -T $(TINET_ROOT)/tinet.trb:tcpip -T ../../ntshell/echonet/echonet.trb:echonet -T $(TARGETDIR)/target_kernel.trb:kernel
-CFG_TABS := --api-table $(TINET_ROOT)/tcpip_api.def:tcpip \
+ifndef TINETDIR
+  CFG_TRB := -T $(TARGETDIR)/target_kernel.trb
+  CFG_TABS := --api-table $(SRCDIR)/kernel/kernel_api.def \
+			--symval-table $(SRCDIR)/kernel/kernel_sym.def $(CFG_TABS)
+else
+  CFG_TRB := -T $(TINET_ROOT)/tinet.trb:tcpip -T ../../ntshell/echonet/echonet.trb:echonet -T $(TARGETDIR)/target_kernel.trb:kernel
+  CFG_TABS := --api-table $(TINET_ROOT)/tcpip_api.def:tcpip \
 			--api-table ../../ntshell/echonet/echonet_api.def:echonet \
 			--api-table $(SRCDIR)/kernel/kernel_api.def:kernel \
@@ -278,4 +293,5 @@
 			--symval-table ../../ntshell/echonet/echonet_sym.def \
 			--symval-table $(SRCDIR)/kernel/kernel_sym.def $(CFG_TABS)
+endif
 CFG_ASMOBJS := $(CFG_ASMOBJS)
 CFG_COBJS := kernel_cfg.o echonet_cfg.o $(CFG_COBJS)
@@ -423,4 +439,11 @@
 
 #
+#  並列makeのための依存関係の定義
+#
+$(APPL_OBJS) $(SYSSVC_OBJS): | kernel_cfg.timestamp
+$(APPL_ASMOBJS) $(SYSSVC_ASMOBJS) $(KERNEL_ASMOBJS) $(CFG_ASMOBJS): \
+														| offset.timestamp
+
+#
 #  特別な依存関係の定義
 #
@@ -431,5 +454,5 @@
 #
 $(OBJFILE): $(ALL_OBJS) $(LIBS_DEP)
-	$(LINK) $(CFLAGS) $(LDFLAGS) $(OBJ_LDFLAGS) -o $(OBJFILE) \
+	$(LINK) $(CFLAGS) $(LDFLAGS) $(OBJ_LDFLAGS) -o $(OBJFILE) -Wl,-Map=$(OBJNAME).map,--cref \
 			$(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \
 			-Wl,--start-group $(ALL_LIBS) -Wl,--end-group $(END_OBJS)
Index: asp3_tinet_ecnl_rx/trunk/app4_aircon/DebugEther/Makefile
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app4_aircon/DebugEther/Makefile	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/app4_aircon/DebugEther/Makefile	(revision 364)
@@ -153,4 +153,10 @@
 
 #
+#  gdicサービスの定義
+#
+
+include $(SRCDIR)/gdic/adafruit_ssd1306/Makefile.config
+
+#
 #  共通コンパイルオプションの定義
 #
@@ -165,5 +171,5 @@
 	CDEFS := -DTOPPERS_OMIT_TECS $(CDEFS)
 endif
-CDEFS := $(CDEFS) -DDHCP4_CLI_CFG -DUSE_PING -DUSE_RESOLVER -DUSE_NETAPP_SUBR -DECHONET_USE_MALLOC -DRamDisk=binary_______ntshell_src_rom_fs_bin_start
+CDEFS := $(CDEFS) -DDHCP4_CLI_CFG -DUSE_PING -DUSE_RESOLVER -DUSE_NETAPP_SUBR -DNOUSE_MPF_NET_BUF -DECHONET_USE_MALLOC -DRamDisk=binary_______ntshell_src_rom_fs_bin_start
 INCLUDES := -I. -I$(SRCDIR)/include -I$(SRCDIR) \
 	-I$(SRCDIR)/../btstack/include \
@@ -173,5 +179,5 @@
 	-I$(SRCDIR)/../usbhost/src \
 	$(INCLUDES)
-LDFLAGS := $(LDFLAGS) -Wl,-Map=$(OBJNAME).map,--cref -L.
+LDFLAGS := $(LDFLAGS) -L.
 LIBS := $(LIBS) $(CXXLIBS)
 CFLAGS = $(COPTS) $(CDEFS) $(INCLUDES)
@@ -183,4 +189,7 @@
 APPLDIRS := $(APPLDIRS) ../../ntshell/tlsf ../../ntshell/fatfs ../../ntshell/ntshell ../../ntshell/ntshell/core ../../ntshell/ntshell/util ../../ntshell/src
 APPL_COBJS := $(APPL_COBJS) mbed_api.o netcmd.o fdtable.o io_stub.o socket_stub.o ffarch.o diskio.o ff.o mmc_rspi.o ccsbcs.o ntshell.o text_editor.o text_history.o usrcmd.o vtrecv.o vtsend.o ntlibc.o ntstdio.o ntopt.o syscall.o tlsf.o
+APPLDIRS := $(APPLDIRS) ../../ntshell/lcd
+APPL_COBJS := $(APPL_COBJS) draw_font.o shnm12_font.o
+APPL_CFLAGS := $(APPL_CFLAGS) -DADAFRUIT_SSD1306 -DSHNM12_FONT
 
 #
@@ -207,34 +216,35 @@
 endif
 
-
-#
-#  ネットワークサービスの定義
-#
-NO_USE_TINET_LIBRARY = true
-
-#  ネットワークインタフェースの選択、何れか一つ選択する。
-NET_IF = ether
-
-#  イーサネット・ディバイスドライバの選択
+ifdef TINETDIR
+	#
+	#  ネットワークサービスの定義
+	#
+	NO_USE_TINET_LIBRARY = true
+
+	#  ネットワークインタフェースの選択、何れか一つ選択する。
+	NET_IF = ether
+
+	#  イーサネット・ディバイスドライバの選択
 	NET_DEV = if_rx62n
 
-#  ネットワーク層の選択
-#SUPPORT_INET6 = true
-SUPPORT_INET4 = true
-
-#  API に組込む機能の選択
-#API_CFG_IP4MAPPED_ADDR = true
-
-#  トランスポート層の選択
-SUPPORT_TCP = true
-SUPPORT_UDP = true
-
-# IGMPを有効に設定
-SUPPORT_IGMP = true
-
-#
-#  ネットワークサービスの Makefile のインクルード
-#
-include $(SRCDIR)/$(TINETDIR)/Makefile.tinet
+	#  ネットワーク層の選択
+	#SUPPORT_INET6 = true
+	SUPPORT_INET4 = true
+
+	#  API に組込む機能の選択
+	#API_CFG_IP4MAPPED_ADDR = true
+
+	#  トランスポート層の選択
+	SUPPORT_TCP = true
+	SUPPORT_UDP = true
+
+	# IGMPを有効に設定
+	SUPPORT_IGMP = true
+
+	#
+	#  ネットワークサービスの Makefile のインクルード
+	#
+	include $(SRCDIR)/$(TINETDIR)/Makefile.tinet
+endif
 
 #
@@ -269,6 +279,11 @@
 #  コンフィギュレータに関する定義
 #
-CFG_TRB := -T $(TINET_ROOT)/tinet.trb:tcpip -T ../../ntshell/echonet/echonet.trb:echonet -T $(TARGETDIR)/target_kernel.trb:kernel
-CFG_TABS := --api-table $(TINET_ROOT)/tcpip_api.def:tcpip \
+ifndef TINETDIR
+  CFG_TRB := -T $(TARGETDIR)/target_kernel.trb
+  CFG_TABS := --api-table $(SRCDIR)/kernel/kernel_api.def \
+			--symval-table $(SRCDIR)/kernel/kernel_sym.def $(CFG_TABS)
+else
+  CFG_TRB := -T $(TINET_ROOT)/tinet.trb:tcpip -T ../../ntshell/echonet/echonet.trb:echonet -T $(TARGETDIR)/target_kernel.trb:kernel
+  CFG_TABS := --api-table $(TINET_ROOT)/tcpip_api.def:tcpip \
 			--api-table ../../ntshell/echonet/echonet_api.def:echonet \
 			--api-table $(SRCDIR)/kernel/kernel_api.def:kernel \
@@ -276,4 +291,5 @@
 			--symval-table ../../ntshell/echonet/echonet_sym.def \
 			--symval-table $(SRCDIR)/kernel/kernel_sym.def $(CFG_TABS)
+endif
 CFG_ASMOBJS := $(CFG_ASMOBJS)
 CFG_COBJS := kernel_cfg.o echonet_cfg.o $(CFG_COBJS)
@@ -421,4 +437,11 @@
 
 #
+#  並列makeのための依存関係の定義
+#
+$(APPL_OBJS) $(SYSSVC_OBJS): | kernel_cfg.timestamp
+$(APPL_ASMOBJS) $(SYSSVC_ASMOBJS) $(KERNEL_ASMOBJS) $(CFG_ASMOBJS): \
+														| offset.timestamp
+
+#
 #  特別な依存関係の定義
 #
@@ -429,5 +452,5 @@
 #
 $(OBJFILE): $(ALL_OBJS) $(LIBS_DEP)
-	$(LINK) $(CFLAGS) $(LDFLAGS) $(OBJ_LDFLAGS) -o $(OBJFILE) \
+	$(LINK) $(CFLAGS) $(LDFLAGS) $(OBJ_LDFLAGS) -o $(OBJFILE) -Wl,-Map=$(OBJNAME).map,--cref \
 			$(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \
 			-Wl,--start-group $(ALL_LIBS) -Wl,--end-group $(END_OBJS)
Index: asp3_tinet_ecnl_rx/trunk/app4_aircon/src/echonet_main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app4_aircon/src/echonet_main.c	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/app4_aircon/src/echonet_main.c	(revision 364)
@@ -1,7 +1,7 @@
 /*
  *  TOPPERS ECHONET Lite Communication Middleware
- * 
- *  Copyright (C) 2014 Cores Co., Ltd. Japan
- * 
+ *
+ *  Copyright (C) 2014-2018 Cores Co., Ltd. Japan
+ *
  *  上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
  *  ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
@@ -26,5 +26,5 @@
  *      由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
  *      免責すること．
- * 
+ *
  *  本ソフトウェアは，無保証で提供されているものである．上記著作権者お
  *  よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
@@ -32,9 +32,9 @@
  *  アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
  *  の責任を負わない．
- * 
+ *
  *  @(#) $Id$
  */
 
-/* 
+/*
  *  サンプルプログラム(1)の本体
  */
@@ -51,4 +51,6 @@
 #include "echonet_cfg.h"
 #include "target_kernel_impl.h"
+#include "adafruit_ssd1306.h"
+#include "draw_font.h"
 
 /* TODO: メーカーコードを設定 */
@@ -180,10 +182,10 @@
 
 	/* サイズが１以外は受け付けない */
-	if(size != 1)
+	if (size != 1)
 		return 0;
 
 	*anno = *((uint8_t *)item->exinf) != *((uint8_t *)src);
 
-	switch(*(uint8_t *)src){
+	switch (*(uint8_t *)src) {
 	/* ONの場合 */
 	case 0x30:
@@ -194,5 +196,5 @@
 		data[0] = 0x80;
 		ret = ecn_brk_wai(data, sizeof(data));
-		if(ret != E_OK){
+		if (ret != E_OK) {
 			syslog(LOG_ERROR, "ecn_brk_wai");
 			return 2;
@@ -213,10 +215,10 @@
 {
 	/* サイズが１以外は受け付けない */
-	if(size != 1)
+	if (size != 1)
 		return 0;
 
 	*anno = *((uint8_t *)item->exinf) != *((uint8_t *)src);
 
-	switch(*(uint8_t *)src){
+	switch (*(uint8_t *)src) {
 	/* 異常発生ありの場合 */
 	case 0x41:
@@ -242,8 +244,8 @@
 
 	/* サイズが1以外は受け付けない */
-	if(size != 1)
+	if (size != 1)
 		return 0;
 
-	switch(*(uint8_t *)src){
+	switch (*(uint8_t *)src) {
 	/* 自動の場合 */
 	case 0x41:
@@ -262,5 +264,5 @@
 		data[0] = 0xB0;
 		ret = ecn_brk_wai(data, sizeof(data));
-		if(ret != E_OK){
+		if (ret != E_OK) {
 			syslog(LOG_ERROR, "ecn_brk_wai");
 			return 2;
@@ -284,14 +286,14 @@
 
 	/* サイズが1以外は受け付けない */
-	if(size != 1)
+	if (size != 1)
 		return 0;
 
 	/* 0℃～50℃ */
-	if((*(uint8_t *)src >= 0x00) && (*(uint8_t *)src <= 0x32)){
+	if ((*(uint8_t *)src >= 0x00) && (*(uint8_t *)src <= 0x32)) {
 		*((uint8_t *)item->exinf) = *((uint8_t *)src);
 		/* メインタスクに通知 */
 		data[0] = 0xB3;
 		ret = ecn_brk_wai(data, sizeof(data));
-		if(ret != E_OK){
+		if (ret != E_OK) {
 			syslog(LOG_ERROR, "ecn_brk_wai");
 			return 2;
@@ -299,5 +301,5 @@
 	}
 	/* 上記以外は受け付けない */
-	else{
+	else {
 		return 0;
 	}
@@ -329,10 +331,10 @@
 
 	ret2 = get_tim(&now);
-	if (ret2 != E_OK){
+	if (ret2 != E_OK) {
 		syslog(LOG_ERROR, "get_tim");
 		return;
 	}
 
-	for(;;){
+	for (;;) {
 		prev = now;
 
@@ -342,5 +344,5 @@
 		/* 応答電文待ち */
 		ret = ecn_trcv_esv(&esv, timer);
-		if ((ret != E_OK) && (ret != E_BRK) && (ret != E_TMOUT)){
+		if ((ret != E_OK) && (ret != E_BRK) && (ret != E_TMOUT)) {
 			syslog(LOG_ERROR, "ecn_trcv_esv");
 			break;
@@ -348,5 +350,5 @@
 
 		ret2 = get_tim(&now);
-		if (ret2 != E_OK){
+		if (ret2 != E_OK) {
 			syslog(LOG_ERROR, "get_tim");
 			break;
@@ -363,5 +365,5 @@
 			/* 領域解放 */
 			ret = ecn_rel_esv(esv);
-			if (ret != E_OK){
+			if (ret != E_OK) {
 				syslog(LOG_ERROR, "ecn_rel_esv");
 				break;
@@ -372,5 +374,5 @@
 			/* 応答電文待ちの割り込みデータ取得 */
 			ret = ecn_get_brk_dat(esv, brkdat, sizeof(brkdat), &len);
-			if (ret != E_OK){
+			if (ret != E_OK) {
 				syslog(LOG_ERROR, "ecn_get_brk_dat");
 				break;
@@ -382,5 +384,5 @@
 			/* 領域解放 */
 			ret = ecn_rel_esv(esv);
-			if (ret != E_OK){
+			if (ret != E_OK) {
 				syslog(LOG_ERROR, "ecn_rel_esv");
 				break;
@@ -393,6 +395,4 @@
 }
 
-bool_t started = false;
-
 void echonet_change_netif_link(uint8_t link_up, uint8_t up)
 {
@@ -402,14 +402,10 @@
 		return;
 
-	if (up && !started) {
-		started = true;
-
-		/* ECHONETミドルウェアを起動 */
-		ret = ecn_sta_svc();
-		if (ret != E_OK)
-			return;
-
-		/* ECHONETミドルウェアを起動するのを待つ */
-		dly_tsk(100);
+	if (up) {
+		/* インスタンスリスト通知の送信 */
+		ret = ecn_ntf_inl();
+		if (ret != E_OK) {
+			syslog(LOG_ERROR, "ecn_ntf_inl");
+		}
 	}
 
@@ -425,5 +421,6 @@
 }
 
-enum main_state_t{
+enum main_state_t {
+	main_state_start,
 	main_state_idle,
 	main_state_search,
@@ -436,5 +433,5 @@
 
 int main_timer = TMO_FEVR;
-enum main_state_t main_state = main_state_idle;
+enum main_state_t main_state = main_state_start;
 int16_t main_ave_templ;
 bool_t main_tmp_fan_on;
@@ -443,25 +440,6 @@
 int main_btn_timer = TMO_FEVR;
 
-enum main_led_state_t{
-	main_led_state_idle,
-	main_led_state_on_o,
-	main_led_state_on_n,
-	main_led_state_off_o,
-	main_led_state_off_f1,
-	main_led_state_off_f2,
-	main_led_state_space1,
-	main_led_state_templ_10,
-	main_led_state_templ_1,
-	main_led_state_space2,
-	main_led_state_ave_templ_10,
-	main_led_state_ave_templ_1,
-	main_led_state_space3,
-	main_led_state_mode,
-	main_led_state_space4,
-};
-
-int main_led_timer = TMO_FEVR;
-enum main_led_state_t main_led_state = main_led_state_idle;
-bool_t main_led_update;
+int main_lcd_timer = TMO_FEVR;
+int main_lcd_state = 0;
 
 bool_t main_btn1_state;
@@ -470,5 +448,7 @@
 int main_btn2_count = 0;
 
-enum main_rly_state_t{
+LCD_Handler_t lcd;
+
+enum main_rly_state_t {
 	main_rly_state_off,
 	main_rly_state_on
@@ -486,18 +466,10 @@
 	uint8_t btn1, btn2;
 
-	/* 7segを"0"と表示 */
-	sil_wrb_mem((uint8_t *)0x0008C02D, 0xC0);
-
-	/* １秒後に温度センサーを探す */
+	/* ECHONETミドルウェアを起動するのを待つ */
+	main_state = main_state_start;
 	main_timer = 1000 * 1000;
 
 	/* 10ms後にボタン状態を確認 */
 	main_btn_timer = 10 * 1000;
-
-	if(home_air_conditioner_data.property80 == 0x30)
-		main_led_state = main_led_state_on_o;
-	else
-		main_led_state = main_led_state_off_o;
-	main_led_timer = 0;
 
 	/* ボタン状態読み込み */
@@ -507,4 +479,20 @@
 	main_btn2_state = (btn2 & 0x80) != 0;
 
+	i2c_init(&lcd.i2c, I2C_SDA, I2C_SCL);
+	i2c_frequency(&lcd.i2c, 100000);
+
+	lcd_init3(&lcd, NC);
+
+	lcd_begin(&lcd, SSD1306_SWITCHCAPVCC, SSD1306_I2C_ADDRESS, true);
+
+	lcd_clearDisplay(&lcd);
+
+	lcd_display(&lcd);
+
+	/* 1秒後にLCD表示を更新 */
+	main_lcd_state = 10;
+	main_lcd_timer = 1000 * 1000;
+
+	/* メインタスクを起動 */
 	ER ret = act_tsk(MAIN_TASK);
 	if (ret != E_OK) {
@@ -520,16 +508,16 @@
 	int result = main_timer;
 
-	if((result == TMO_FEVR)
-		|| ((main_btn_timer != TMO_FEVR) && (main_btn_timer < result))){
+	if ((result == TMO_FEVR)
+		|| ((main_btn_timer != TMO_FEVR) && (main_btn_timer < result))) {
 		result = main_btn_timer;
 	}
 
-	if((result == TMO_FEVR)
-		|| ((main_led_timer != TMO_FEVR) && (main_led_timer < result))){
-		result = main_led_timer;
-	}
-
-	if((result == TMO_FEVR)
-		|| ((main_rly_timer != TMO_FEVR) && (main_rly_timer < result))){
+	if ((result == TMO_FEVR)
+		|| ((main_lcd_timer != TMO_FEVR) && (main_lcd_timer < result))) {
+		result = main_lcd_timer;
+	}
+
+	if ((result == TMO_FEVR)
+		|| ((main_rly_timer != TMO_FEVR) && (main_rly_timer < result))) {
 		result = main_rly_timer;
 	}
@@ -543,28 +531,28 @@
 static void main_progress(int interval)
 {
-	if(main_timer != TMO_FEVR){
+	if (main_timer != TMO_FEVR) {
 		main_timer -= interval;
-		if(main_timer < 0){
+		if (main_timer < 0) {
 			main_timer = 0;
 		}
 	}
 
-	if(main_btn_timer != TMO_FEVR){
+	if (main_btn_timer != TMO_FEVR) {
 		main_btn_timer -= interval;
-		if(main_btn_timer < 0){
+		if (main_btn_timer < 0) {
 			main_btn_timer = 0;
 		}
 	}
 
-	if(main_led_timer != TMO_FEVR){
-		main_led_timer -= interval;
-		if(main_led_timer < 0){
-			main_led_timer = 0;
-		}
-	}
-
-	if(main_rly_timer != TMO_FEVR){
+	if (main_lcd_timer != TMO_FEVR) {
+		main_lcd_timer -= interval;
+		if (main_lcd_timer < 0) {
+			main_lcd_timer = 0;
+		}
+	}
+
+	if (main_rly_timer != TMO_FEVR) {
 		main_rly_timer -= interval;
-		if(main_rly_timer < 0){
+		if (main_rly_timer < 0) {
 			main_rly_timer = 0;
 		}
@@ -588,19 +576,19 @@
 
 	eobjid = ecn_get_eobj(esv);
-	if(eobjid == EOBJ_NULL){
+	if (eobjid == EOBJ_NULL) {
 		syslog(LOG_ERROR, "ecn_get_eobj");
 	}
 
 	ret = ecn_itr_ini(&enm, esv);
-	if(ret != E_OK){
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_itr_ini");
 		return;
 	}
 
-	for(;;) {
-		while((ret = ecn_itr_nxt(&enm, &epc, &pdc, p_edt)) == E_OK) {
+	for (;;) {
+		while ((ret = ecn_itr_nxt(&enm, &epc, &pdc, p_edt)) == E_OK) {
 			switch (epc) {
 			case 0xD6:
-				switch(main_state){
+				switch (main_state) {
 				case main_state_idle:
 				case main_state_search:
@@ -613,5 +601,5 @@
 				break;
 			case 0xE0:
-				switch(main_state){
+				switch (main_state) {
 				case main_state_survey_01:
 					/* 温度センサー２温度監視 */
@@ -643,9 +631,9 @@
 			}
 		}
-		if(ret != E_BOVR){
+		if (ret != E_BOVR) {
 			syslog(LOG_ERROR, "ecn_itr_nxt");
 			break;
 		}
-		if(enm.is_eof)
+		if (enm.is_eof)
 			break;
 	}
@@ -668,5 +656,5 @@
 	/* 温度センサー動作状態取得電文作成 */
 	ret = ecn_esv_get(&esv, senserids[no - 1], 0x80);
-	if(ret != E_OK){
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_esv_get");
 		return;
@@ -675,9 +663,9 @@
 	/* 温度計測値取得追加 */
 	ret = ecn_add_epc(esv, 0xE0);
-	if(ret != E_OK){
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_add_epc");
 
 		ret = ecn_rel_esv(esv);
-		if(ret != E_OK){
+		if (ret != E_OK) {
 			syslog(LOG_ERROR, "ecn_rel_esv");
 		}
@@ -687,5 +675,5 @@
 	/* 電文送信 */
 	ret = ecn_snd_esv(esv);
-	if(ret != E_OK){
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_snd_esv");
 	}
@@ -700,20 +688,20 @@
 	int templ = 0;
 
-	if(temp_sensor_01_data.property80 == 0x30){
+	if (temp_sensor_01_data.property80 == 0x30) {
 		templ += ((((uint16_t)temp_sensor_01_data.propertyE0) & 0xFF) << 8)
 			| ((((uint16_t)temp_sensor_01_data.propertyE0) & 0xFF00) >> 8);
 		count++;
 	}
-	if(temp_sensor_02_data.property80 == 0x30){
+	if (temp_sensor_02_data.property80 == 0x30) {
 		templ += ((((uint16_t)temp_sensor_02_data.propertyE0) & 0xFF) << 8)
 			| ((((uint16_t)temp_sensor_02_data.propertyE0) & 0xFF00) >> 8);
 		count++;
 	}
-	if(temp_sensor_03_data.property80 == 0x30){
+	if (temp_sensor_03_data.property80 == 0x30) {
 		templ += ((((uint16_t)temp_sensor_03_data.propertyE0) & 0xFF) << 8)
 			| ((((uint16_t)temp_sensor_03_data.propertyE0) & 0xFF00) >> 8);
 		count++;
 	}
-	if(temp_sensor_04_data.property80 == 0x30){
+	if (temp_sensor_04_data.property80 == 0x30) {
 		templ += ((((uint16_t)temp_sensor_04_data.propertyE0) & 0xFF) << 8)
 			| ((((uint16_t)temp_sensor_04_data.propertyE0) & 0xFF00) >> 8);
@@ -721,9 +709,9 @@
 	}
 
-	if(count > 0){
+	if (count > 0) {
 		templ = templ / count;
-		if(templ < -2732)
+		if (templ < -2732)
 			main_ave_templ = 0x8000;
-		else if(templ > 32766)
+		else if (templ > 32766)
 			main_ave_templ = 0x7FFF;
 		else
@@ -731,6 +719,6 @@
 
 		/* FANが停止中の場合 */
-		if(!main_tmp_fan_on){
-			if(main_ave_templ > (10 * home_air_conditioner_data.propertyB3 + 5)){
+		if (!main_tmp_fan_on) {
+			if (main_ave_templ > (10 * home_air_conditioner_data.propertyB3 + 5)) {
 				main_tmp_fan_on = true;
 
@@ -741,6 +729,6 @@
 		}
 		/* FANが稼働中の場合 */
-		else{
-			if(main_ave_templ < (10 * home_air_conditioner_data.propertyB3 - 5)){
+		else {
+			if (main_ave_templ < (10 * home_air_conditioner_data.propertyB3 - 5)) {
 				main_tmp_fan_on = false;
 
@@ -760,41 +748,31 @@
 static void main_break_wait(uint8_t *brkdat, int32_t len)
 {
-	switch(main_led_state){
-	case main_led_state_idle:
-		switch (brkdat[0]) {
-		case 0x01:
-			// Link up/down
-			break;
-		case 0x80:
-		case 0xB0:
-		case 0xB3:
-			if(home_air_conditioner_data.property80 == 0x30)
-				main_led_state = main_led_state_on_o;
-			else
-				main_led_state = main_led_state_off_o;
-			main_led_timer = 0;
-			break;
-		}
-		break;
-	default:
-		main_led_update = true;
-		break;
+	bool_t prev;
+
+	if (brkdat[0] == 0x01) {
+		// Link up/down
+		return;
 	}
 
 	/* 運転モードが送風の場合、温度によらずFANをON */
-	if (*brkdat == 0xB0) {
-		bool_t prev = main_ctl_fan_on;
+	switch (*brkdat) {
+	case 0x80:
+		if (main_ctl_fan_on) {
+			/* リレー出力をON/OFF */
+			main_rly_onoff(home_air_conditioner_data.property80 == 0x30);
+		}
+		break;
+	case 0xB0:
+		prev = main_ctl_fan_on;
 		main_ctl_fan_on = home_air_conditioner_data.propertyB0 == 0x45;
 
 		if (prev != main_ctl_fan_on) {
 			if (main_ctl_fan_on) {
-				/* リレー出力をON */
-				if (!main_tmp_fan_on)
-					main_rly_onoff(true);
+				/* リレー出力をON/OFF */
+				main_rly_onoff(home_air_conditioner_data.property80 == 0x30);
 			}
 			else {
-				/* リレー出力をOFF */
-				if (!main_tmp_fan_on)
-					main_rly_onoff(false);
+				/* リレー出力をON/OFF */
+				main_rly_onoff(main_tmp_fan_on);
 			}
 		}
@@ -804,5 +782,5 @@
 static void main_ontimer();
 static void main_btn_ontimer();
-static void main_led_ontimer();
+static void main_lcd_ontimer();
 static void main_rly_ontimer();
 
@@ -812,17 +790,17 @@
 static void main_timeout()
 {
-	if(main_timer == 0){
+	if (main_timer == 0) {
 		main_ontimer();
 	}
 
-	if(main_btn_timer == 0){
+	if (main_btn_timer == 0) {
 		main_btn_ontimer();
 	}
 
-	if(main_led_timer == 0){
-		main_led_ontimer();
-	}
-
-	if(main_rly_timer == 0){
+	if (main_lcd_timer == 0) {
+		main_lcd_ontimer();
+	}
+
+	if (main_rly_timer == 0) {
 		main_rly_ontimer();
 	}
@@ -833,5 +811,18 @@
 static void main_ontimer()
 {
-	switch(main_state){
+	ER ret;
+
+	switch (main_state) {
+	case main_state_start:
+		/* ECHONETミドルウェアを起動 */
+		ret = ecn_sta_svc();
+		if (ret != E_OK) {
+			syslog(LOG_ERROR, "ecn_sta_svc");
+		}
+
+		/* １秒後に温度センサーを探す */
+		main_state = main_state_idle;
+		main_timer = 1000 * 1000;
+		break;
 	case main_state_idle:
 	case main_state_search:
@@ -890,5 +881,5 @@
 	/* 温度センサー検索 */
 	ret = ecn_esv_inf_req(&esv, EOBJ_NULL, 0xD6);
-	if(ret != E_OK){
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_esv_inf_req");
 		return;
@@ -897,5 +888,5 @@
 	/* 電文送信 */
 	ret = ecn_snd_esv(esv);
-	if(ret != E_OK){
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_snd_esv");
 	}
@@ -917,7 +908,7 @@
 
 	/* ボタン１の処理 */
-	if(((btn1 & 0x20) != 0) && !main_btn1_state){
+	if (((btn1 & 0x20) != 0) && !main_btn1_state) {
 		main_btn1_count++;
-		if(main_btn1_count > 10){
+		if (main_btn1_count > 10) {
 			main_btn1_count = 0;
 			main_btn1_state = true;
@@ -926,7 +917,7 @@
 		}
 	}
-	else if(((btn1 & 0x20) == 0) && main_btn1_state){
+	else if (((btn1 & 0x20) == 0) && main_btn1_state) {
 		main_btn1_count++;
-		if(main_btn1_count > 10){
+		if (main_btn1_count > 10) {
 			main_btn1_count = 0;
 			main_btn1_state = false;
@@ -937,7 +928,7 @@
 
 	/* ボタン２の処理 */
-	if(((btn2 & 0x80) != 0) && !main_btn2_state){
+	if (((btn2 & 0x80) != 0) && !main_btn2_state) {
 		main_btn2_count++;
-		if(main_btn2_count > 10){
+		if (main_btn2_count > 10) {
 			main_btn2_count = 0;
 			main_btn2_state = true;
@@ -946,7 +937,7 @@
 		}
 	}
-	else if(((btn2 & 0x80) == 0) && main_btn2_state){
+	else if (((btn2 & 0x80) == 0) && main_btn2_state) {
 		main_btn2_count++;
-		if(main_btn2_count > 10){
+		if (main_btn2_count > 10) {
 			main_btn2_count = 0;
 			main_btn2_state = false;
@@ -957,127 +948,89 @@
 }
 
-uint8_t led_num[] = { 0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xF8, 0x80, 0x90 };
-uint8_t led_onf[] = { 0xA3, 0xAB, 0x8E };
-uint8_t led_abcdef[] = { 0xF7, 0x88, 0x83, 0xC6, 0xA1, 0x86, 0x8E };
-
-static void main_led_ontimer()
-{
+static void main_lcd_ontimer()
+{
+	char power[] = "電源：off";
+	char temp1[] = "設定温度：+00℃";
+	char temp2[] = "測定温度：+00.0℃";
+	char mode[] = "運転モード：自動  ";
+	char *mode_texts[] = { "その他", "自動  ", "冷房  ", "暖房  ", "除湿  ", "送風  " };
+	char *btn_texts[] = { "none  ", "down  ", "left  ", "select", "up    ", "right " };
 	int temp;
 
-	switch(main_led_state){
-	case main_led_state_idle:
-		/* 7segに' 'を表示 */
-		sil_wrb_mem((uint8_t *)0x0008C02D, 0xFF);
-		main_led_timer = TMO_FEVR;
-		return;
-	case main_led_state_on_o:
-		/* 7segに'o'を表示 */
-		sil_wrb_mem((uint8_t *)0x0008C02D, led_onf[0]);
-		main_led_state = main_led_state_on_n;
-		break;
-	case main_led_state_on_n:
-		/* 7segに'n'を表示 */
-		sil_wrb_mem((uint8_t *)0x0008C02D, led_onf[1]);
-		main_led_state = main_led_state_space1;
-		break;
-	case main_led_state_off_o:
-		/* 7segに'o'を表示 */
-		sil_wrb_mem((uint8_t *)0x0008C02D, led_onf[0]);
-		main_led_state = main_led_state_off_f1;
-		break;
-	case main_led_state_off_f1:
-		/* 7segに'f'を表示 */
-		sil_wrb_mem((uint8_t *)0x0008C02D, led_onf[2]);
-		main_led_state = main_led_state_off_f2;
-		break;
-	case main_led_state_off_f2:
-		/* 7segに'f'を表示 */
-		sil_wrb_mem((uint8_t *)0x0008C02D, led_onf[2]);
-		main_led_state = main_led_state_space1;
-		break;
-	case main_led_state_space1:
-		/* 7segに' 'を表示 */
-		sil_wrb_mem((uint8_t *)0x0008C02D, 0xFF);
-		main_led_state = main_led_state_templ_10;
-		break;
-	case main_led_state_templ_10:
+	switch (main_lcd_state) {
+	case 0:
+		if (home_air_conditioner_data.property80 == 0x30) {
+			power[9] = 'o';
+			power[10] = 'n';
+			power[11] = ' ';
+		}
+		else {
+			power[9] = 'o';
+			power[10] = 'f';
+			power[11] = 'f';
+		}
+		lcd_drawString(&lcd, &power[9], X_LINE_HALF_TO_PIX(&lcd, 6), Y_ROW_TO_PIX(&lcd, main_lcd_state + 1), WHITE, BLACK);
+		main_lcd_state++;
+		break;
+	case 1:
+		temp1[15] = (home_air_conditioner_data.propertyB3 >= 0) ? ' ' : '-';
 		temp = (home_air_conditioner_data.propertyB3 / 10) % 10;
-		if(temp < 0)
+		if (temp < 0)
 			temp = -temp;
-		/* 7segに温度設定10の位を表示 */
-		sil_wrb_mem((uint8_t *)0x0008C02D, led_num[temp]);
-		main_led_state = main_led_state_templ_1;
-		break;
-	case main_led_state_templ_1:
+		temp1[16] = '0' + temp;
 		temp = (home_air_conditioner_data.propertyB3 / 1) % 10;
-		if(temp < 0)
+		if (temp < 0)
 			temp = -temp;
-		/* 7segに温度設定1の位を表示 */
-		sil_wrb_mem((uint8_t *)0x0008C02D, led_num[temp] & (~0x80));
-		main_led_state = main_led_state_space2;
-		break;
-	case main_led_state_space2:
-		/* 7segに' 'を表示 */
-		sil_wrb_mem((uint8_t *)0x0008C02D, 0xFF);
-		main_led_state = main_led_state_ave_templ_10;
-		break;
-	case main_led_state_ave_templ_10:
+		temp1[17] = '0' + temp;
+		lcd_drawString(&lcd, &temp1[15], X_LINE_HALF_TO_PIX(&lcd, 10), Y_ROW_TO_PIX(&lcd, main_lcd_state + 1), WHITE, BLACK);
+		main_lcd_state++;
+		break;
+	case 2:
+		temp2[15] = (main_ave_templ >= 0) ? ' ' : '-';
 		temp = (main_ave_templ / 100) % 10;
-		if(temp < 0)
+		if (temp < 0)
 			temp = -temp;
-		/* 7segに温度計測値10の位を表示 */
-		sil_wrb_mem((uint8_t *)0x0008C02D, led_num[temp]);
-		main_led_state = main_led_state_ave_templ_1;
-		break;
-	case main_led_state_ave_templ_1:
+		temp2[16] = '0' + temp;
 		temp = (main_ave_templ / 10) % 10;
-		if(temp < 0)
+		if (temp < 0)
 			temp = -temp;
-		/* 7segに温度計測値1の位を表示 */
-		sil_wrb_mem((uint8_t *)0x0008C02D, led_num[temp] & (~0x80));
-		main_led_state = main_led_state_space3;
-		break;
-	case main_led_state_space3:
-		/* 7segに' 'を表示 */
-		sil_wrb_mem((uint8_t *)0x0008C02D, 0xFF);
-		main_led_state = main_led_state_mode;
-		break;
-	case main_led_state_mode:
+		temp2[17] = '0' + temp;
+		temp = (main_ave_templ / 1) % 10;
+		if (temp < 0)
+			temp = -temp;
+		temp2[19] = '0' + temp;
+		lcd_drawString(&lcd, &temp2[15], X_LINE_HALF_TO_PIX(&lcd, 10), Y_ROW_TO_PIX(&lcd, main_lcd_state + 1), WHITE, BLACK);
+		main_lcd_state++;
+		break;
+	case 3:
 		temp = home_air_conditioner_data.propertyB0 - 0x40;
-		/* 7segに運転モードを表示 */
-		sil_wrb_mem((uint8_t *)0x0008C02D, led_abcdef[temp]);
-		main_led_state = main_led_state_space4;
-		break;
-	case main_led_state_space4:
-		if(home_air_conditioner_data.property80 == 0x30)
-			/* 7segに'.'を表示 */
-			sil_wrb_mem((uint8_t *)0x0008C02D, 0x7F);
-		else
-			/* 7segに' 'を表示 */
-			sil_wrb_mem((uint8_t *)0x0008C02D, 0xFF);
-
-		if(main_led_update){
-			main_led_update = false;
-
-			if(home_air_conditioner_data.property80 == 0x30)
-				main_led_state = main_led_state_on_o;
-			else
-				main_led_state = main_led_state_off_o;
-		}
-		else{
-			main_led_state = main_led_state_idle;
-			main_led_timer = TMO_FEVR;
-			return;
-		}
+		lcd_drawString(&lcd, mode_texts[temp], X_LINE_HALF_TO_PIX(&lcd, 12), Y_ROW_TO_PIX(&lcd, main_lcd_state + 1), WHITE, BLACK);
+		main_lcd_state++;
+		break;
+	case 4:
+	case 5:
+	case 6:
+		main_lcd_state++;
+		break;
+	case 9:
+		lcd_display(&lcd);
+		main_lcd_state = 0;
+		break;
+	case 10:
+		lcd_drawString(&lcd, "エアコン", X_LINE_TO_PIX(&lcd, 6), Y_ROW_TO_PIX(&lcd, 0), WHITE, BLACK);
+		lcd_drawString(&lcd, power, X_LINE_TO_PIX(&lcd, 0), Y_ROW_TO_PIX(&lcd, 0 + 1), WHITE, BLACK);
+		lcd_drawString(&lcd, temp1, X_LINE_TO_PIX(&lcd, 0), Y_ROW_TO_PIX(&lcd, 1 + 1), WHITE, BLACK);
+		lcd_drawString(&lcd, temp2, X_LINE_TO_PIX(&lcd, 0), Y_ROW_TO_PIX(&lcd, 2 + 1), WHITE, BLACK);
+		lcd_drawString(&lcd, mode, X_LINE_TO_PIX(&lcd, 0), Y_ROW_TO_PIX(&lcd, 3 + 1), WHITE, BLACK);
+		lcd_display(&lcd);
+		main_lcd_state = 0;
 		break;
 	default:
-		/* 7segに' 'を表示 */
-		sil_wrb_mem((uint8_t *)0x0008C02D, 0xFF);
-		main_led_state = main_led_state_idle;
-		main_led_timer = TMO_FEVR;
-		return;
-	}
-
-	main_led_timer = 500 * 1000;
+		main_lcd_state++;
+		break;
+	}
+
+	/* 100ms後にLCD表示を更新 */
+	main_lcd_timer = 100 * 1000;
 }
 
@@ -1094,9 +1047,9 @@
 
 	/* 押されて戻った時に処理する */
-	if(push)
+	if (push)
 		return;
 
 	/* 設定温度 */
-	if(main_templ > 0)
+	if (main_templ > 0)
 		main_templ--;	/* - 1℃ */
 
@@ -1105,5 +1058,5 @@
 	/* プロパティ設定電文作成 */
 	ret = ecn_esv_seti(&esv, HOME_AIR_CONDITIONER_EOBJ, 0xB3, 1, p_edt);
-	if(ret != E_OK){
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_esv_seti");
 		return;
@@ -1111,6 +1064,6 @@
 
 	/* 電文送信 */
-	ecn_snd_esv(esv);
-	if(ret != E_OK){
+	ret = ecn_snd_esv(esv);
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_snd_esv");
 	}
@@ -1127,9 +1080,9 @@
 
 	/* 押されて戻った時に処理する */
-	if(push)
+	if (push)
 		return;
 
 	/* 設定温度 */
-	if(main_templ < 50)
+	if (main_templ < 50)
 		main_templ++;	/* + 1.0℃ */
 
@@ -1138,5 +1091,5 @@
 	/* プロパティ設定電文作成 */
 	ret = ecn_esv_seti(&esv, HOME_AIR_CONDITIONER_EOBJ, 0xB3, 1, p_edt);
-	if(ret != E_OK){
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_esv_seti");
 		return;
@@ -1144,6 +1097,6 @@
 
 	/* 電文送信 */
-	ecn_snd_esv(esv);
-	if(ret != E_OK){
+	ret = ecn_snd_esv(esv);
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_snd_esv");
 	}
@@ -1152,9 +1105,9 @@
 static void main_rly_onoff(bool_t onoff)
 {
-	if(onoff){
+	if (onoff) {
 		/* リレー出力をON */
 		sil_wrb_mem((uint8_t *)0x0008C022, sil_reb_mem((uint8_t *)0x0008C022) | 0x20);
 	}
-	else{
+	else {
 		/* リレー出力をOFF */
 		sil_wrb_mem((uint8_t *)0x0008C022, sil_reb_mem((uint8_t *)0x0008C022) & ~0x20);
@@ -1182,6 +1135,5 @@
 static void main_rly_ontimer()
 {
-	switch(main_rly_state)
-	{
+	switch (main_rly_state) {
 	case main_rly_state_off:
 		main_rly_timer = TMO_FEVR;
Index: asp3_tinet_ecnl_rx/trunk/app4_aircon/src/main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app4_aircon/src/main.c	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/app4_aircon/src/main.c	(revision 364)
@@ -79,5 +79,7 @@
 
 ID ws_api_mailboxid = MAIN_DATAQUEUE;
+#ifndef NOUSE_MPF_NET_BUF
 ID ws_mempoolid = MPF_NET_BUF_256;
+#endif
 
 #ifdef IF_ETHER_BTUSB
@@ -111,7 +113,42 @@
 static void main_timeout();
 
+extern int ntshell_exit;
+
 int uart_read(char *buf, int cnt, void *extobj)
 {
-	return serial_rea_dat(SIO_PORTID, (char *)buf, cnt);
+	struct main_t *obj = (struct main_t *)extobj;
+	int result;
+	ER ret;
+	int timer;
+
+	obj->prev = obj->now;
+
+	/* タイマー取得 */
+	timer = main_get_timer();
+
+	/* 待ち */
+	ret = serial_trea_dat(SIO_PORTID, buf, cnt, timer);
+	if ((ret < 0) && (ret != E_OK) && (ret != E_TMOUT)) {
+		syslog(LOG_NOTICE, "tslp_tsk ret: %s %d", itron_strerror(ret), timer);
+		ntshell_exit = 1;
+		return -1;
+	}
+	result = (int)ret;
+
+	ret = get_tim(&obj->now);
+	if (ret != E_OK) {
+		syslog(LOG_NOTICE, "get_tim ret: %s", itron_strerror(ret));
+		ntshell_exit = 1;
+		return -1;
+	}
+
+			/* 時間経過 */
+	int elapse = obj->now - obj->prev;
+	main_progress(elapse);
+
+	/* タイムアウト処理 */
+	main_timeout();
+
+	return result;
 }
 
@@ -119,19 +156,4 @@
 {
 	return serial_wri_dat(SIO_PORTID, buf, cnt);
-}
-
-unsigned char ntstdio_xi(struct ntstdio_t *handle)
-{
-	char buf[1];
-	if(serial_rea_dat(SIO_PORTID, buf, 1) != 1)
-		return -EIO;
-	return buf[0];
-}
-
-void ntstdio_xo(struct ntstdio_t *handle, unsigned char c)
-{
-	char buf[1];
-	buf[0] = c;
-	serial_wri_dat(SIO_PORTID, buf, 1);
 }
 
@@ -150,5 +172,5 @@
 	main_initialize();
 
-	ntshell_init(&ntshell, uart_read, uart_write, cmd_execute, NULL);
+	ntshell_init(&ntshell, uart_read, uart_write, cmd_execute, &main_obj);
 	ntshell_set_prompt(&ntshell, "NTShell>");
 	ntshell_execute(&ntshell);
@@ -168,5 +190,10 @@
 	ER ret;
 
-	ntshell_task_init();
+#ifdef TOPPERS_OMIT_TECS
+	serial_opn_por(SIO_PORTID);
+#endif
+	serial_ctl_por(SIO_PORTID, IOCTL_FCSND | IOCTL_FCRCV);
+
+	ntshell_task_init(uart_read, uart_write, &main_obj);
 
 	main_obj.timer = TMO_FEVR;
Index: asp3_tinet_ecnl_rx/trunk/app4_aircon/src/main.cfg
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app4_aircon/src/main.cfg	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/app4_aircon/src/main.cfg	(revision 364)
@@ -54,5 +54,4 @@
 INCLUDE("tinet/tinet_asp.cfg");
 INCLUDE("tinet_main.cfg");
-INCLUDE("netinet/ip_igmp.cfg");
 
 /* DHCP クライアント */
@@ -77,4 +76,7 @@
 INCLUDE("ffarch.cfg");
 
+/* mbed */
+INCLUDE("mbed_api.cfg");
+
 #ifdef IF_ETHER_BTUSB
 INCLUDE("usb_hbth.cfg");
