Removed all non-supported and uncontrolled source code. Please refer to CVS version "Before_..." to see old code.
authoretisserant
Tue, 13 Feb 2007 18:06:18 +0100
changeset 93 16c8ceea8f18
parent 92 0d84d95790d9
child 94 bdf4c86be6b2
Removed all non-supported and uncontrolled source code. Please refer to CVS version "Before_..." to see old code.
configure
drivers/Makefile.in
drivers/can_socket/Makefile.in
drivers/can_virtual/Makefile.in
drivers/ecos_lpc2138_sja1000/Makefile.in
drivers/ecos_lpc2138_sja1000/ReadMe.txt
drivers/ecos_lpc2138_sja1000/applicfg.h
drivers/ecos_lpc2138_sja1000/build_baudrate.c
drivers/ecos_lpc2138_sja1000/canOpenDriver.c
drivers/ecos_lpc2138_sja1000/lpc2138.c
drivers/ecos_lpc2138_sja1000/lpc2138.h
drivers/ecos_lpc2138_sja1000/lpc2138_defs.h
drivers/ecos_lpc2138_sja1000/lpc2138_pinout.h
drivers/ecos_lpc2138_sja1000/notes.txt
drivers/ecos_lpc2138_sja1000/nvram.h
drivers/ecos_lpc2138_sja1000/nvram_iap.c
drivers/ecos_lpc2138_sja1000/nvram_iap.h
drivers/ecos_lpc2138_sja1000/nvram_readme
drivers/ecos_lpc2138_sja1000/sja1000.c
drivers/ecos_lpc2138_sja1000/sja1000.h
drivers/ecos_lpc2138_sja1000/time_slicer.c
drivers/ecos_lpc2138_sja1000/time_slicer.h
drivers/ecos_lpc2138_sja1000/timerscfg.h
drivers/led_stdout/.cvsignore
drivers/led_stdout/Makefile.in
drivers/led_stdout/led_stdout.c
drivers/nvram_file/nvram_file.c
drivers/unix/Makefile.in
examples/AppliMaster_HCS12/Makefile.in
examples/AppliMaster_HCS12/appli.c
examples/AppliMaster_HCS12/objdict.c
examples/AppliMaster_HCS12/objdict.html
examples/AppliMaster_HCS12/objdict.xml
examples/AppliMaster_HCS12/trace32_flash_debug.cmm
examples/AppliMaster_HCS12/trace32_flash_debug_sans_init.cmm
examples/AppliMaster_HCS12/trace32_flash_programmer.cmm
examples/AppliMaster_HCS12/vectors.s
examples/AppliMaster_Linux/.cvsignore
examples/AppliMaster_Linux/Makefile.in
examples/AppliMaster_Linux/appli.c
examples/AppliMaster_Linux/objdict.c
examples/AppliMaster_Linux/objdict.html
examples/AppliMaster_Linux/objdict.xml
examples/AppliSlave_HCS12/Makefile.in
examples/AppliSlave_HCS12/appli.c
examples/AppliSlave_HCS12/objdict.c
examples/AppliSlave_HCS12/objdict.html
examples/AppliSlave_HCS12/objdict.xml
examples/AppliSlave_HCS12/trace32_flash_debug.cmm
examples/AppliSlave_HCS12/trace32_flash_debug_sans_init.cmm
examples/AppliSlave_HCS12/trace32_flash_programmer.cmm
examples/AppliSlave_HCS12/vectors.s
examples/AppliSlave_Linux/.cvsignore
examples/AppliSlave_Linux/Makefile.in
examples/AppliSlave_Linux/appli.c
examples/AppliSlave_Linux/objdict.c
examples/AppliSlave_Linux/objdict.html
examples/AppliSlave_Linux/objdict.xml
examples/TestMasterSlave/TestMaster.c
examples/TestMasterSlave/TestSlave.c
examples/ecos_lpc2138_sja1000/README
examples/ecos_lpc2138_sja1000/src/Makefile.in
examples/ecos_lpc2138_sja1000/src/elevation/encoder/6FX2001-5SS12.jpg
examples/ecos_lpc2138_sja1000/src/elevation/encoder/ReadMe.txt
include/led.h
include/led_driver.h
include/lss.h
include/nvram.h
include/nvram_driver.h
objdictgen/objdictgen.py
src/Makefile.in
src/led.c
src/lss.c
src/nvram.c
--- a/configure	Tue Feb 13 17:21:19 2007 +0100
+++ b/configure	Tue Feb 13 18:06:18 2007 +0100
@@ -96,8 +96,6 @@
 	--prefix=*)	SUB_PREFIX=$optarg;;
 	--target=*)	SUB_TARGET=$optarg;;
 	--can=*)	SUB_CAN_DRIVER=$optarg;;
-	--led=*)	SUB_LED_DRIVER=$optarg;;
-	--nvram=*)	SUB_NVRAM_DRIVER=$optarg;;
 	--timers=*)	SUB_TIMERS_DRIVER=$optarg;;
 	--disable-Ox)	DISABLE_OPT=1;
 			echo "On user request: Won't optimize with \"-Ox\"";;
@@ -105,8 +103,6 @@
 			echo "Debug messages enabled !!";;
 	--debugPDO)	DEBUG=PDO;
 			echo "Debug messages (PDO) enabled !!";;
-	--enable-lss)	SUB_LSS_ENABLE=YES;
-			echo "On user request: Will enable Auto Baudrate detect Feature";;
 	--desable-timers)	SUB_TIMERS_ENABLE=NO;
 			echo "On user request: Will enable built-in timer dispatch Feature";;
 	--MAX_CAN_BUS_ID=*)	MAX_CAN_BUS_ID=$1;;
@@ -127,15 +123,11 @@
 		echo	"		\"unix\" for unix-like systems"
 		echo	"		\"win32\" for win32 systems"
 		echo	"		\"hcs12\" for HCS12 micro-controller"
-		echo	"		\"ecos_lpc2138_sja1000\" for eCOS + Philips ARM LPC21381 + Philips SJA1000" 
 		echo 	" --can=foo	Use 'foo' as CAN driver (can be either 'peak', 'lincan' or 'virtual')"
 		echo 	" --timers=foo	Use 'foo' as TIMERS driver (can be either 'unix' or 'xeno')"
-		echo	" --led=foo	Use 'foo' as DS-305 LED driver (use 'none' to disable or 'stdout')"
-		echo	" --nvram=foo	Use 'foo' as NVRAM driver (use 'none' to disable or 'file')"
 		echo	" --disable-Ox	Disable gcc \"-Ox\" optimizations."
 		echo	" --debug	Enable debug messages."
 		echo	" --debugPDO	Enable debug messages, using PDO."
-		echo	" --enable-lss	Enable Auto Baudrate detect Feature"
 		echo
 		echo	"Stack compilation constants"
 		echo	" --MAX_CAN_BUS_ID [=1] Number of can bus to use"
@@ -354,16 +346,6 @@
 	fi
 fi
 
-if [ "$SUB_TARGET" = "unix" -a "$SUB_LED_DRIVER" = "" ]; then
-	echo "Choosing stdout LED driver."
-	SUB_LED_DRIVER=stdout
-fi
-
-if [ "$SUB_TARGET" = "unix" -a "$SUB_NVRAM_DRIVER" = "" ]; then
-	echo "Choosing binary file NVRAM driver. -- not implemented --"
-#	SUB_NVRAM_DRIVER=file
-fi
-
 # If target is unix, default timers also
 if [ "$SUB_TARGET" = "unix" -a "$SUB_TIMERS_DRIVER" = "" ]; then
 	echo "Choosing unix timers driver."
@@ -415,25 +397,6 @@
 	fi
 fi	
 
-if [ "$SUB_TARGET" = "ecos_lpc2138_sja1000" ]; then
-	# search for gcc arm compiler arm-elf-gcc or arm-elf-gcc ?
-	if [ "$CC" = "" ]; then
-		which arm-elf-gcc >/dev/null 2>&1
-		if (( $? )); then 
-			echo "error : Could not find arm-elf-gcc"
-		else
-			CC=arm-elf-gcc
-			SUB_PROG_CFLAGS="-mcpu=arm7tdmi -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Os \
-                        -ffunction-sections -fdata-sections -fno-exceptions -finline-functions"
-		fi
-	fi
-	# ecos sja1000 driver implements calls needed by LSS.
-	SUB_LSS_ENABLE=YES
-	SUB_LED_ENABLE=YES
-	SUB_NVRAM_ENABLE=YES
-fi
-
-
 #### CAN_DRIVER ####
 
 if [ "$SUB_CAN_DRIVER" = "peak" ]; then
@@ -491,36 +454,6 @@
 	SUB_TIMERS_DRIVER=
 fi
 
-#### LED_DRIVER ####
-#enable led support if a led driver have been selected.
-if [ "$SUB_LED_DRIVER" != "" ]; then
-	SUB_LED_ENABLE=YES
-fi
-#if "none" driver is selected led feature is enabled but driver not compiled
-if [ "$SUB_LED_DRIVER" = "none" ]; then
-	SUB_LED_DRIVER=
-fi
-#if "disable" driver is selected led feature is disabled
-if [ "$SUB_LED_DRIVER" = "disable" ]; then
-	SUB_LED_ENABLE=
-	SUB_LED_DRIVER=
-fi
-
-#### NVRAM_DRIVER ####
-#enable nvram support if a nvram driver have been selected.
-if [ "$SUB_NVRAM_DRIVER" != "" ]; then
-	SUB_NVRAM_ENABLE=YES
-fi
-#if "none" driver is selected nvram feature is enabled but driver not compiled
-if [ "$SUB_NVRAM_DRIVER" = "none" ]; then
-	SUB_NVRAM_DRIVER=
-fi
-#if "disable" driver is selected nvram feature is disabled
-if [ "$SUB_NVRAM_DRIVER" = "disable" ]; then
-	SUB_NVRAM_ENABLE=
-	SUB_NVRAM_DRIVER=
-fi
-
 ###########################################################################
 #                              GUESS COMPILER                             #
 ###########################################################################
@@ -691,38 +624,19 @@
 \	drivers/can_$SUB_CAN_DRIVER/Makefile.in
 fi
 
-if [ "$SUB_LED_DRIVER" != "" ]; then
-	MAKEFILES=$MAKEFILES\
-\	drivers/led_$SUB_LED_DRIVER/Makefile.in
-fi
-
-if [ "$SUB_NVRAM_DRIVER" != "" ]; then
-	MAKEFILES=$MAKEFILES\
-\	drivers/nvram_$SUB_NVRAM_DRIVER/Makefile.in
-fi
-
 # Target dependent Makefiles
 MAKEFILES=$MAKEFILES\ drivers/$SUB_TARGET/Makefile.in
 
 if [ "$SUB_TARGET" = "unix" ]; then
 	MAKEFILES=$MAKEFILES\
-\	examples/AppliMaster_Linux/Makefile.in\
-\	examples/AppliSlave_Linux/Makefile.in\
 \	examples/TestMasterSlave/Makefile.in
 fi
 
 if [ "$SUB_TARGET" = "hcs12" ]; then
 	MAKEFILES=$MAKEFILES\
-\	examples/AppliMaster_HCS12/Makefile.in\
-\	examples/AppliSlave_HCS12/Makefile.in\
 \	examples/gene_SYNC_HCS12/Makefile.in
 fi
 
-if [ "$SUB_TARGET" = "ecos_lpc2138_sja1000" ]; then
-	MAKEFILES=$MAKEFILES\
-\	examples/ecos_lpc2138_sja1000/src/Makefile.in
-fi
-
 for makefile_in in $MAKEFILES; do
 	makefile=`echo $makefile_in | sed 's:.in$::'`
 	echo "Creating $makefile"
@@ -736,14 +650,9 @@
 	s:SUB_OPT_CFLAGS:${SUB_OPT_CFLAGS}:
 	s:SUB_TARGET:${SUB_TARGET}:
 	s:SUB_BINUTILS_PREFIX:${SUB_BINUTILS_PREFIX}:
-	s:SUB_LSS_ENABLE:${SUB_LSS_ENABLE}:
-	s:SUB_LED_ENABLE:${SUB_LED_ENABLE}:
-	s:SUB_NVRAM_ENABLE:${SUB_NVRAM_ENABLE}:
 	s:SUB_TIMERS_ENABLE:${SUB_TIMERS_ENABLE}:
 	s:SUB_TIMERS_DRIVER:timers_${SUB_TIMERS_DRIVER}:
 	s:SUB_CAN_DRIVER:can_${SUB_CAN_DRIVER}:
-	s:SUB_LED_DRIVER:led_${SUB_LED_DRIVER}:
-	s:SUB_NVRAM_DRIVER:nvram_${SUB_NVRAM_DRIVER}:
 	" > $makefile
 done
 
--- a/drivers/Makefile.in	Tue Feb 13 17:21:19 2007 +0100
+++ b/drivers/Makefile.in	Tue Feb 13 18:06:18 2007 +0100
@@ -24,19 +24,10 @@
 TARGET = SUB_TARGET
 CAN_DRIVER = SUB_CAN_DRIVER
 TIMERS_DRIVER = SUB_TIMERS_DRIVER
-LED_DRIVER = SUB_LED_DRIVER
-NVRAM_DRIVER = SUB_NVRAM_DRIVER
 
 all: driver
 
 driver:
-ifneq ($(LED_DRIVER),led_)
-	$(MAKE) -C $(LED_DRIVER) $@
-endif
-
-ifneq ($(NVRAM_DRIVER),nvram_)
-	$(MAKE) -C $(NVRAM_DRIVER) $@
-endif
 
 ifneq ($(TIMERS_DRIVER),timers_)
 	$(MAKE) -C $(TIMERS_DRIVER) $@
@@ -48,13 +39,6 @@
 	$(MAKE) -C $(TARGET) $@
 
 install:
-ifneq ($(LED_DRIVER),led_)
-	$(MAKE) -C $(LED_DRIVER) $@
-endif
-
-ifneq ($(NVRAM_DRIVER),nvram_)
-	$(MAKE) -C $(NVRAM_DRIVER) $@
-endif
 
 ifneq ($(TIMERS_DRIVER),timers_)
 	$(MAKE) -C $(TIMERS_DRIVER) $@
@@ -66,13 +50,6 @@
 	$(MAKE) -C $(TARGET) $@
 
 uninstall:
-ifneq ($(LED_DRIVER),led_)
-	$(MAKE) -C $(LED_DRIVER) $@
-endif
-
-ifneq ($(NVRAM_DRIVER),nvram_)
-	$(MAKE) -C $(NVRAM_DRIVER) $@
-endif
 
 ifneq ($(TIMERS_DRIVER),timers_)
 	$(MAKE) -C $(TIMERS_DRIVER) $@
@@ -84,13 +61,6 @@
 	$(MAKE) -C $(TARGET) $@
 
 clean:
-ifneq ($(LED_DRIVER),led_)
-	$(MAKE) -C $(LED_DRIVER) $@
-endif
-
-ifneq ($(NVRAM_DRIVER),nvram_)
-	$(MAKE) -C $(NVRAM_DRIVER) $@
-endif
 
 ifneq ($(TIMERS_DRIVER),timers_)
 	$(MAKE) -C $(TIMERS_DRIVER) $@
@@ -102,13 +72,6 @@
 	$(MAKE) -C $(TARGET) $@
 
 mrproper: clean
-ifneq ($(LED_DRIVER),led_)
-	$(MAKE) -C $(LED_DRIVER) $@
-endif
-
-ifneq ($(NVRAM_DRIVER),nvram_)
-	$(MAKE) -C $(NVRAM_DRIVER) $@
-endif
 
 ifneq ($(TIMERS_DRIVER),timers_)
 	$(MAKE) -C $(TIMERS_DRIVER) $@
--- a/drivers/can_socket/Makefile.in	Tue Feb 13 17:21:19 2007 +0100
+++ b/drivers/can_socket/Makefile.in	Tue Feb 13 18:06:18 2007 +0100
@@ -53,6 +53,6 @@
        rm -f $(TARGET_HFILES)
 
 clean:
-       -\rm $(OBJS)
+       rm -f $(OBJS)
 
 mrproper: clean
--- a/drivers/can_virtual/Makefile.in	Tue Feb 13 17:21:19 2007 +0100
+++ b/drivers/can_virtual/Makefile.in	Tue Feb 13 18:06:18 2007 +0100
@@ -58,6 +58,6 @@
 	rm -f $(TARGET_HFILES)
 
 clean:
-	rm $(OBJS)
+	rm -f $(OBJS)
 
 mrproper: clean
--- a/drivers/ecos_lpc2138_sja1000/Makefile.in	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-#! gmake
-
-#
-# Copyright (C) 2006 OREMEQ
-# 
-# This file is part of canfestival, a library implementing the canopen
-# stack
-# 
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-# 
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-# 
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-# 
-
-CC = SUB_CC
-OPT_CFLAGS = SUB_OPT_CFLAGS
-CFLAGS = 
-PROG_CFLAGS = SUB_PROG_CFLAGS
-LIBS = -lm
-SHAREDLIBOPT = -shared
-OS_NAME = SUB_OS_NAME
-ARCH_NAME = SUB_ARCH_NAME
-PREFIX = SUB_PREFIX
-TARGET = SUB_TARGET
-INCLUDES = -I../../include -I../../examples/ecos_lpc2138_sja1000/include
-
-ECOS_GLOBAL_CFLAGS=-mcpu=arm7tdmi -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Os -ffunction-sections -fdata-sections -fno-exceptions -finline-functions
-ECOS_GLOBAL_LDFLAGS=-mcpu=arm7tdmi -Wl,--gc-sections -Wl,-static -nostdlib
-
-export CAN_CONTROLER_CLOCK_SPEED := 24.000   # Crystal frequency of the SJA1000 clock input.
-export CAN_CONTROLER_PHASE_SHIFT_TOLERANCE := 3  #Synchronization Jump Width (SJW) (in SJA1000==> 0..3)
-                                                          #To compensate for phase shifts between
-                                                          #clock oscillators of different bus
-                                                          # controllers, any bus controller must
-                                                          #re-synchronize on any relevant signal
-                                                          #edge of the current transmission.
-
-
-OBJS = canOpenDriver.o lpc2138.o sja1000.o time_slicer.o
-INCLUDE_H = applicfg.h baudrate_table.h canOpenDriver.h lpc2138.h lpc2138_defs.h \
-lpc2138_pinout.h sja1000.h time_slicer.h
-
-all: driver
-
-driver: build_baudrate $(OBJS)
-
-build_baudrate:
-	gcc -o build_baudrate build_baudrate.c
-	@echo "Generate The baudrate register structure in canControler.h regarding the"
-	@echo "SJA1000 clock speed defined in the Makefile, CAN_CONTROLER_CLOCK_SPEED"
-	./build_baudrate $(CAN_CONTROLER_CLOCK_SPEED) $(CAN_CONTROLER_PHASE_SHIFT_TOLERANCE)
-
-
-libcandriver.a: $(OBJS)
-	@echo " "
-	@echo "*********************************************"
-	@echo "**Building [libcandriver]"
-	@echo "*********************************************"
-	$(BINUTILS_PREFIX)ar rc $@ $(OBJS)
-	$(BINUTILS_PREFIX)ranlib $@
-
-%o: %c
-	@echo " "
-	@echo "*********************************************"
-	@echo "**Compiling $< -> $@"
-	@echo "*********************************************"
-	$(CC) -g -c $(ECOS_GLOBAL_CFLAGS) $(INCLUDES) -I. -c -o $@ $<
-
-%o: %s
-	@echo " "
-	@echo "*********************************************"
-	@echo "**Compiling $< -> $@"
-	@echo "*********************************************"
-	$(CC)  -c -x assembler-with-cpp $(ECOS_GLOBAL_CFLAGS) $(INCLUDES) -I. -o $@ $<
-
-install:
-	mkdir -p $(PREFIX)/lib
-	ln -s ../../../drivers/ecos_lpc2138_sja1000 $(PREFIX)/lib/driver
-
-uninstall:
-	rm -f ../../examples/ecos_lpc2138_sja1000/lib/driver
-
-clean:
-	rm -f $(OBJS) build_baudrate baudrate_table.h 
-
-mrproper: clean
-	rm -f ../../lib/ecos_lpc2138_sja1000/libcandriver.a 
-
--- a/drivers/ecos_lpc2138_sja1000/ReadMe.txt	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,247 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack.
-  ____    _    _   _
- / ___|  / \  | \ | | ___  _ __   ___ _ __
-| |     / _ \ |  \| |/ _ \| '_ \ / _ \ '_ \
-| |___ / ___ \| |\  | (_) | |_) |  __/ | | |
- \____/_/   \_\_| \_|\___/| .__/ \___|_| |_|
-                          |_|
-          ____                      _
-         / ___|__ _ _ __   __ _  __| | __ _
-        | |   / _` | '_ \ / _` |/ _` |/ _` |
-        | |__| (_| | | | | (_| | (_| | (_| |
-         \____\__,_|_| |_|\__,_|\__,_|\__,_|
-
-                   canfestival@canopencanada.ca
-/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MARKETING or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-
-CanFestival driver for the Philips ARM7 model LPC2138 , with a Philips
-SJA1000 CAN controler, and running on the eCOS operating system.
-
-Driver Features:
-Full CANfestival-3 support including:
-DS-150/205: CAN Power Management Layer specification (sleep/wake-up)
-DS-201: CAN low level layer
-DS-301: CANopen Application layer and Communication Profile (basic CANopen specification)
-DS-303-1: LED diagnostic usage (led.c)
-DS-305: Layer Setting Service (lss.c) to set the baudrateand node ID in a PnP fashion.
-NVRAM: Non Volatil Ram (nvram.c) Full support for internal Philips IAT programming FLASH mode
-
-
-To use this driver, you need to proceed to do all these steps.
-NB: We choose to leave this driver in .o object code to keep the capability
-to make on-the-fly redefinition of some parameters for all examples.
-
-Step 1
------------
-Have a developpement workstation. To build everything, we chose to use
-an old AMD K6/2-300Mhz running with FreeBSD-5.2-RELEASE freely available
-at http://www.freebsd.org/.
-To install freebsd, download the two floppy images from
-ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/5.2-RELEASE/floppies
-and copy them to a simple floppy disk by typeing:
-	dd if=./image.dd of=/dev/fd0
-	dd if=./image2.dd of=/dev/fd0
-and proceed to boot on them.
-You can use Linux or Windows also or any other O/S where you can use GCC.
-
-on FreeBSD, you need to configure the serial port by editing the /etc/rc/serial
-config file by adding this entry:
-
-lpc2000 () {
-        # Philips LPC2000 serial port configuration for 57600 bauds connection.
-
-        ci=$1; shift
-        co=$1; shift
-
-        for i in $*
-        do
-                # Lock clocal on, hupcl off.
-                # XON-XOFF printer
-                stty < /dev/ttyi${ci}${i} clocal -hupcl ixon -imaxbel -ixany -ixoff -crtscts 57600
-                stty < /dev/ttyl${ci}${i} clocal  hupcl
-                stty < /dev/cuai${co}${i} clocal -hupcl ixon -imaxbel -ixany -ixoff -crtscts 57600
-                stty < /dev/cual${co}${i} clocal  hupcl
-        done
-}
-
-###############
-lpc2000		d a 0 1  # to configure COM1 and COM2, mean, /dev/cuaa0 and /dev/cuaa1
-###############
-
-Step 2
------------
-Find an upload tool to be able to flash the LPC2138.
-We found the lpc2isp at the address: 
-
-	http://guest.engelschall.com/~martin/lpc21xx/isp/index.html
-
- You can use this upload script to call it with proper arguments.
-
-#!/bin/sh
-lpc21isp -term -control build/terminal.hex /dev/cuaa1 57600 14746
-
-
-Step 3
------------
-Proceed to build a GCC cross compiler to be able to produce ARM7TDMI compatible
-binary. Go to the port directory of your FreeBSD
-
-	cd /usr/ports/devel/arm-elf-binutils
-	gmake install
-
-	cd /usr/ports/devel/arm-elf-gcc295
-	gmake install
-
-And add the installation binary PATH to your environment variables. 
-
-	cd /etc
-	vi profile
-
-		export PATH=$PATH:/usr/local/armelf/bin
-
-
-Step 4
------------
-Build an eCOS tree for the LPC2138.
-Download eCOS from  http://www.ecoscentric.com  and proceed to compile
-the configtool program.  
-
-	cd /usr/ports/devel/ecos-tools/
-	gmake install
-
-	untar our special package for eCOS named  eCOS-OLIMEX-p2138.tgz in 
-	the eCOS three on your files system.
-
-Start now your configtool for eCOS:
-	configtool 
-
-Choose the right target 
-For our purpose, we choose to use an OLIMEX P2138 target board.
-This target is not in the list, we created it from a derivative of
-the OLIMEX P2106. We simply selected an other processor in the pulldown menu
-of the configtool. The LPC2138. Adjust some memory capacity, and that's it.
-
-When all you need is properly selected in the configtool, you click on
-Save_As and you suggest a name like My2138. 
-After, you click on Generate Build Tree.
-	cd My2138_build
-	gmake depend
-	gmake
-	gmake install
- And now you have you own eCOS tree for your project in  My2138_install
-
-Step 5
------------
-Prepare the hardware board for this project. We chose to use an
-http://www.olimex.com/  board, the P2138.
-Any other LPC2138 evaluation could made the job.
-On the P2138 board, we have a little area that we can use to solder
-the SJA1000 controler.
-See can_controler.gif to know how to solder all wires.
-
-Warning: If you want to use different GPIO (General Purpose Input Output)
-pin to fit with your own project, 
-you can choose a different one, but you need
-to be sure to properly define then in the lpc2138_pinout.h
-
-Step 6
------------
-Put the CANfestival-3.tar.gz stuff in My2138_install/src/CANfestival-3
-	cd My2138_install/src/CANfestival-3
-	./configure target=ecos-lpc2138-sja1000
-	gmake
-	cd My2138_install/lib
-	ln -s My2138_install/src/CANfestival-3/src/libcanfestival.a
-	cd My2138_install/src 
-	ln -s My2138_install/src/CANfestival-3/driver/ecos-lpc2138-sja1000
-
-Step 7
------------
-Now you are ready to build our demo.
-  cd My2138_install/src/CANfestival-3/examples/DS-406Master_ecos
-	gmake
-
-  cd My2138_install/src/CANfestival-3/examples/TerminalSlave_ecos
-	gmake
-Step 8
------------
-To test, upload both .hex file to both targets with lpc21isp and
-see the DS-406 absolut rotary encoder transmiting his absolute value to the
-terminal.
-
-	For more info about this project, see http://www.oremeq.qc.ca/
-Step 9
------------
-For your own project, you can copy all the examples files in your own
-directory and modify them.
-
-What is important to understand is:
-
-driver/ecos_lpc2138_sja1000:
-
-	build_baudrate.c is a commande line tool to generate the proper
-		timing file for your sja1000 regarding your sja1000 clk.
-			see the Makefile for adjustment.
-
-	canOpenDriver.c is the only link between the libcanfestival and
-		the hardware.
-			f_can_send
-			f_can_receive
-			interrupts
-			nvram_save/load
-			baudrate
-
-	eCOS-OLIMEX-p2138.tgz  eCOS package for the OLIMEX p2138 evaluation board
-		you have to untar that files in your eCOS three.
-		
-	sja1000.c containe only function for initialization or 
-		configuration of the CAN controler. All this stuff is
-		_not_ use by the libcanfestival. You have to call them
-		from your main() to enable CAN with your needed configuration.
-
-		hardware init 
-			
-	lpc2138.c All the basic stuff to run the LPC2138
-		iat_flash  user programmable internal flash of the lpc2138
-
-	lpc2138_pinout.h  Is your LPC2138 pinout definition. Modify this file
-		if you want to redefine your pinout affectation.
-
-	time_slicer.c  eCOS implementation of the CANfestival scheduler.
-		settimer
-		alarm
-
-	applicfg.h is your configuration file for the libcanfestival
-
-	lpc2138_pinout.h define all your GPIO to fit macros.
-
-
-objdictedit:
-	Objdictedit  will produce the dictionary.
-	Generate your dictionnary. (Or use an already made YourFile.od with
-	the tool: objdictgen.py
-	The job is to implement all functions define in the YourFIle.c in
-		your own project files.
-
-Enjoye!!!!	
-		Canopen Canada core team
-		canfestival@canopencanada.ca
--- a/drivers/ecos_lpc2138_sja1000/applicfg.h	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack. 
-
-Copyright (C): Edouard TISSERANT and Francis DUPIN
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#ifndef __APPLICFG_ECOS__
-#define __APPLICFG_ECOS__
-
-#include <string.h>
-#include <stdio.h>
-
-// Define the architecture : little_endian or big_endian
-// -----------------------------------------------------
-// Test :
-// UNS32 v = 0x1234ABCD;
-// char *data = &v;
-//
-// Result for a little_endian architecture :
-// data[0] = 0xCD;
-// data[1] = 0xAB;
-// data[2] = 0x34;
-// data[3] = 0x12;
-//
-// Result for a big_endian architecture :
-// data[0] = 0x12;
-// data[1] = 0x34;
-// data[2] = 0xAB;
-// data[3] = 0xCD;
-
-// Integers
-#define INTEGER8 char
-#define INTEGER16 short
-#define INTEGER24
-#define INTEGER32 long
-#define INTEGER40
-#define INTEGER48
-#define INTEGER56
-#define INTEGER64
-
-// Unsigned integers
-#define UNS8   unsigned char
-#define UNS16  unsigned short
-#define UNS32  unsigned long
-#define UNS24
-#define UNS40
-#define UNS48
-#define UNS56
-#define UNS64 
-
-// Time unit : us
-// Time resolution : 32bits
-#define TIMEVAL unsigned int 
-#define TIMEVAL_MAX 0xffff
-#define MS_TO_TIMEVAL(ms) ms*1000
-#define US_TO_TIMEVAL(us) us
-
-#define HANDLE	int
-
-#if !defined(CAN_HANDLE)
-#define CAN_HANDLE  void*
-#endif
-
-// Reals
-#define REAL32	float
-#define REAL64 double
-
-/// Definition of error and warning macros
-// --------------------------------------
-#if defined DEBUG_ERR_CONSOLE_ON || defined DEBUG_WAR_CONSOLE_ON
-#include <stdio.h>
-#endif
-
-/// Definition of MSG_ERR
-// ---------------------
-#ifdef DEBUG_ERR_CONSOLE_ON
-#    define MSG_ERR(num, str, val)            \
-          printf("%s,%d : 0X%x %s 0X%x \n",__FILE__, __LINE__,num, str, val);
-#else
-#    define MSG_ERR(num, str, val)
-#endif
-
-/// Definition of MSG_WAR
-// ---------------------
-#ifdef DEBUG_WAR_CONSOLE_ON
-#    define MSG_WAR(num, str, val)          \
-          printf("%s,%d : 0X%x %s 0X%x \n",__FILE__, __LINE__,num, str, val);
-#else
-#    define MSG_WAR(num, str, val)
-#endif
-
-#endif
--- a/drivers/ecos_lpc2138_sja1000/build_baudrate.c	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-
-/*
-	CiA DS-301, p.20
-*/
-#define MAX_BIT_TIMING 9
-int table_bit_timing_settings[MAX_BIT_TIMING][3] =
-{
-	{1000, 8, 6}, /* baudrate, number of time quanta per bit, tsync+tseg1 */
-	{800, 10, 8},
-	{500, 16, 14},
-	{250, 16, 14},
-	{125, 16, 14},
-	{100, 16, 14},
-	{ 50, 16, 14},
-	{ 25, 16, 14},
-	{ 10, 16, 14}
-};
-
-
-void can_timing_registers(double f, int *v)
-/* fill the vector v with the proper setting for TIMER 0 and TIMER 1
-   regarding the clock and the baudrate */
-{
-	int i;
-
-	int BRP, TSEG1, TSEG2;
-
-	double nominal, tq, tscl;
-
-	double tclk = 1 / (f*1e6); /* sec */
-
-	for(i=0; i<MAX_BIT_TIMING; i++)
-	{
-		nominal = 1. / (table_bit_timing_settings[i][0]*1e3); /* nominal bit time */
-
-		tq = nominal / table_bit_timing_settings[i][1]; /* time quanta */
-
-		tscl = tq; /* Tsyncseg = Tscl (ref. SJA 1000 datasheet, p.51) */
-
-		/* tcsl = 2 tclk (BRP + 1) */
-		BRP = (int)(tscl / (2. * tclk) - 1.);
-
-		/* 
-			BRT0 = SJW * 64 + BRP 
-			SJW : synchonisation jump Width, user defined (0..3)
-		*/
-
-		/* tseg1 = tscl * (TSEG1 + 1) */
-		TSEG1 = (int)((table_bit_timing_settings[i][2] - 1)*tq/tscl - 1.);
-
-		/* tseg2 = tscl * (TSEG2 + 1) */
-		TSEG2 = (int)(2.*tq/tscl - 1.);
-
-		/*
-			BRT1 = SAM*128 + TSEG2*16 + TSEG1
-			SAM = Sampling (0 = single sampling, 1 = triple sampling)
-		*/
-
-		if (BRP < 64)
-		{
-			v[2*i] = BRP;
-			v[2*i+1] = TSEG1+16*TSEG2;
-		}
-		else
-		{
-			v[2*i] = 0;
-			v[2*i+1] = 0;
-		}
-	}
-}
-
-
-void print_header(double frequency, /* clock rate in MHz*/
-                  int    sjw)       /* 0..3 */
-{
-	int i, array[18];
-	FILE *f = fopen("baudrate_table.h", "w");
-
-	can_timing_registers(frequency, array);
-
-	fprintf(f, "#if !defined(_BAUDRATE_TABLE_H_)\n");
-	fprintf(f, "#define _BAUDRATE_TABLE_H_\n");
-	fprintf(f, "\n");
-	fprintf(f, "/*\n");
-	fprintf(f, "this file must be include only once in the project\n");
-	fprintf(f, "*/\n");
-	fprintf(f, "\n");
-	fprintf(f, "/* clock speed in MHz */\n");
-	fprintf(f, "#define CAN_CONTROLER_CLOCK_SPEED %.3lf\n", frequency);
-	fprintf(f, "#define CAN_CONTROLER_PHASE_SHIFT_TOLERANCE %d\n", sjw);
-
-	sjw = sjw << 6;
-
-	fprintf(f, "\n");
-	fprintf(f, "static int can_baudrate_registers[9][3] =\n");
-	fprintf(f, "{  /* BTR0    BTR1 */\n");
-
-	for(i=0; i<MAX_BIT_TIMING; i++)
-	{
-		if (array[2*i] == 0  && array[2*i+1] == 0)
-			fprintf(f, "    {0, 0x00, 0x00}, /* %4d kbits/s -- out of range*/\n", 
-				table_bit_timing_settings[i][0]);
-		else
-			fprintf(f, "    {1, 0x%02x, 0x%02x}, /* %4d kbits/s */\n", 
-				sjw|array[2*i], array[2*i+1],
-				table_bit_timing_settings[i][0]);
-	}
-
-	fprintf(f, "};\n");
-	fprintf(f, "\n");
-	fprintf(f, "#endif\n\n");
-
-	fclose(f);
-}
-
-
-int main(int argc, char *argv[])
-{	
-	if (argc == 3)
-		print_header(atof(argv[1]), atoi(argv[2]));
-	else
-		printf("usage: %s clock_in_Mhz error_rate_in_percent\n", argv[0]);
-}
--- a/drivers/ecos_lpc2138_sja1000/canOpenDriver.c	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,325 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack.
-
- Author: Christian Fortin (canfestival@canopencanada.ca)
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <stdlib.h>
-
-#include <sys/time.h>
-#include <signal.h>
-
-#include <cyg/kernel/kapi.h>
-#include <cyg/hal/hal_arch.h>
-
-#include "applicfg.h"
-#include <data.h>
-#include <def.h>
-#include <can.h>
-#include <can_driver.h>
-#include <objdictdef.h>
-#include <objacces.h>
-
-#include "lpc2138_pinout.h"
-#include "lpc2138_defs.h"
-#include "lpc2138.h"
-
-#include "sja1000.h"
-
-#include "time_slicer.h"
-
-
-/*
-	SEND/RECEIVE
-*/
-CAN_HANDLE canOpen(s_BOARD *board)
-{
-	return NULL;
-}
-
-/***************************************************************************/
-int canClose(CAN_HANDLE fd0)
-{
-	return 0;
-}
-
-UNS8 canReceive(CAN_HANDLE fd0, Message *m)
-/*
-Message *m :
-	typedef struct {
-	  SHORT_CAN cob_id;     // l'ID du mesg
-	  UNS8 rtr;             // remote transmission request. 0 if not rtr,
-        	                // 1 for a rtr message
-	  UNS8 len;             // message length (0 to 8)
-	  UNS8 data[8];         // data
-	} Message;
-
-Fill the structure "Message" with data from the CAN receive buffer
-
-return : 0
-*/
-{
-/*
-	the sja1000 must be set to the PeliCAN mode
-*/
-    m->cob_id.w = sja1000_read(16) + (sja1000_read(17)<<8); // IO_PORTS_16(CAN0 + CANRCVID) >> 5
-
-    m->rtr = (sja1000_read(17) >> 4) & 0x01; // (IO_PORTS_8(CAN0 + CANRCVID + 1) >> 4) & 0x01; 
-
-    m->len = sja1000_read(18);
-
-    m->data[0] = sja1000_read(19);
-    m->data[1] = sja1000_read(20);
-    m->data[2] = sja1000_read(21);
-    m->data[3] = sja1000_read(22);
-    m->data[4] = sja1000_read(23);
-    m->data[5] = sja1000_read(24);
-    m->data[6] = sja1000_read(25);
-    m->data[7] = sja1000_read(26);
-
-    sja1000_write(CMR, 1<<RRB );        // release fifo
-
-    return 0;
-}
-
-
-UNS8 canSend(CAN_HANDLE fd0, Message *m)
-/*
-Message *m :
-	typedef struct {
-	  SHORT_CAN cob_id;     // l'ID du mesg
-	  UNS8 rtr;                     // remote transmission request. 0 if not rtr,
-        	                        // 1 for a rtr message
-	  UNS8 len;                     // message length (0 to 8)
-	  UNS8 data[8];         // data
-	} Message;
-
-Send the content of the structure "Message" to the CAN transmit buffer
-
-return : 0 if OK, 1 if error
-*/
-{
-    unsigned char rec_buf;
-
-    do
-    {
-        rec_buf = sja1000_read(SR);
-    }
-    while ( (rec_buf & (1<<TBS))==0);           // loop until TBS high
-
-    sja1000_write(16, m->cob_id.w & 0xff); 
-    sja1000_write(17, (m->cob_id.w >> 8) & 0xff);
-    sja1000_write(18, m->len);
-
-    sja1000_write(19, m->data[0]); // tx data 1
-    sja1000_write(20, m->data[1]); // tx data 2
-    sja1000_write(21, m->data[2]); // tx data 3
-    sja1000_write(22, m->data[3]); // tx data 4
-    sja1000_write(23, m->data[4]); // tx data 5
-    sja1000_write(24, m->data[5]); // tx data 6
-    sja1000_write(25, m->data[6]); // tx data 7
-    sja1000_write(26, m->data[7]); // tx data 8
-
-    sja1000_write(CMR,( (0<<SRR) | (0<<CDO) | (0<<RRB) | (0<<AT) | (1<<TR)));
-    do
-    {
-        rec_buf = sja1000_read(SR);
-    }
-    while ( (rec_buf & (1<<TBS))==0);           // loop until TBS high
-
-    return 0;
-}
-
-
-/*
-	SEQUENTIAL I/O TO FLASH
-	those functions are for continous writing and read
-*/
-
-
-int nvram_open(void)
-{
-	return iat_init();
-}
-
-
-void nvram_close(void)
-{
-	iat_end();
-}
-
-
-void nvram_set_pos(UNS32 pos)
-/* set the current position in the NVRAM to pos */
-{
-}
-
-
-void nvram_new_firmware()
-{
-/*
-	this function is called whenever a new firmware is about
-	to be written in the NVRAM
-*/
-	data_addr = regs_page[1] + regs_page[4]*NVRAM_BLOCK_SIZE;
-	if (data_addr > NVRAM_MAX_SIZE)
-		data_addr = NVRAM_BLOCK_SIZE;
-}
-
-int _get_data_len(int type)
-{
-	int len = 0; /* number of bytes */
-	switch(type)
-	{
-		case  boolean:
-			len = 1;
-			break;
-
-		case  int8:
-		case  uint8:
-			len = 1;
-			break;
-		case  int16:
-		case  uint16:
-			len = 2;
-			break;
-		case  int24:
-		case  uint24:
-			len = 3;
-			break;
-		case  int32:
-		case  uint32:
-		case  real32:
-			len = 4;
-			break;
-		case  int40:
-		case  uint40:
-			len = 5;
-			break;
-		case  int48:
-		case  uint48:
-			len = 6;
-			break;
-		case  int56:
-		case  uint56:
-			len = 7;
-			break;
-		case  int64:
-		case  uint64:
-		case  real64:
-			len = 8;
-			break;
-#if 0
-/* TO DO */
-		case  visible_string:
-		case  octet_string:
-		case  unicode_string:
-		case  time_of_day:
-		case  time_difference:
-#endif
-	}
-
-	return len;
-}
-
-
-char nvram_write_data(int type, int access_attr, void *data)
-/* return 0 if successfull */
-{
-	int len = _get_data_len(type);
-
-	if (data_len+len > NVRAM_BLOCK_SIZE)
-	{
-		iat_flash_write_page(data_addr);
-		data_len = 0;
-		data_addr += NVRAM_BLOCK_SIZE; 
-
-		/* wrap-around address pointer */
-		if (data_addr > NVRAM_MAX_SIZE)
-			data_addr = NVRAM_BLOCK_SIZE;
-
-		data_num_pages++;
-	}
-		
-	memcpy(((char *)data_page)+data_len, data, len);
-
-	data_len += len;
-
-	return 0;
-}
-
-
-char nvram_read_data(int type, int access_attr, void *data)
-/* return 0 if successful */
-{
-	int len = _get_data_len(type);
-
-	if (data_len+len > NVRAM_BLOCK_SIZE)
-	{
-		data_addr += NVRAM_BLOCK_SIZE;
-
-		/* wrap-around address pointer */
-		if (data_addr > NVRAM_MAX_SIZE)
-			data_addr = NVRAM_BLOCK_SIZE;
-
-		iat_flash_read_page(data_addr);
-		data_len = 0;		
-	}
-
-	memcpy(data, ((char *)data_page)+data_len, len);
-
-	data_len += len;
-
-	return 0;
-}
-
-/*
-	NVRAM registers at block 0
-	pos        description
-	0          version of the current dictionnary
-	1          starting address for data block
-	2          date of last writing
-	3          address of the previous dictionnary          
-	4          size in pages of the current dict
-*/
-void nvram_write_reg(UNS32 reg, UNS16 pos)
-/* write reg at the position in the data block 0 */
-{
-	regs_page[pos] = reg;
-}
-
-UNS32 nvram_read_reg(UNS16 pos)
-/* read reg at the position in the data block 0 */
-{
-	return regs_page[pos];
-}
-
-
-/*
-	LED
-*/
-
-void led_set_redgreen(UNS8 bits)
-/* bits : each bit of this uns8 is assigned a led 
-          0=off, 1=on
-*/
-{
-	lpc2138_redgreenled_set(bits);
-}
-
--- a/drivers/ecos_lpc2138_sja1000/lpc2138.c	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,373 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack.
-
- Author: Christian Fortin (canfestival@canopencanada.ca)
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "applicfg.h"
-// #include "objdictdef.h"
-
-#include "lpc2138_pinout.h"
-#include "lpc2138_defs.h"
-#include "lpc2138.h"
-
-#define IAP_LOCATION    0x7ffffff1
-
-// define a page of data of 256 bytes
-//
-short          data_len; /* 0 to 256 bytes */
-unsigned int   *data_page = NULL;
-unsigned int   data_addr;
-
-// local definitons
-void ee_erase(unsigned int ,unsigned int[]);		//function erases EEPROM
-void ee_write_page(unsigned int);	//function adds a record in EEPROM
-void ee_read_page(unsigned int);	//function reads the latest valid record in EEPROM
-
-typedef void (*IAP)(unsigned int [],unsigned int[]);
-IAP iap_entry;
-
-
-/***************************************************************************************/
-
-void lpc2138_pinsel_set(int pin, LPC2138_PORT port, int size, int func) 
-{
-    int i;
-
-    for (i = 0; i < size; pin++, i++) 
-    {
-        /* 2 bits par broche. */
-        int shift = (pin - ((pin < 16) ? 0 : 16)) << 1;
-
-        REG32_ADDR pinsel = (port == 1) ?
-            (REG32_ADDR) P1_PINSEL2_ADDR : ((pin < 16) ?
-                (REG32_ADDR) P0_PINSEL0_ADDR : (REG32_ADDR) P0_PINSEL1_ADDR);
-
-        *pinsel = (*pinsel & ~(BITMASK_2 << shift)) | (func << shift);
-    }
-}
-
-void lpc2138_pinsel_clear() 
-{
-    P0_PINSEL0 = 0x00000000;
-    P0_PINSEL1 = 0x00000000;
-    P1_PINSEL2 = 0x00000000;
-}
-
-
-int lpc2138_printf(void) 
-{
-    return lpc2138_fprintf(stdout);
-}
-
-
-int lpc2138_printf_pins(void) 
-{
-    return lpc2138_fprintf_pins(stdout);
-}
-
-
-int lpc2138_fprintf(FILE *stream) 
-{
-    return fprintf(stream,
-        "[p0=0x%08X,p0_iodir=0x%08X,p0_pinsel0=0x%08X,p0_pinsel1=0x%08X," \
-        "p1=0x%08X,p1_iodir=0x%08X,p1_pinsel2=0x%08X]",
-        P0_IOPIN, P0_IODIR, P0_PINSEL0, P0_PINSEL1,
-        P1_IOPIN, P1_IODIR, P1_PINSEL2);
-}
-
-int lpc2138_fprintf_pins(FILE *stream) 
-{
-    return fprintf(stream,
-        "[cs_s1d13706=0x%X," \
-        "cs_sja1000=0x%X," \
-        "wait=0x%X," \
-        "bhe=0x%X," \
-        "interrupt_sja1000=0x%X," \
-        "redgreenled=0x%X," \
-        "ale=0x%X," \
-        "rd=0x%X," \
-        "wr=0x%X," \
-        "data=0x%X," \
-        "addresses=0x%X]",
-        lpc2138_cs_s1d13706_get(),
-        lpc2138_cs_sja1000_get(),
-        lpc2138_wait_get(),
-        lpc2138_bhe_get(),
-        lpc2138_redgreenled_get(),
-        lpc2138_interrupt_sja1000_get(),
-        lpc2138_ale_get(),
-        lpc2138_rd_get(),
-        lpc2138_wr_get(),
-        lpc2138_data_get(),
-        lpc2138_addresses_get());
-}
-
-
-/*
-	SJA1000 interface
-*/
-
-unsigned char sja1000_read(unsigned char addr8)
-{
-    unsigned char data;
-
-    lpc2138_data_set_mode(LPC2138_MODE_OUTPUT);
-    lpc2138_ale_set(1);
-    lpc2138_data_set(addr8);
-
-    lpc2138_ale_set(0);
-    lpc2138_data_set_mode(LPC2138_MODE_INPUT);
-
-    lpc2138_cs_sja1000_set(0);
-    lpc2138_rd_set(0);
-    data = lpc2138_data_get();
-    data = lpc2138_data_get();
-
-    lpc2138_rd_set(1);
-
-    lpc2138_cs_sja1000_set(1);
-    lpc2138_data_set_mode(LPC2138_MODE_OUTPUT);
-
-    return data;
-}
-
-
-void sja1000_write(unsigned char addr8, unsigned char data)
-{
-    lpc2138_data_set_mode(LPC2138_MODE_OUTPUT);
-
-    lpc2138_data_set(addr8);
-
-    lpc2138_ale_set(1);
-
-    lpc2138_ale_set(0);
-    lpc2138_cs_sja1000_set(0);
-    lpc2138_wr_set(0);
-
-    lpc2138_data_set(data);
-
-    lpc2138_wr_set(1);
-    lpc2138_cs_sja1000_set(1);
-
-}
-
-/*
-	FLASH interface
-*/
-
-/************************************************************************/
-/*                                                                    	*/
-/* function:								*/
-/*  void ee_erase(unsigned int command_ee,unsigned int result_ee[])	*/
-/*                                                                     	*/
-/* type: void                                                          	*/
-/*                                                                     	*/
-/* parameters: 								*/
-/* 	command_ee   - Not used.  	               			*/
-/*  result_ee[0] - Returns a response to the last IAP command used.	*/
-/*                 0 - EEPROM successfully erased.			*/
-/*                 For all other response values, see microcontroller 	*/
-/*		   User Manual, IAP Commands and Status Codes Summary.	*/
-/*  result_ee[1] - Not used.                         			*/
-/*                                                                     	*/
-/* version: 1.1 (01/27/2006)                                           	*/
-/*                                                                     	*/
-/* constants defined in LPC2k_ee.h used in this function:              	*/
-/*  EE_SEC_L 	 - microcontroller's Flash sector where EEPROM begins	*/
-/*  EE_SEC_H 	 - microcontroller's Flash sector where EEPROM ends	*/
-/*  EE_CCLK		 - microcontroller's system clock (cclk)        */
-/*                                                                     	*/
-/* description:								*/
-/*  This function erases LPC2000 on-chip Flash sectors selected to act 	*/
-/*  as an EEPROM. All Flash sectors between EE_SEC_L abd EE_SEC_H	*/
-/*  (including these sectors) will be erased using the In Application	*/
-/*  Programming (IAP) routines (see User Manual for more details). 	*/
-/*  Also, this function disables all interrupts while erasing the       */
-/*  EEPROM. If this is not needed, three lines of the ee_erase          */
-/*  subroutine can simply be commented-out without affecting the        */
-/*  routine performance at all.                                         */
-/*                                                                     	*/
-/* revision history:                                                   	*/
-/* - Rev. 1.1 adds interrupt disable feature.				*/
-/*                                                                     	*/
-/************************************************************************/
-void iat_flash_erase(unsigned int command_ee,unsigned int result_ee[])
-{
-	unsigned int command_iap[5];
-	unsigned int result_iap[3];
-	unsigned long int enabled_interrupts;
-
-	enabled_interrupts = VICIntEnable;  //disable all interrupts
-	VICIntEnClr        = enabled_interrupts;
-
-	command_iap[0]=50;	// prepare sectors from EE_SEC_L to EE_SEC_H for erase
-	command_iap[1]=EE_SEC_L;
-	command_iap[2]=EE_SEC_H;
-	iap_entry=(IAP) IAP_LOCATION;
-	iap_entry(command_iap,result_iap);
-
-	command_iap[0]=52;	// erase sectors from EE_SEC_L to EE_SEC_H
-	command_iap[1]=EE_SEC_L;
-	command_iap[2]=EE_SEC_H;
-	command_iap[3]=EE_CCLK;
-	iap_entry=(IAP) IAP_LOCATION;
-	iap_entry(command_iap,result_iap);
-
-	command_iap[0]=53;	// blankcheck sectors from EE_SEC_L to EE_SEC_H
-	command_iap[1]=EE_SEC_L;
-	command_iap[2]=EE_SEC_H;
-	iap_entry=(IAP) IAP_LOCATION;
-	iap_entry(command_iap,result_iap);
-
-	VICIntEnable = enabled_interrupts;  //restore interrupt enable register
-
-	result_ee[0]=result_iap[0];
-	return;
-}
-
-/************************************************************************/
-/*                                                                    	*/
-/* function: 								*/
-/*  void ee_write(unsigned int command_ee,unsigned int result_ee[])	*/
-/*                                                                     	*/
-/* type: void                                                          	*/
-/*                                                                     	*/
-/* parameters: 								*/
-/* 	command_ee   - An address of a content of ee_data type that has	*/
-/*                 to be programmed into EEPROM.                       	*/
-/*  result_ee[0] - Returns a response to the last IAP command used.	*/
-/*                 0 - data successfully programmed in EEPROM.		*/
-/*               501 - no space in EEPROM to program data.             	*/
-/*                 For all other response values, see microcontroller 	*/
-/*		   User Manual, IAP Commands and Status Codes Summary.	*/
-/*  result_ee[1] - Not used.                           			*/
-/*                                                                     	*/
-/* version: 1.1 (01/27/2006)                                           	*/
-/*                                                                     	*/
-/* constants defined in LPC2k_ee.h used in this function:              	*/
-/*  EE_BUFFER_SIZE 	   - IAP buffer size; must be 256 or 512 	*/
-/*  NO_SPACE_IN_EEPROM - EEPROM is full and no data can be programmed	*/
-/*  EE_BUFFER_MASK	   - parameter used for interfacing with IAP	*/
-/*  EE_REC_SIZE   	   - ee_data structure size in bytes        	*/
-/*  EE_SEC_L 	 	   - micro's Flash sector where EEPROM begins	*/
-/*  EE_SEC_H 	 	   - micro's Flash sector where EEPROM ends	*/
-/*  EE_CCLK		 	   - micro's system clock (cclk)       	*/
-/*                                                                     	*/
-/* description:								*/
-/*  This function writes a single structure of ee_data type into the	*/
-/*  EEPROM using an In Application	Programming (IAP) routines (see */
-/*  User Manual for more details). command_ee contains an address of	*/
-/*  this structure. EEPROM is scanned for the last (if any) record 	*/
-/*  identifier (EE_REC_ID), and a new record is added next to it.      	*/
-/*  Also, this function disables all interrupts while erasing the       */
-/*  EEPROM. If this is not needed, three lines of the ee_write          */
-/*  subroutine can simply be commented-out without affecting the        */
-/*  routine performance at all.                                         */
-/*                                                                     	*/
-/* revision history:                                                   	*/
-/* - Rev. 1.1 fixes a bug related to verifying a content written into	*/
-/*   the EEPROM. 1.0 was reporting missmatch even when there were no	*/
-/*   problems at all.							*/
-/*   Rev. 1.1 adds interrupt disable feature.				*/
-/*                                                                     	*/
-/************************************************************************/
-
-void iat_flash_write_page(unsigned int addr)
-{
-	unsigned long int enabled_interrupts;
-	// unsigned char ee_buffer[16];
-	unsigned int command_iap[5], result_iap[3];
-
-	enabled_interrupts = VICIntEnable;  //disable all interrupts
-	VICIntEnClr        = enabled_interrupts;
-
-	iap_entry = (IAP) IAP_LOCATION;
-
-	// prepare sectors from EE_SEC_L to EE_SEC_H for erase
-	command_iap[0] = 50;			
-	command_iap[1] = EE_SEC_L;
-	command_iap[2] = EE_SEC_H;
-	iap_entry(command_iap, result_iap);
-
-	// copy RAM to flash/eeprom
-	command_iap[0] = 51;
-	command_iap[1] = (unsigned int) (addr & EE_START_MASK); // 256 kb boundary
-	command_iap[2] = (unsigned int) (data_page);            // should be on a word boundary
-	command_iap[3] = 256;
-	command_iap[4] = EE_CCLK;
-	iap_entry(command_iap, result_iap);
-
-#if 0 
-	// compare RAM and flash/eeprom
-	command_iap[0] = 56;
-	command_iap[1] = (unsigned int) data;
-	command_iap[2] = addr;
-	command_iap[3] = dlen;
-	iap_entry(command_iap, result_iap);
-#endif
-
-	VICIntEnable = enabled_interrupts;  //restore interrupt enable register
-}
-
-
-/************************************************************************/
-/*                                                                    	*/
-/* function: 								*/
-/*  void ee_read(unsigned int command_ee,unsigned int result_ee[])	*/
-/*                                                                     	*/
-/* type: void                                                          	*/
-/*                                                                     	*/
-/* parameters: 								*/
-/* 	command_ee   - Not used.					*/
-/*  result_ee[0] - Returns a response.					*/
-/*                 0 - data successfully found in EEPROM.		*/
-/*               500 - no data/records available in EEPROM.		*/
-/*  result_ee[1] - an address of the last record of ee_data type	*/
-/*				   in EEPROM.  	              		*/
-/*                                                                     	*/
-/* version: 1.1 (01/27/2006)                                           	*/
-/*                                                                     	*/
-/* constants defined in LPC2k_ee.h used in this function:              	*/
-/*  NO_RECORDS_AVAILABLE - EEPROM is empty/no records identifiable	*/
-/*			   with a record identifier (EE_REC_ID) found	*/
-/*  EE_ADR_L 	    - micro's Flash address from where EEPROM begins	*/
-/*  EE_REC_SIZE    - size (in bytes) of a ee_data structure        	*/
-/*                                                                 	*/
-/* description:								*/
-/*  This function scans an EEPROM content looking for the last record 	*/
-/*  that can be identified with a record identifier (EE_REC_ID). When 	*/
-/*  such data is found, its address is passed as result_ee[1].		*/
-/*                                                                     	*/
-/* revision history:                                                   	*/
-/* - Rev. 1.0 had problems with accessing the last record in a fully	*/
-/*   occupied EEPROM. Rev. 1.1 fixes this.				*/
-/*                                                                     	*/
-/************************************************************************/
-void iat_flash_read_page(unsigned int addr)
-{
-	memcpy(data_page, (unsigned int *)addr, sizeof(unsigned int)*64);
-}
-
-
-
-
--- a/drivers/ecos_lpc2138_sja1000/lpc2138.h	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack.
-
- Author: Christian Fortin (canfestival@canopencanada.ca)
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-
-#if !defined(_LPC2138_H_)
-#define _LPC2138_H_
-
-
-/* block and maximum size of NVRRAM in bytes */ 
-#define NVRAM_BLOCK_SIZE 256
-#define NVRAM_MAX_SIZE 1024*512
-
-extern short data_len;
-extern short data_num_pages;
-extern unsigned int *data_page;
-extern unsigned int data_addr;
-
-extern unsigned int *regs_page;
-
-void lpc2138_pinsel_set(int pin, LPC2138_PORT port, int size, int func); 
-void lpc2138_pinsel_clear(void); 
-
-int lpc2138_printf(void); 
-int lpc2138_printf_pins(void); 
-
-int lpc2138_fprintf(FILE *stream);
-int lpc2138_fprintf_pins(FILE *stream);
-
-unsigned char sja1000_read(unsigned char addr8);
-void sja1000_write(unsigned char addr8, unsigned char data);
-
-void iat_flash_erase(unsigned int command_ee,unsigned int result_ee[]);
-void iat_flash_write_page(unsigned int addr);
-void iat_flash_read_page(unsigned int addr);
- 
-void iat_flash_write_regs(void);
-void iat_flash_read_regs(void);
-
-#endif
-
--- a/drivers/ecos_lpc2138_sja1000/lpc2138_defs.h	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,529 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack.
-
- Author: Christian Fortin (canfestival@canopencanada.ca)
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-/**
- * Définitions pour le LPC2138.
- */
-
-#if !defined(_LPC2138_DEF_H_)
-#define _LPC2138_DEF_H_
-
-#include <stdio.h>
-
-// #include "types.h"
-
-#define BITMASK_0  0x00000000
-#define BITMASK_1  0x00000001
-#define BITMASK_2  0x00000003
-#define BITMASK_4  0x0000000F
-#define BITMASK_8  0x000000FF
-#define BITMASK_16 0x0000FFFF
-#define BITMASK_32 0xFFFFFFFF
-
-typedef volatile unsigned char   REG8;
-typedef volatile unsigned char  *REG8_ADDR;
-typedef volatile unsigned short  REG16;
-typedef volatile unsigned short *REG16_ADDR;
-typedef volatile unsigned int    REG32;
-typedef volatile unsigned int   *REG32_ADDR;
-
-
-#define SET_EQ_SET =
-#define SET_EQ_CLR =
-
-#define P0_IOPIN_ADDR   0xE0028000
-#define P0_IOSET_ADDR   0xE0028004
-#define P0_IODIR_ADDR   0xE0028008
-#define P0_IOCLR_ADDR   0xE002800C
-#define P0_PINSEL0_ADDR 0xE002C000
-#define P0_PINSEL1_ADDR 0xE002C004
-
-#define P1_IOPIN_ADDR   0xE0028010
-#define P1_IOSET_ADDR   0xE0028014
-#define P1_IODIR_ADDR   0xE0028018
-#define P1_IOCLR_ADDR   0xE002801C
-#define P1_PINSEL2_ADDR 0xE002C014
-
-#define DACR_ADDR       0xE006C000
-
-/* Vectored Interrupt Controller (VIC) */
-#define VICVectAddr_ADDR  0xFFFFF030
-#define VICVectAddr0_ADDR 0xFFFFF100
-#define VICVectCntl0_ADDR 0xFFFFF200
-#define VICIntEnable_ADDR 0xFFFFF010
-
-/* External Interrupts */
-#define EXTINT_ADDR     0xE01FC140
-#define INTWAKE_ADDR    0xE01FC144
-#define EXTMODE_ADDR    0xE01FC148
-#define EXTPOLAR_ADDR   0xE01FC14C
-
-#ifdef TEST
-#include "test_stubs.h"
-#endif
-
-/* Vectored Interrupt Controller (VIC) */
-#define VICIRQStatus   (*((REG32_ADDR) 0xFFFFF000))
-#define VICFIQStatus   (*((REG32_ADDR) 0xFFFFF004))
-#define VICRawIntr     (*((REG32_ADDR) 0xFFFFF008))
-#define VICIntSelect   (*((REG32_ADDR) 0xFFFFF00C))
-#define VICIntEnable   (*((REG32_ADDR) 0xFFFFF010))
-#define VICIntEnClr    (*((REG32_ADDR) 0xFFFFF014))
-#define VICSoftInt     (*((REG32_ADDR) 0xFFFFF018))
-#define VICSoftIntClr  (*((REG32_ADDR) 0xFFFFF01C))
-#define VICProtection  (*((REG32_ADDR) 0xFFFFF020))
-#define VICVectAddr    (*((REG32_ADDR) 0xFFFFF030))
-#define VICDefVectAddr (*((REG32_ADDR) 0xFFFFF034))
-#define VICVectAddr0   (*((REG32_ADDR) 0xFFFFF100))
-#define VICVectAddr1   (*((REG32_ADDR) 0xFFFFF104))
-#define VICVectAddr2   (*((REG32_ADDR) 0xFFFFF108))
-#define VICVectAddr3   (*((REG32_ADDR) 0xFFFFF10C))
-#define VICVectAddr4   (*((REG32_ADDR) 0xFFFFF110))
-#define VICVectAddr5   (*((REG32_ADDR) 0xFFFFF114))
-#define VICVectAddr6   (*((REG32_ADDR) 0xFFFFF118))
-#define VICVectAddr7   (*((REG32_ADDR) 0xFFFFF11C))
-#define VICVectAddr8   (*((REG32_ADDR) 0xFFFFF120))
-#define VICVectAddr9   (*((REG32_ADDR) 0xFFFFF124))
-#define VICVectAddr10  (*((REG32_ADDR) 0xFFFFF128))
-#define VICVectAddr11  (*((REG32_ADDR) 0xFFFFF12C))
-#define VICVectAddr12  (*((REG32_ADDR) 0xFFFFF130))
-#define VICVectAddr13  (*((REG32_ADDR) 0xFFFFF134))
-#define VICVectAddr14  (*((REG32_ADDR) 0xFFFFF138))
-#define VICVectAddr15  (*((REG32_ADDR) 0xFFFFF13C))
-#define VICVectCntl0   (*((REG32_ADDR) 0xFFFFF200))
-#define VICVectCntl1   (*((REG32_ADDR) 0xFFFFF204))
-#define VICVectCntl2   (*((REG32_ADDR) 0xFFFFF208))
-#define VICVectCntl3   (*((REG32_ADDR) 0xFFFFF20C))
-#define VICVectCntl4   (*((REG32_ADDR) 0xFFFFF210))
-#define VICVectCntl5   (*((REG32_ADDR) 0xFFFFF214))
-#define VICVectCntl6   (*((REG32_ADDR) 0xFFFFF218))
-#define VICVectCntl7   (*((REG32_ADDR) 0xFFFFF21C))
-#define VICVectCntl8   (*((REG32_ADDR) 0xFFFFF220))
-#define VICVectCntl9   (*((REG32_ADDR) 0xFFFFF224))
-#define VICVectCntl10  (*((REG32_ADDR) 0xFFFFF228))
-#define VICVectCntl11  (*((REG32_ADDR) 0xFFFFF22C))
-#define VICVectCntl12  (*((REG32_ADDR) 0xFFFFF230))
-#define VICVectCntl13  (*((REG32_ADDR) 0xFFFFF234))
-#define VICVectCntl14  (*((REG32_ADDR) 0xFFFFF238))
-#define VICVectCntl15  (*((REG32_ADDR) 0xFFFFF23C))
-
-#define P0_IOPIN   (*((REG32_ADDR) P0_IOPIN_ADDR))
-#define P0_IOSET   (*((REG32_ADDR) P0_IOSET_ADDR))
-#define P0_IODIR   (*((REG32_ADDR) P0_IODIR_ADDR))
-#define P0_IOCLR   (*((REG32_ADDR) P0_IOCLR_ADDR))
-#define P0_PINSEL0 (*((REG32_ADDR) P0_PINSEL0_ADDR))
-#define P0_PINSEL1 (*((REG32_ADDR) P0_PINSEL1_ADDR))
-
-#define P1_IOPIN   (*((REG32_ADDR) P1_IOPIN_ADDR))
-#define P1_IOSET   (*((REG32_ADDR) P1_IOSET_ADDR))
-#define P1_IODIR   (*((REG32_ADDR) P1_IODIR_ADDR))
-#define P1_IOCLR   (*((REG32_ADDR) P1_IOCLR_ADDR))
-#define P1_PINSEL2 (*((REG32_ADDR) P1_PINSEL2_ADDR))
-
-#define DACR       (*((REG32_ADDR) DACR_ADDR))
-
-/* External Interrupts */
-#define EXTINT   (*((REG32_ADDR) EXTINT_ADDR))
-#define INTWAKE  (*((REG32_ADDR) INTWAKE_ADDR))
-#define EXTMODE  (*((REG32_ADDR) EXTMODE_ADDR))
-#define EXTPOLAR (*((REG32_ADDR) EXTPOLAR_ADDR))
-
-
-/* Timer 0 */
-#define T0IR           (*((REG32_ADDR) 0xE0004000))
-#define T0TCR          (*((REG32_ADDR) 0xE0004004))
-#define T0TC           (*((REG32_ADDR) 0xE0004008))
-#define T0PR           (*((REG32_ADDR) 0xE000400C))
-#define T0PC           (*((REG32_ADDR) 0xE0004010))
-#define T0MCR          (*((REG32_ADDR) 0xE0004014))
-#define T0MR0          (*((REG32_ADDR) 0xE0004018))
-#define T0MR1          (*((REG32_ADDR) 0xE000401C))
-#define T0MR2          (*((REG32_ADDR) 0xE0004020))
-#define T0MR3          (*((REG32_ADDR) 0xE0004024))
-#define T0CCR          (*((REG32_ADDR) 0xE0004028))
-#define T0CR0          (*((REG32_ADDR) 0xE000402C))
-#define T0CR1          (*((REG32_ADDR) 0xE0004030))
-#define T0CR2          (*((REG32_ADDR) 0xE0004034))
-#define T0CR3          (*((REG32_ADDR) 0xE0004038))
-#define T0EMR          (*((REG32_ADDR) 0xE000403C))
-#define T0CTCR         (*((REG32_ADDR) 0xE0004070))
-
-/* Timer 1 */
-#define T1IR           (*((REG32_ADDR) 0xE0008000))
-#define T1TCR          (*((REG32_ADDR) 0xE0008004))
-#define T1TC           (*((REG32_ADDR) 0xE0008008))
-#define T1PR           (*((REG32_ADDR) 0xE000800C))
-#define T1PC           (*((REG32_ADDR) 0xE0008010))
-#define T1MCR          (*((REG32_ADDR) 0xE0008014))
-#define T1MR0          (*((REG32_ADDR) 0xE0008018))
-#define T1MR1          (*((REG32_ADDR) 0xE000801C))
-#define T1MR2          (*((REG32_ADDR) 0xE0008020))
-#define T1MR3          (*((REG32_ADDR) 0xE0008024))
-#define T1CCR          (*((REG32_ADDR) 0xE0008028))
-#define T1CR0          (*((REG32_ADDR) 0xE000802C))
-#define T1CR1          (*((REG32_ADDR) 0xE0008030))
-#define T1CR2          (*((REG32_ADDR) 0xE0008034))
-#define T1CR3          (*((REG32_ADDR) 0xE0008038))
-#define T1EMR          (*((REG32_ADDR) 0xE000803C))
-#define T1CTCR         (*((REG32_ADDR) 0xE0008070))
-
-/* Real Time Clock */
-#define ILR            (*((REG8_ADDR) 0xE0024000))
-#define CTC            (*((REG16_ADDR) 0xE0024004))
-#define CCR            (*((REG8_ADDR) 0xE0024008))
-#define CIIR           (*((REG8_ADDR) 0xE002400C))
-#define AMR            (*((REG8_ADDR) 0xE0024010))
-#define CTIME0         (*((REG32_ADDR) 0xE0024014))
-#define CTIME1         (*((REG32_ADDR) 0xE0024018))
-#define CTIME2         (*((REG32_ADDR) 0xE002401C))
-#define SEC            (*((REG8_ADDR) 0xE0024020))
-#define MIN            (*((REG8_ADDR) 0xE0024024))
-#define HOUR           (*((REG8_ADDR) 0xE0024028))
-#define DOM            (*((REG8_ADDR) 0xE002402C))
-#define DOW            (*((REG8_ADDR) 0xE0024030))
-#define DOY            (*((REG16_ADDR) 0xE0024034))
-#define MONTH          (*((REG8_ADDR) 0xE0024038))
-#define YEAR           (*((REG16_ADDR) 0xE002403C))
-#define ALSEC          (*((REG8_ADDR) 0xE0024060))
-#define ALMIN          (*((REG8_ADDR) 0xE0024064))
-#define ALHOUR         (*((REG8_ADDR) 0xE0024068))
-#define ALDOM          (*((REG8_ADDR) 0xE002406C))
-#define ALDOW          (*((REG8_ADDR) 0xE0024070))
-#define ALDOY          (*((REG16_ADDR) 0xE0024074))
-#define ALMON          (*((REG8_ADDR) 0xE0024078))
-#define ALYEAR         (*((REG16_ADDR) 0xE002407C))
-#define PREINT         (*((REG16_ADDR) 0xE0024080))
-#define PREFRAC        (*((REG16_ADDR) 0xE0024084))
-
-/* SPI Registers */
-#define S0SPCR         (*((REG32_ADDR) 0xE0020000))
-#define S0SPSR         (*((REG32_ADDR) 0xE0020004))
-#define S0SPDR         (*((REG32_ADDR) 0xE0020008))
-#define S0SPCCR        (*((REG32_ADDR) 0xE002000C))
-#define S0SPINT        (*((REG32_ADDR) 0xE002001C))
-
-/* SSP Registers */
-#define SSPCR0         (*((REG32_ADDR) 0xE0068000))
-#define SSPCR1         (*((REG32_ADDR) 0xE0068004))
-#define SSPDR          (*((REG32_ADDR) 0xE0068008))
-#define SSPSR          (*((REG32_ADDR) 0xE006800C))
-#define SSPCPSR        (*((REG32_ADDR) 0xE0068010))
-#define SSPIMSC        (*((REG32_ADDR) 0xE0068014))
-#define SSPRIS         (*((REG32_ADDR) 0xE0068018))
-#define SSPMIS         (*((REG32_ADDR) 0xE006801C))
-#define SSPICR         (*((REG32_ADDR) 0xE0068020))
-
-
-typedef enum {
-    LPC2138_MODE_INPUT  = 0,
-    LPC2138_MODE_OUTPUT = 1
-} LPC2138_MODE;
-
-typedef enum {
-    P0 = 0,
-    P1 = 1
-} LPC2138_PORT;
-
-/* === Fonctions "#define" génériques ======================================= */
-
-#define _cat(a, b) a##b
-#define _CAT(a, b) _cat(a, b)
-
-#define _PIN(pin)  LPC2138_##pin
-#define _PORT(pin) LPC2138_##pin##_PORT
-#define _SIZE(pin) LPC2138_##pin##_SIZE
-
-/* ((P[0|1]_IOPIN >> pin) & BITMASK_[0-32]) */
-#define lpc2138_get(pin) \
-    ((_CAT(_PORT(pin), _IOPIN) >> _PIN(pin)) & _CAT(BITMASK_, _SIZE(pin)))
-
-#define lpc2138_set(pin, i) \
-    { if (_SIZE(pin) == 1) { lpc2138_set_bit(pin, i); } \
-        else { lpc2138_set_all(pin, i); } }
-
-#define lpc2138_set_bit(pin, i) \
-    { if ((i) == 1) { _CAT(_PORT(pin), _IOSET) SET_EQ_SET (1 << _PIN(pin)); } \
-           else { _CAT(_PORT(pin), _IOCLR) SET_EQ_CLR (1 << _PIN(pin)); } }
-
-#define lpc2138_set_all(pin, i) \
-    (_CAT(_PORT(pin), _IOPIN) = \
-        (_CAT(_PORT(pin), _IOPIN) & \
-            ~(_CAT(BITMASK_, _SIZE(pin)) << _PIN(pin))) | ((i) << _PIN(pin)))
-
-/* Identique à lpc2138_set(p, f, nbits, i) sans effet secondaire (plus lent). */
-#define lpc2138_set_SAFE_(pin, i) \
-    ((_SIZE(pin) == 1) && lpc2138_set_bit_SAFE_(pin, (i)) || \
-        lpc2138_set_all(pin, (i)))
-
-/* Identique à lpc2138_set_bit(p, f, i) sans effet secondaire (plus lent). */
-#define lpc2138_set_bit_SAFE_(pin, i) \
-    ((i == 1) && (_CAT(_PORT(pin), _IOSET) SET_EQ_SET (1 << _PIN(pin))) || \
-        (_CAT(_PORT(pin), _IOCLR) SET_EQ_CLR (1 << _PIN(pin))))
-
-#define lpc2138_set_mode(pin, mode) \
-    (_CAT(_PORT(pin), _IODIR) = (mode == LPC2138_MODE_OUTPUT) ? \
-        (_CAT(_PORT(pin), _IODIR)|(_CAT(BITMASK_, _SIZE(pin)) << _PIN(pin))) : \
-        (_CAT(_PORT(pin), _IODIR) & ~(_CAT(BITMASK_, _SIZE(pin)) << _PIN(pin))))
-
-#define lpc2138_set_pinsel(pin, func) \
-    lpc2138_pinsel_set(_PIN(pin), _PORT(pin), _SIZE(pin), func)
-
-/* === Fonctions pinout "#define" par défaut ================================ */
-
-#ifndef lpc2138_uart0_tx_set_pinsel
-#define lpc2138_uart0_tx_set_pinsel(func)          lpc2138_set_pinsel(uart0_tx, func)
-#endif
-
-#ifndef lpc2138_uart0_rx_set_pinsel
-#define lpc2138_uart0_rx_set_pinsel(func)          lpc2138_set_pinsel(uart0_rx, func)
-#endif
-
-#ifndef lpc2138_cs_s1d13706_get
-#define lpc2138_cs_s1d13706_get()                  lpc2138_get       (cs_s1d13706)
-#endif
-
-#ifndef lpc2138_cs_s1d13706_set
-#define lpc2138_cs_s1d13706_set(i)                 lpc2138_set       (cs_s1d13706, i)
-#endif
-
-#ifndef lpc2138_cs_s1d13706_set_mode
-#define lpc2138_cs_s1d13706_set_mode(mode)         lpc2138_set_mode  (cs_s1d13706, mode)
-#endif
-
-#ifndef lpc2138_cs_s1d13706_set_pinsel
-#define lpc2138_cs_s1d13706_set_pinsel(func)       lpc2138_set_pinsel(cs_s1d13706, func)
-#endif
-
-#ifndef lpc2138_cs_sja1000_get
-#define lpc2138_cs_sja1000_get()                   lpc2138_get       (cs_sja1000)
-#endif
-
-#ifndef lpc2138_cs_sja1000_set
-#define lpc2138_cs_sja1000_set(i)                  lpc2138_set       (cs_sja1000, i)
-#endif
-
-#ifndef lpc2138_cs_sja1000_set_mode
-#define lpc2138_cs_sja1000_set_mode(mode)          lpc2138_set_mode  (cs_sja1000, mode)
-#endif
-
-#ifndef lpc2138_cs_sja1000_set_pinsel
-#define lpc2138_cs_sja1000_set_pinsel(func)        lpc2138_set_pinsel(cs_sja1000, func)
-#endif
-
-#ifndef lpc2138_wait_get
-#define lpc2138_wait_get()                         lpc2138_get       (wait)
-#endif
-
-#ifndef lpc2138_wait_set
-#define lpc2138_wait_set(i)                        lpc2138_set       (wait, i)
-#endif
-
-#ifndef lpc2138_wait_set_mode
-#define lpc2138_wait_set_mode(mode)                lpc2138_set_mode  (wait, mode)
-#endif
-
-#ifndef lpc2138_wait_set_pinsel
-#define lpc2138_wait_set_pinsel(func)              lpc2138_set_pinsel(wait, func)
-#endif
-
-#ifndef lpc2138_bhe_get
-#define lpc2138_bhe_get()                          lpc2138_get       (bhe)
-#endif
-
-#ifndef lpc2138_bhe_set
-#define lpc2138_bhe_set(i)                         lpc2138_set       (bhe, i)
-#endif
-
-#ifndef lpc2138_bhe_set_mode
-#define lpc2138_bhe_set_mode(mode)                 lpc2138_set_mode  (bhe, mode)
-#endif
-
-#ifndef lpc2138_bhe_set_pinsel
-#define lpc2138_bhe_set_pinsel(func)               lpc2138_set_pinsel(bhe, func)
-#endif
-
-#ifndef lpc2138_interrupt_sja1000_get
-#define lpc2138_interrupt_sja1000_get()            lpc2138_get       (interrupt_sja1000)
-#endif
-
-#ifndef lpc2138_interrupt_sja1000_set
-#define lpc2138_interrupt_sja1000_set(i)           lpc2138_set       (interrupt_sja1000, i)
-#endif
-
-#ifndef lpc2138_interrupt_sja1000_set_mode
-#define lpc2138_interrupt_sja1000_set_mode(mode)   lpc2138_set_mode  (interrupt_sja1000, mode)
-#endif
-
-#ifndef lpc2138_interrupt_sja1000_set_pinsel
-#define lpc2138_interrupt_sja1000_set_pinsel(func) lpc2138_set_pinsel(interrupt_sja1000, func)
-#endif
-
-#ifndef lpc2138_redgreenled_get
-#define lpc2138_redgreenled_get()            lpc2138_get       (redgreenled)
-#endif
-
-#ifndef lpc2138_redgreenled_set
-#define lpc2138_redgreenled_set(i)           lpc2138_set       (redgreenled, i)
-#endif
-
-#ifndef lpc2138_redgreenled_set_mode
-#define lpc2138_redgreenled_set_mode(mode)   lpc2138_set_mode  (redgreenled, mode)
-#endif
-
-#ifndef lpc2138_redgreenled_set_pinsel
-#define lpc2138_redgreenled_set_pinsel(func) lpc2138_set_pinsel(redgreenled, func)
-#endif
-
-#ifndef lpc2138_dac0_set
-#define lpc2138_dac0_set()                         lpc2138_set       (dac0, i)
-#endif
-
-#ifndef lpc2138_dac0_set_value
-#define lpc2138_dac0_set_value(i)                  DACR =            ((1 << 16) | ((i & 0x3FF) << 6))
-#endif
-
-#ifndef lpc2138_dac0_set_pinsel
-#define lpc2138_dac0_set_pinsel(func)              lpc2138_set_pinsel(dac0, func)
-#endif
-
-#ifndef lpc2138_spi0_set
-#define lpc2138_spi0_set()                         lpc2138_set       (spi0, i)
-#endif
-
-#ifndef lpc2138_spi0_set_value
-#define lpc2138_spi0_set_value(i)                  SSPDR = i
-#endif
-
-#ifndef lpc2138_spi0_set_pinsel
-#define lpc2138_spi0_set_pinsel(func)              lpc2138_set_pinsel(spi0, func)
-#endif
-
-#ifndef lpc2138_ale_get
-#define lpc2138_ale_get()                          lpc2138_get       (ale)
-#endif
-
-#ifndef lpc2138_ale_set
-#define lpc2138_ale_set(i)                         lpc2138_set       (ale, i)
-#endif
-
-#ifndef lpc2138_ale_set_mode
-#define lpc2138_ale_set_mode(mode)                 lpc2138_set_mode  (ale, mode)
-#endif
-#ifndef lpc2138_ale_set_pinsel
-#define lpc2138_ale_set_pinsel(func)               lpc2138_set_pinsel(ale, func)
-#endif
-
-#ifndef lpc2138_rd_get
-#define lpc2138_rd_get()                           lpc2138_get       (rd)
-#endif
-
-#ifndef lpc2138_rd_set
-#define lpc2138_rd_set(i)                          lpc2138_set       (rd, i)
-#endif
-
-#ifndef lpc2138_rd_set_mode
-#define lpc2138_rd_set_mode(mode)                  lpc2138_set_mode  (rd, mode)
-#endif
-
-#ifndef lpc2138_rd_set_pinsel
-#define lpc2138_rd_set_pinsel(func)                lpc2138_set_pinsel(rd, func)
-#endif
-
-#ifndef lpc2138_wr_get
-#define lpc2138_wr_get()                           lpc2138_get       (wr)
-#endif
-
-#ifndef lpc2138_wr_set
-#define lpc2138_wr_set(i)                          lpc2138_set       (wr, i)
-#endif
-
-#ifndef lpc2138_wr_set_mode
-#define lpc2138_wr_set_mode(mode)                  lpc2138_set_mode  (wr, mode)
-#endif
-
-#ifndef lpc2138_wr_set_pinsel
-#define lpc2138_wr_set_pinsel(func)                lpc2138_set_pinsel(wr, func)
-#endif
-
-#ifndef lpc2138_data_get
-#define lpc2138_data_get()                         lpc2138_get       (data)
-#endif
-
-#ifndef lpc2138_data_set
-#define lpc2138_data_set(i)                        lpc2138_set       (data, i)
-#endif
-
-#ifndef lpc2138_data_set_mode
-#define lpc2138_data_set_mode(mode)                lpc2138_set_mode  (data, mode)
-#endif
-
-#ifndef lpc2138_data_set_pinsel
-#define lpc2138_data_set_pinsel(func)              lpc2138_set_pinsel(data, func)
-#endif
-
-#ifndef lpc2138_addresses_get
-#define lpc2138_addresses_get()                    ((lpc2138_get      (a17_mr) << 17) | \
-                                                    (lpc2138_get      (a16)    << 16) | \
-                                                    (lpc2138_get      (a0_a15)))
-#endif
-
-#ifndef lpc2138_addresses_set
-#define lpc2138_addresses_set(i)                     lpc2138_set      (a17_mr, ((i >> 17) & BITMASK_1)); \
-                                                     lpc2138_set      (a16,    ((i >> 16) & BITMASK_1)); \
-                                                     lpc2138_set      (a0_a15, ((i)       & BITMASK_16))
-#endif
-
-#ifndef lpc2138_addresses_set_mode
-#define lpc2138_addresses_set_mode(mode)            (lpc2138_set_mode  (a17_mr, mode), \
-                                                     lpc2138_set_mode  (a16,    mode), \
-                                                     lpc2138_set_mode  (a0_a15, mode))
-#endif
-
-#ifndef lpc2138_addresses_set_pinsel
-#define lpc2138_addresses_set_pinsel(func)          (lpc2138_set_pinsel(a17_mr, func), \
-                                                     lpc2138_set_pinsel(a16,    func), \
-                                                     lpc2138_set_pinsel(a0_a15, func))
-#endif
-
-#define CMR 1
-#define RRB 2	// 1=released message in fifo are released
-#define AT 1	// 1= cancel next tranmission
-#define SR 2
-#define TBS 2	// 1=released the cpu may write a message in the transmit buffer
-#define SRR 4	// 1=present  a message shall be transmit and receive sim
-#define TR 0	// 1=present a message shall be transmit
-
-
-/*
-	FLASH
-*/
-#define EE_SEC_L		1		// Flash sector where EEPROM begins (see UM for details)
-#define EE_SEC_H		3	  	// Flash sector where EEPROM ends (see UM for details)
-#define EE_ADDR_L		0x00001000	// Must match the EE_SEC_L Flash sector start address
-#define EE_ADDR_H		0x00003FFF 	// Must match the EE_SEC_H Flash sector end address
-#define EE_CCLK			60000		// system clock cclk expressed in kHz (5*12 MHz)
-#define EE_BUFFER_SIZE	        256
-#define EE_START_MASK           0xFFFFFF00
-#define EE_BUFFER_MASK          0x000000F0
-
-
-#endif
--- a/drivers/ecos_lpc2138_sja1000/lpc2138_pinout.h	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack.
-
- Author: Christian Fortin (canfestival@canopencanada.ca)
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-/**
- * Définitions du brochage LPC2138 par défaut.
- */
-#if !defined(_LPC2138_PINOUT_H_)
-#define _LPC2138_PINOUT_H_
-
-#define LPC2138_uart0_tx                0 /* Pin 0 */
-#define LPC2138_uart0_tx_PORT          P0
-#define LPC2138_uart0_tx_SIZE           1
-
-#define LPC2138_uart0_rx                1 /* Pin 1 */
-#define LPC2138_uart0_rx_PORT          P0
-#define LPC2138_uart0_rx_SIZE           1
-
-#define LPC2138_cs_sja1000              4 /* Pin 4 */
-#define LPC2138_cs_sja1000_PORT        P0
-#define LPC2138_cs_sja1000_SIZE         1
-
-#define LPC2138_cs_s1d13706             5 /* Pin 5 */
-#define LPC2138_cs_s1d13706_PORT       P0
-#define LPC2138_cs_s1d13706_SIZE        1
-
-#define LPC2138_wait                    7 /* Pin 7 */
-#define LPC2138_wait_PORT              P0
-#define LPC2138_wait_SIZE               1
-
-#define LPC2138_uart1_tx                8 /* Pin 8 */
-#define LPC2138_uart1_tx_PORT          P0
-#define LPC2138_uart1_tx_SIZE           1
-
-#define LPC2138_uart1_rx                9 /* Pin 9 */
-#define LPC2138_uart1_rx_PORT          P0
-#define LPC2138_uart1_rx_SIZE           1
-
-#define LPC2138_bhe                    10 /* Pin 10 */
-#define LPC2138_bhe_PORT               P0
-#define LPC2138_bhe_SIZE                1
-
-#define LPC2138_a17_mr                 12 /* Pin 12 */
-#define LPC2138_a17_mr_PORT            P0
-#define LPC2138_a17_mr_SIZE             1
-
-#define LPC2138_a16                    13 /* Pin 13 */
-#define LPC2138_a16_PORT               P0
-#define LPC2138_a16_SIZE                1
-
-#define LPC2138_interrupt_sja1000      14 /* Pin 14 */
-#define LPC2138_interrupt_sja1000_PORT P0
-#define LPC2138_interrupt_sja1000_SIZE  1
-
-#define LPC2138_data                   16 /* Pins 16-23 */
-#define LPC2138_data_PORT              P0
-#define LPC2138_data_SIZE               8
-
-#define LPC2138_dac0                   25 /* Pin 25 */
-#define LPC2138_dac0_PORT              P0
-#define LPC2138_dac0_SIZE               1
-
-#define LPC2138_ale                    26 /* Pin 26 */
-#define LPC2138_ale_PORT               P0
-#define LPC2138_ale_SIZE                1
-
-#define LPC2138_redgreenled             27 /* Pin 27 */
-#define LPC2138_redgreenled_PORT        P0
-#define LPC2138_redgreenled_SIZE        2
-
-#define LPC2138_rd                     29 /* Pin 29 */
-#define LPC2138_rd_PORT                P0
-#define LPC2138_rd_SIZE                 1
-
-#define LPC2138_wr                     30 /* Pin 30 */
-#define LPC2138_wr_PORT                P0
-#define LPC2138_wr_SIZE                 1
-
-#define LPC2138_a0_a15                 16 /* Pins 16-31 */
-#define LPC2138_a0_a15_PORT            P1
-#define LPC2138_a0_a15_SIZE            16
-
-#define LPC2138_addresses_SIZE         18
-
-#endif
--- a/drivers/ecos_lpc2138_sja1000/notes.txt	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-canOpenDriver.c
-	f_can_send
-	f_can_receive
-	interrupts
-	nvram_save/load
-	baudrate
-
-sja1000.c
-	hardware init 
-	
-lpc2138.c
-	iat_flash
-
-time_slicer.c
-	settimer
-	alarm
-
-
--- a/drivers/ecos_lpc2138_sja1000/nvram.h	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack.
-  ____    _    _   _
- / ___|  / \  | \ | | ___  _ __   ___ _ __
-| |     / _ \ |  \| |/ _ \| '_ \ / _ \ '_ \
-| |___ / ___ \| |\  | (_) | |_) |  __/ | | |
- \____/_/   \_\_| \_|\___/| .__/ \___|_| |_|
-                          |_|
-          ____                      _
-         / ___|__ _ _ __   __ _  __| | __ _
-        | |   / _` | '_ \ / _` |/ _` |/ _` |
-        | |__| (_| | | | | (_| | (_| | (_| |
-         \____\__,_|_| |_|\__,_|\__,_|\__,_|
-
-                   canfestival@canopencanada.ca
-/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#if !defined(_NVRAM_IO_H_)
-#define _NVRAM_IO_H_
-
-
-int    nvram_open(void);
-void   nvram_close(void);
-
-char nvram_write_data(int type, int access_attr, void *data);
-char nvram_read_data(int type, int access_attr, void *data);
-
-void nvram_write_regs(void);
-void nvram_read_regs(void);
-
-#endif
-
--- a/drivers/ecos_lpc2138_sja1000/nvram_iap.c	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,365 +0,0 @@
-/*
-                   canfestival@canopencanada.ca
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-flash.c
-	save to / retrieve from  the non-volatile memory
-	to be tested
-	- can we write/read into an address without working with the whole page (256bytes)
-*/
-
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "applicfg.h"
-#include "data.h"
-#include "objdictdef.h"
-
-#include "lpc2138_defs.h"                    /* LPC21xx definitions */
-
-#define IAP_LOCATION 			0x7ffffff1
-
-
-// define a page of data of NVRAM_BLOCK_SIZE bytes
-//
-short data_len; /* 0 to NVRAM_BLOCK_SIZE bytes */
-short data_num_pages;
-unsigned int *data_page = NULL;
-unsigned int data_addr;
-
-unsigned int *regs_page = NULL;
-
-// local definitons
-void ee_erase(unsigned int ,unsigned int[]);		//function erases EEPROM
-void ee_write_page(unsigned int);	//function adds a record in EEPROM
-void ee_read_page(unsigned int);	//function reads the latest valid record in EEPROM
-
-typedef void (*IAP)(unsigned int [],unsigned int[]);
-IAP iap_entry;
-
-
-int iat_init()
-{
-	int n = NVRAM_BLOCK_SIZE / sizeof(unsigned int);
-
-	/* some actions to initialise the flash */
-	data_len = 0;
-	data_num_pages = 0;
-
-	data_page = (unsigned int *)malloc(sizeof(unsigned int) * n);
-	memset(data_page, 0, sizeof(unsigned int)*n);
-
-	if (data_page == NULL)
-		return -1;
-
-	regs_page = (unsigned int *)malloc(sizeof(unsigned int) * n);
-	memset(regs_page, 0, sizeof(unsigned int)*n);
-	if (regs_page == NULL)
-		return -2;
-
-	iat_flash_read_regs();
-
-	/* start the data at the location specified in the registers */ 
-	if (0) /* for now it is 0, but put here a test to know whether
-                  or not the NVRAM has been written before */
-		data_addr = regs_page[1];
-	else
-		data_addr = NVRAM_BLOCK_SIZE; /* let start at block 1 */
-
-	return 0;
-}
-
-
-void iat_end()
-{
-	/* write the last page before closing */
-	iat_flash_write_page(data_addr);
-
-	/* some actions to end accessing the flash */
-	free(data_page);
-
-	regs_page[4] = data_num_pages;
-	/* write the registers to the NVRAM before closing */
-	iat_flash_write_regs();
-	free(regs_page);
-}
-
-
-
-/************************************************************************/
-/*                                                                    	*/
-/* function:								*/
-/*  void ee_erase(unsigned int command_ee,unsigned int result_ee[])	*/
-/*                                                                     	*/
-/* type: void                                                          	*/
-/*                                                                     	*/
-/* parameters: 								*/
-/* 	command_ee   - Not used.  	               			*/
-/*  result_ee[0] - Returns a response to the last IAP command used.	*/
-/*                 0 - EEPROM successfully erased.			*/
-/*                 For all other response values, see microcontroller 	*/
-/*		   User Manual, IAP Commands and Status Codes Summary.	*/
-/*  result_ee[1] - Not used.                         			*/
-/*                                                                     	*/
-/* version: 1.1 (01/27/2006)                                           	*/
-/*                                                                     	*/
-/* constants defined in LPC2k_ee.h used in this function:              	*/
-/*  EE_SEC_L 	 - microcontroller's Flash sector where EEPROM begins	*/
-/*  EE_SEC_H 	 - microcontroller's Flash sector where EEPROM ends	*/
-/*  EE_CCLK		 - microcontroller's system clock (cclk)        */
-/*                                                                     	*/
-/* description:								*/
-/*  This function erases LPC2000 on-chip Flash sectors selected to act 	*/
-/*  as an EEPROM. All Flash sectors between EE_SEC_L abd EE_SEC_H	*/
-/*  (including these sectors) will be erased using the In Application	*/
-/*  Programming (IAP) routines (see User Manual for more details). 	*/
-/*  Also, this function disables all interrupts while erasing the       */
-/*  EEPROM. If this is not needed, three lines of the ee_erase          */
-/*  subroutine can simply be commented-out without affecting the        */
-/*  routine performance at all.                                         */
-/*                                                                     	*/
-/* revision history:                                                   	*/
-/* - Rev. 1.1 adds interrupt disable feature.				*/
-/*                                                                     	*/
-/************************************************************************/
-void ee_erase(unsigned int command_ee,unsigned int result_ee[])
-{
-	unsigned int command_iap[5];
-	unsigned int result_iap[3];
-	unsigned long int enabled_interrupts;
-
-	enabled_interrupts = VICIntEnable;  //disable all interrupts
-	VICIntEnClr        = enabled_interrupts;
-
-	command_iap[0]=50;	// prepare sectors from EE_SEC_L to EE_SEC_H for erase
-	command_iap[1]=EE_SEC_L;
-	command_iap[2]=EE_SEC_H;
-	iap_entry=(IAP) IAP_LOCATION;
-	iap_entry(command_iap,result_iap);
-
-	command_iap[0]=52;	// erase sectors from EE_SEC_L to EE_SEC_H
-	command_iap[1]=EE_SEC_L;
-	command_iap[2]=EE_SEC_H;
-	command_iap[3]=EE_CCLK;
-	iap_entry=(IAP) IAP_LOCATION;
-	iap_entry(command_iap,result_iap);
-
-	command_iap[0]=53;	// blankcheck sectors from EE_SEC_L to EE_SEC_H
-	command_iap[1]=EE_SEC_L;
-	command_iap[2]=EE_SEC_H;
-	iap_entry=(IAP) IAP_LOCATION;
-	iap_entry(command_iap,result_iap);
-
-	VICIntEnable = enabled_interrupts;  //restore interrupt enable register
-
-	result_ee[0]=result_iap[0];
-	return;
-}
-
-/************************************************************************/
-/*                                                                    	*/
-/* function: 								*/
-/*  void ee_write(unsigned int command_ee,unsigned int result_ee[])	*/
-/*                                                                     	*/
-/* type: void                                                          	*/
-/*                                                                     	*/
-/* parameters: 								*/
-/* 	command_ee   - An address of a content of ee_data type that has	*/
-/*                 to be programmed into EEPROM.                       	*/
-/*  result_ee[0] - Returns a response to the last IAP command used.	*/
-/*                 0 - data successfully programmed in EEPROM.		*/
-/*               501 - no space in EEPROM to program data.             	*/
-/*                 For all other response values, see microcontroller 	*/
-/*		   User Manual, IAP Commands and Status Codes Summary.	*/
-/*  result_ee[1] - Not used.                           			*/
-/*                                                                     	*/
-/* version: 1.1 (01/27/2006)                                           	*/
-/*                                                                     	*/
-/* constants defined in LPC2k_ee.h used in this function:              	*/
-/*  EE_BUFFER_SIZE 	   - IAP buffer size; must be 256 or 512 	*/
-/*  NO_SPACE_IN_EEPROM - EEPROM is full and no data can be programmed	*/
-/*  EE_BUFFER_MASK	   - parameter used for interfacing with IAP	*/
-/*  EE_REC_SIZE   	   - ee_data structure size in bytes        	*/
-/*  EE_SEC_L 	 	   - micro's Flash sector where EEPROM begins	*/
-/*  EE_SEC_H 	 	   - micro's Flash sector where EEPROM ends	*/
-/*  EE_CCLK		 	   - micro's system clock (cclk)       	*/
-/*                                                                     	*/
-/* description:								*/
-/*  This function writes a single structure of ee_data type into the	*/
-/*  EEPROM using an In Application	Programming (IAP) routines (see */
-/*  User Manual for more details). command_ee contains an address of	*/
-/*  this structure. EEPROM is scanned for the last (if any) record 	*/
-/*  identifier (EE_REC_ID), and a new record is added next to it.      	*/
-/*  Also, this function disables all interrupts while erasing the       */
-/*  EEPROM. If this is not needed, three lines of the ee_write          */
-/*  subroutine can simply be commented-out without affecting the        */
-/*  routine performance at all.                                         */
-/*                                                                     	*/
-/* revision history:                                                   	*/
-/* - Rev. 1.1 fixes a bug related to verifying a content written into	*/
-/*   the EEPROM. 1.0 was reporting missmatch even when there were no	*/
-/*   problems at all.							*/
-/*   Rev. 1.1 adds interrupt disable feature.				*/
-/*                                                                     	*/
-/************************************************************************/
-
-void ee_write_page(unsigned int addr)
-{
-	unsigned long int enabled_interrupts;
-	// unsigned char ee_buffer[16];
-	unsigned int command_iap[5], result_iap[3];
-
-	enabled_interrupts = VICIntEnable;  //disable all interrupts
-	VICIntEnClr        = enabled_interrupts;
-
-	iap_entry = (IAP) IAP_LOCATION;
-
-	// prepare sectors from EE_SEC_L to EE_SEC_H for erase
-	command_iap[0] = 50;			
-	command_iap[1] = EE_SEC_L;
-	command_iap[2] = EE_SEC_H;
-	iap_entry(command_iap, result_iap);
-
-	// copy RAM to flash/eeprom
-	command_iap[0] = 51;
-	command_iap[1] = (unsigned int) (addr & EE_START_MASK); // 256 kb boundary
-	command_iap[2] = (unsigned int) (data_page);            // should be on a word boundary
-	command_iap[3] = 256;
-	command_iap[4] = EE_CCLK;
-	iap_entry(command_iap, result_iap);
-
-#if 0 
-	// compare RAM and flash/eeprom
-	command_iap[0] = 56;
-	command_iap[1] = (unsigned int) data;
-	command_iap[2] = addr;
-	command_iap[3] = dlen;
-	iap_entry(command_iap, result_iap);
-#endif
-
-	VICIntEnable = enabled_interrupts;  //restore interrupt enable register
-}
-
-
-/************************************************************************/
-/*                                                                    	*/
-/* function: 								*/
-/*  void ee_read(unsigned int command_ee,unsigned int result_ee[])	*/
-/*                                                                     	*/
-/* type: void                                                          	*/
-/*                                                                     	*/
-/* parameters: 								*/
-/* 	command_ee   - Not used.					*/
-/*  result_ee[0] - Returns a response.					*/
-/*                 0 - data successfully found in EEPROM.		*/
-/*               500 - no data/records available in EEPROM.		*/
-/*  result_ee[1] - an address of the last record of ee_data type	*/
-/*				   in EEPROM.  	              		*/
-/*                                                                     	*/
-/* version: 1.1 (01/27/2006)                                           	*/
-/*                                                                     	*/
-/* constants defined in LPC2k_ee.h used in this function:              	*/
-/*  NO_RECORDS_AVAILABLE - EEPROM is empty/no records identifiable	*/
-/*			   with a record identifier (EE_REC_ID) found	*/
-/*  EE_ADR_L 	    - micro's Flash address from where EEPROM begins	*/
-/*  EE_REC_SIZE    - size (in bytes) of a ee_data structure        	*/
-/*                                                                 	*/
-/* description:								*/
-/*  This function scans an EEPROM content looking for the last record 	*/
-/*  that can be identified with a record identifier (EE_REC_ID). When 	*/
-/*  such data is found, its address is passed as result_ee[1].		*/
-/*                                                                     	*/
-/* revision history:                                                   	*/
-/* - Rev. 1.0 had problems with accessing the last record in a fully	*/
-/*   occupied EEPROM. Rev. 1.1 fixes this.				*/
-/*                                                                     	*/
-/************************************************************************/
-void ee_read_page(unsigned int addr)
-{
-	memcpy(data_page, (unsigned int *)addr, sizeof(unsigned int)*64);
-}
-
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////
-
-
-/*
-	CAN FESTIVAL interface functions
-*/
-
-
-int _get_data_len(int type)
-{
-	int len = 0; /* number of bytes */
-	switch(type)
-	{
-		case  boolean:
-			len = 1;
-			break;
-
-		case  int8:
-		case  uint8:
-			len = 1;
-			break;
-		case  int16:
-		case  uint16:
-			len = 2;
-			break;
-		case  int24:
-		case  uint24:
-			len = 3;
-			break;
-		case  int32:
-		case  uint32:
-		case  real32:
-			len = 4;
-			break;
-		case  int40:
-		case  uint40:
-			len = 5;
-			break;
-		case  int48:
-		case  uint48:
-			len = 6;
-			break;
-		case  int56:
-		case  uint56:
-			len = 7;
-			break;
-		case  int64:
-		case  uint64:
-		case  real64:
-			len = 8;
-			break;
-#if 0
-/* TO DO */
-		case  visible_string:
-		case  octet_string:
-		case  unicode_string:
-		case  time_of_day:
-		case  time_difference:
-#endif
-	}
-
-	return len;
-}
-
-
-
--- a/drivers/ecos_lpc2138_sja1000/nvram_iap.h	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack.
-                   canfestival@canopencanada.ca
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-/************************************************************************/
-/*                                                                    	*/
-/*	LPC2k_ee.H:  Header file enabling EEPROM support		*/
-/* 	for Philips LPC2000 microcontroller's on-chip Flash memory	*/
-/*     	(revision 1.0, May 13th, 2005.)					*/
-/*                                                             		*/
-/*	This file is to be used with LPC2k_ee.c	file 		  	*/
-/*                                                                     	*/
-/* IMPORTANT: on-chip Flash memory sector(s) intended to be used as 	*/
-/* an EEPROM will be unavailable for regular code storage! The smallest	*/
-/* amount of Flash memory that can be used as an EEPROM is a single 	*/
-/* Flash sector (regardless of the Flash sector actual size). 		*/
-/*                                                                     	*/
-/* If size of desired EEPROM requires several Flash sectors, these	*/
-/* sectors must be a consecutive ones.					*/
-/*                                                                     	*/
-/************************************************************************/
-
-#define EE_SEC_L		1		//Flash sector where EEPROM begins (see UM for details)
-#define EE_SEC_H		3	  	//Flash sector where EEPROM ends (see UM for details)
-#define EE_ADDR_L		0x00001000	//Must match the EE_SEC_L Flash sector start address
-#define EE_ADDR_H		0x00003FFF 	//Must match the EE_SEC_H Flash sector end address
-#define EE_CCLK			60000		//system clock cclk expressed in kHz (5*12 MHz)
-
-/************************************************************************/
-/*                                                                    	*/
-/* ee_data structure can be defined differently from this example.	*/
-/* The only requirement is to have _id field as it is defined here	*/
-/* since EE_REC_ID character is used to identify a record's presence	*/
-/* in the EEPROM memory.						*/
-/*                                                                     	*/
-/* ====================================================================	*/
-/*                                                                     	*/
-/* IMPORTANT ARM memory access considerations:				*/
-/*                                                                     	*/
-/* char	: byte alligned. Can be accessed at any location in memory.	*/
-/*                                                                     	*/
-/* short int: occupies 2 consecutive bytes. It can be read/write 	*/
-/*	  accessed only when half-word alligned. Therefore, it is	*/
-/* 	  located at addresses ending with 0x0, 0x2, 0x4, 0x6, 0x8,	*/
-/*	  0xA, 0xC or 0xE.						*/
-/*                                                                     	*/
-/* int	: occupies 4 consecutive bytes.	It can be read/write 		*/
-/*	  accessed only when half-word alligned. Therefore, it is	*/
-/* 	  located at addresses ending with 0x0, 0x4, 0x8 or 0xC.	*/
-/*                                                                     	*/
-/* ====================================================================	*/
-/*                                                                     	*/
-/* Due to the LPC2000 Flash memory characteristics, an ee_data 		*/
-/* structure size (EE_REC_SIZE) is limited to the following set:	*/
-/*                                                                     	*/
-/* LPC2101/2/3, LPC2131/2/4/6/8, LPC2141/2/4/6/8: 0x10, 0x20, 0x40,     */ 
-/*                                                0x80 or 0x100         */
-/*                                                                     	*/
-/* LPC2104/5/6, LPC2112/4/9, LPC2124/9, LPC2192/4: 0x10, 0x20, 0x40,    */
-/*                                                 0x80, 0x100 or 0x200 */
-/*                                                                     	*/
-/* ====================================================================	*/
-/*                                                                     	*/
-/* example1:                                                          	*/
-/*                                                                     	*/
-/* struct ee_data{		//structure starts as word alligned	*/
-/*	unsigned char	_id;	//1 byte  - no allignement restr.	*/
-/*                                  // 	    3 BYTE GAP!!!!         	*/		
-/*	unsigned int	_rec_count; //4 bytes - must be word alligned!	*/
-/*	unsigned char	_cs;	//1 byte  - no allignement restr.	*/
-/*};				// next structure will start as		*/
-/*                                  // word alligned...                 */
-/* Structure in example 1 occupies 12 bytes of memory			*/
-/*                                                                     	*/
-/* --------------------------------------------------------------------	*/
-/*                                                                     	*/
-/* example2:                                                          	*/
-/*                                                                     	*/
-/* struct ee_data{		//structure starts as word alligned	*/
-/*	unsigned char	_id;	//1 byte  - no allignement restr.	*/
-/*	unsigned char	_cs;	//1 byte  - no allignement restr.	*/
-/*                              //  	    2 BYTE GAP!!!!         	*/		
-/*	unsigned int	_rec_count; //4 bytes - must be word alligned!	*/
-/*};				// next structure will start as		*/
-/*                                  // word alligned...                 */
-/* Structure in example 2 occupies 8 bytes of memory			*/
-/*                                                                     	*/
-/************************************************************************/
-
-struct ee_data{
-	unsigned char	_id;		//  4 bytes: 1 byte (char) + 3 byte GAP!
-	unsigned int	_rec_count;	//  4 bytes (int)
-	unsigned int	_counter;	//  4 bytes (int)
-	unsigned char	_cs;		//  4 bytes: 1 byte (char) + 3 byte GAP!
-};					// 16 bytes total
-
-/************************************************************************/
-/*									*/
-/* 	Disclaimer: all observations presented in example1, example 2 and */
-/*	ee_data structure defined here are based on Keil's ARM compiler. */
-/*	If another compiler is used, memory usage would have to be 	*/
-/*	re-examined and verified.					*/
-/*									*/
-/************************************************************************/
-
-
-#define EE_REC_SIZE		0x10	//see restrictions from above
-
-/********************************************************************/
-/*									*/
-/* 	Valid combinations for 						*/
-/* EE_REC_SIZE, EE_BUFFER_SIZE, EE_BUFFER_MASK and EE_START_MASK	*/
-/*									*/
-/* EE_BUFFER_SIZE ! EE_START_MASK ! EE_REC_SIZE ! EE_BUFFER_MASK	*/
-/* ----------------------------------------------------------------	*/
-/*    	256	0xFFFFFF00		0x010	  	0xF0		*/
-/*	256	0xFFFFFF00		0x020	 	0xE0		*/
-/*    	256	0xFFFFFF00		0x040	  	0xC0		*/
-/*	256	0xFFFFFF00		0x080	 	0x80		*/
-/*	256	0xFFFFFF00		0x100		0x00		*/
-/* ---------------------------------------------------------------- */
-/*    	512	0xFFFFFE00		0x010	  	0x1F0		*/
-/*	512	0xFFFFFE00		0x020	 	0x1E0		*/
-/*    	512	0xFFFFFE00		0x040	  	0x1C0		*/
-/*	512	0xFFFFFE00		0x080		0x180	 	*/
-/*	512	0xFFFFFE00		0x100	 	0x100		*/
-/*	512	0xFFFFFE00		0x200	 	0x000		*/
-/********************************************************************/
-/*	For LPC2101/2/3, LPC213x and LPC214x EE_BUFFER_SIZE is 256. */
-/*	For all other LPC2000 devices EE_BUFFER_SIZE is always 512. */
-/********************************************************************/
-#define EE_BUFFER_SIZE	256
-#define EE_START_MASK	0xFFFFFF00
-#define EE_BUFFER_MASK	0x000000F0
-
-/********************************************************************/
-/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
-/*!!								  !!*/
-/*!!								  !!*/
-/*!! 	DO NOT MODIFY THE FOLLOWING CODE!!!			  !!*/
-/*!!	===================================			  !!*/
-/*!!								  !!*/
-/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
-/********************************************************************/
-
-#define EE_REC_ID 				0xAA
-#define EE_SIZE					(EE_ADDR_H+1-EE_ADDR_L)
-#define NO_RECORDS_AVAILABLE	500
-#define NO_SPACE_IN_EEPROM		501
-#define INDEX_OUT_OF_RANGE		502
-
-#ifndef _EEPROM_
-	extern const unsigned char eeprom[];
-	extern void ee_erase(unsigned int , unsigned int []);	//function erases EEPROM
-	extern void ee_write(unsigned int , unsigned int []);	//function adds a record in EEPROM
-	extern void ee_read (unsigned int , unsigned int []);	//function reads the latest valid record in EEPROM
-	extern void ee_readn(unsigned int , unsigned int []);	//function reads n-th record in EEPROM
-	extern void ee_count(unsigned int , unsigned int []);	//function counts records in EEPROM
-#endif
--- a/drivers/ecos_lpc2138_sja1000/nvram_readme	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-procedure for NVRAM
-===================
-
-data block 0
-------------
-This data block is located at the beginning of the NVRAM and contains
-a series of registers.
-eg. 1. the version number of the current dictionnary (32 bits)
-    2. pointer to the current dictionnary (32 bits)
-    3. date of last dictionnary dump (32 bits)
-    4. pointer to the last dict (32 bits)
-    5. size in page of the current dict
-
-a minimum number of registers should always be in this block (including a number of 'for future use' 32 bits registers). the remaining space will be left to the developper
-
-a 256kb data block could handled 64 registers 
-
-data block 1 to N
------------------
-The place where to put the content of the dictionnary
-
-
-procedure to write in the NVRAM
--------------------------------
-for each sub-index
-add a flag indicating the state
-	= 0  : normal
-	= -1 : this is a old sub-index, no longer used
-	= +1 : this is a new sub-index
-
-the sub-indexed flaged to -1 could be remove when doing a new release of dictionnary
-eg. from BIOS V0 to V1, flag the old sub-index to -1.  but when going to V2, those must be remove from the dictionnary
-
-this flag is important when reloading the old NVRAM content. Since the writing and reading are done sequentially, the dictionnary and the NVRAM must be synchronised.
-
-
-ON BOOT
--------
-1. read the block data 0 and check the NVRAM version number against the current dictionnary
-if the dict version = NVRAM version, then read the NVRAM using the normal procedure (state=0 and state=+1)
-if the dict version is newer then the NVRAM, read the NVRAM using the state=0 and state=-1 . this will ensure a synchone reading of the data
-
-2. if this is a new NVRAM, write the whole dictionnary to a NEW position in the NVRAM.
-	write all sub-indexes with state=0 and =+1, do not write does with state=-1
-	write the new version number in the registery and the date
-
-
-ON WRITE
---------
-write the content of the whole dict (only those sub-indexes that must be saved) to the NVRAM
-write the version number  
-write the date
-
-
-NEW VERSION OF BIOS
--------------------
-When a new version of BIOS is downloaded into the device, special procedure must be taken (cf. ON BOOT and ON WRITE). But to avoid problem during the update (i.e. lost of NVRAM data or worst NVRAM corruption) fewer NVRAM manipulation should be performed. Therefore, when writing the new dictionary to NVRAM, it should be put AFTER the previous one. This will provide a way to go back and fetch the previous dictionnary saved values if needed. 
-
-Obviously, the NVRAM has a limited capacity and it is possible that the new BIOS will overshoot the upper limit of memory. In that case, the algorithm should do a loop-around the addressed. Meaning, if the last block of data is reached, go back to data block 1 (data block 0 = registers). If the NVRAM is large enough, it should not cause problem (i.e. overwritting the beginning of the actual dict).
-
-Data Block 0 has the offset in memory to access the current dict. It also containt the pointer to the last version of the dict. Since the algo writing to the NVRAM does not compact memory, the size of the dict is not necessarily the size of the NVRAM memory it occupies.
--- a/drivers/ecos_lpc2138_sja1000/sja1000.c	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack.
-
- Author: Christian Fortin (canfestival@canopencanada.ca)
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <cyg/kernel/kapi.h>
-#include <cyg/hal/hal_arch.h>
-
-#include "lpc2138_pinout.h"
-#include "lpc2138_defs.h"
-#include "lpc2138.h"
-
-#include "sja1000.h"
-
-
-#define CYGNUM_HAL_INTERRUPT_1 CYGNUM_HAL_INTERRUPT_EINT1
-#define CYGNUM_HAL_PRI_HIGH    0
-
-
-cyg_uint32 interrupt_1_isr(cyg_vector_t vector, cyg_addrword_t data);
-void interrupt_1_dsr(cyg_vector_t   vector,
-                            cyg_ucount32   count,
-                            cyg_addrword_t data);
-
-
-/* Interrupt for CAN device. */
-static cyg_interrupt interrupt_1;
-static cyg_handle_t  interrupt_1_handle;
-
-
-void init_sja1000(void)
-{
-    do
-    {
-        sja1000_write(MOD, 1<<RM);                  /* demande reset */
-    }
-    while ((sja1000_read(MOD) & (1<<RM)) == 0);   /* loop until reset good */
-
-/*
-    sja1000_write(bustiming0, ((0<<SJW1)|(0<<SJW0)|(0<<BRP5)|(0<<BRP4)|(0<<BRP3)|(0<<BRP2)|(0<<BRP1)|(0<<BRP0)));
-    sja1000_write(bustiming1, ((1<<SAM)|(0<<TSEG22)|(1<<TSEG21)|(0<<TSEG20)|(0<<TSEG13)|(1<<TSEG12)|(0<<TSEG11)|(0<<TSEG10)));
-*/
-
-/* OUTPUT CONTROL REGISTER */
-    sja1000_write(outputcontrol, ((1<<OCTP1)|(1<<OCTN1)|(0<<OCPOL1)|(1<<OCTP0)|(1<<OCTN0)|(0<<OCPOL0)|(1<<OCMODE1)|(0<<OCMODE0)));
-
-
-    sja1000_write(clockdivider, ((1<<CANmode)|(1<<CBP)|(1<<RXINTEN)|(0<<clockoff)|(1<<CD2)|(1<<CD1)|(1<<CD0)));
-    sja1000_write(16,  0x01);   /* 0 code all accept block high bit */
-    sja1000_write(17,  0x00);   /* 0 all accept block high bit */
-    sja1000_write(18,  0x00);   /* 0 all accept block high bit */
-    sja1000_write(19,  0x00);   /* 0 all accept block high bit */
-    sja1000_write(20,  0xFE);   /* 1 mask */
-    sja1000_write(21,  0xFF);
-    sja1000_write(22,  0xFF);
-    sja1000_write(23,  0xFF);
-    sja1000_write(IER, 0x01);
-    sja1000_write(clockdivider, ((1<<CANmode)|(1<<CBP)|(1<<RXINTEN)|(0<<clockoff)|(1<<CD2)|(1<<CD1)|(0<<CD0)));
-
-    do
-    {
-        sja1000_write(MOD, (1<<AFM)|(0<<STM)|(0<<RM));
-    }
-    while ((sja1000_read(MOD) & (1<<RM)) == 1);   /* loop until reset gone */
-}
-
-
-/***************************************************************************/
-
-
-void init_interrupts(void)
-{
-    cyg_vector_t   interrupt_1_vector   = CYGNUM_HAL_INTERRUPT_1;
-    cyg_priority_t interrupt_1_priority = CYGNUM_HAL_PRI_HIGH;
-
-    cyg_interrupt_create(
-        interrupt_1_vector,
-        interrupt_1_priority,
-        (cyg_addrword_t) 0,
-        (cyg_ISR_t *) &interrupt_1_isr,
-        (cyg_DSR_t *) &interrupt_1_dsr,
-        &interrupt_1_handle,
-        &interrupt_1);
-
-    cyg_interrupt_attach(interrupt_1_handle);
-
-    cyg_interrupt_acknowledge(interrupt_1_vector);
-
-    cyg_interrupt_unmask(interrupt_1_vector);
-}
-
-/* External Interrupt 1 Service */
-void eint1_srv(void) /*__irq*/ 
-{
-	//++intrp_count;                              // increment interrupt count
-	EXTINT      = 2;                            // Clear EINT1 interrupt flag
-	VICVectAddr = 0;                            // Acknowledge Interrupt
-}
-
-
-/* Initialize EINT1 Interrupt Pin */
-void init_eint1(void)
-{
-	EXTMODE       = 0x2;                         // Edge sensitive mode on EINT1
-	EXTPOLAR      = 0;                           // falling edge sensitive
-	P0_PINSEL0   |= 2 << 28;                     // Enable EINT1 on GPIO_0.14
-	VICVectAddr0  = (unsigned long) eint1_srv;   // set interrupt vector in VIC 0
-	VICVectCntl0  = 0x20 | 15;                   // use VIC 0 for EINT1 Interrupt
-	EXTINT        = 2;
-	VICIntEnable  = 1 << 15;                     // Enable EINT1 Interrupt
-}
-
-
-/*
-{
-	unsigned char byte=sja1000_read(0x02);
-
-	if (byte & 0x01)
-	{
-		// RXFIFO full
-	}
-	
-	if (byte & 0x02)
-	{
-		// overrun
-	}
-	
-	if (byte & 0x04)
-	{
-		// the cpu may write a msg
-	}
-	
-	if (byte & 0x08)
-	{
-		// tx complete
-	}
-	
-	if (byte & 0x10)
-	{
-		// receiving
-	}
-	
-	if (byte & 0x20)
-	{
-		// transmitting
-	}
-	
-	if (byte & 0x40)
-	{
-		// at least one of the error counter has reached or exceeeded
-		// the CPU warning limit
-	}
-	
-	if (byte & 0x80)
-	{
-		// bus off
-	}
-}
-*/
-
-
--- a/drivers/ecos_lpc2138_sja1000/sja1000.h	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack.
-
- Author: Christian Fortin (canfestival@canopencanada.ca)
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#if !defined(_SJA1000_H_)
-#define _SJA1000_H_
-
-#define MOD 0
-#define RM 0 /* RM 1=reset 0 = normal */
-#define bustiming0 6
-#define OCMODE1 1
-#define OCMODE0 0
-
-#define SJW1 7
-#define SJW0 6
-#define BRP5 5
-#define BRP4 4
-#define BRP3 3
-#define BRP2 2
-#define BRP1 1
-#define BRP0 0
-
-#define CDO 3 /* 1=clear data overun status bit */
-#define SAM 7
-#define TSEG22 6
-#define TSEG21 5
-#define TSEG20 4
-#define TSEG13 3
-#define TSEG12 2
-#define TSEG11 1
-#define TSEG10 0
-#define OCTP1 7
-#define OCTN1 6
-#define OCPOL1 5
-#define OCTP0 4
-#define OCTN0 3
-#define OCPOL0 2
-#define OCMODE1 1
-#define OCMODE0 0
-#define clockdivider 31
-#define CANmode 7 /* 1= PELICAN */
-#define CBP 6 /* 1= bypass comparator */
-#define RXINTEN 5 /* 1= receive interrupt from tx */
-#define clockoff 3 /* 1= disabled */
-#define CD2 2
-#define CD1 1
-#define CD0 0
-
-#define AFM 3 /* AFM 1=single 0=dual acceptance filter */
-#define STM 2 /* STM 1=self test 0= norma */
-#define IER 4
-#define bustiming1 7
-#define outputcontrol 8
-#define TXIDENTIFIER1 17
-#define TXIDENTIFIER2 18
-
-
-#endif
--- a/drivers/ecos_lpc2138_sja1000/time_slicer.c	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack.
-
- Author: Christian Fortin (canfestival@canopencanada.ca)
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <stdlib.h>
-
-#include <sys/time.h>
-#include <signal.h>
-
-#include <cyg/kernel/kapi.h>
-#include <cyg/hal/hal_arch.h>
-
-#include "applicfg.h"
-
-#include <timer.h>
-
-
-#define max(a,b) a>b?a:b
-#define min(a,b) a<b?a:b
-
-
-// ---------  The timer table ---------
-s_timer_entry timers[MAX_NB_TIMER] = {{TIMER_FREE, NULL, NULL, 0, 0, 0},};
-TIMEVAL total_sleep_time = TIMEVAL_MAX;
-TIMER_HANDLE last_timer_raw = -1;
-
-cyg_alarm_t chrono_timer;
-cyg_alarm alarm_timer;
-cyg_handle_t alarm_handle_timer;
-cyg_handle_t rtclock, rtcounter;
-
-void init_timer(void)
-{
-	rtclock = cyg_real_time_clock();
-	cyg_clock_to_counter(rtclock, &rtcounter);
-
-	cyg_alarm_create(rtcounter,
-                         &chrono_timer,
-                         0, 
-                         &alarm_handle_timer,
-                         &alarm_timer);
-}
-
-
-unsigned int getElapsedTime(void)
-{
-	// HCS12 main timer :  Increment every 4 us.
-	return 0; // IO_PORTS_16(TCNTH);
-}
-
-
-void setTimer(TIMEVAL tm /* in ms? s? us? */)
-{
-/*
-	this function is required by the library to make the scheduler work
-	properly
-	it is called by SetAlarm() (in src/timer.c)
-
-	the interrupt vector must call TimeDispatch() (in src/timer.c)
-*/
-	/*
-		value of alarm time for eCos
-		  1 = 10 msec
-		100 = 1 sec
-
-#define MS_TO_TIMEVAL(ms) ms/10
-#define US_TO_TIMEVAL(us) us*4
-
-	*/
-
-	cyg_alarm_initialize(alarm_handle_timer, tm, 0);
-}
-
-
-void chrono_timer(cyg_handle_t alarm, cyg_addrword_t data)
-{
-	int i;
-	int next_wakeup = TIMEVAL_MAX; // used to compute when should normaly occur next wakeup
-	// First run : change timer state depending on time
-	// Get time since timer signal
-	int overrun = getElapsedTime();
-	
-	int real_total_sleep_time = total_sleep_time + overrun;
-	
-	for(i=0; i <= last_timer_raw; i++)
-	{
-		s_timer_entry *row = (timers+i);
-
-		if (row->state & TIMER_ARMED) // if row is active
-		{
-			if (row->val <= real_total_sleep_time) // to be trigged
-			{
-				if (!row->interval) // if simply outdated
-				{
-					row->state = TIMER_TRIG; // ask for trig
-				}
-				else // or period have expired
-				{
-					// set val as interval, with overrun correction
-					row->val = row->interval - (overrun % row->interval);
-					row->state = TIMER_TRIG_PERIOD; // ask for trig, periodic
-					// Check if this new timer value is the soonest
-					next_wakeup = min(row->val,next_wakeup);
-				}
-			}
-			else
-			{
-				// Each armed timer value in decremented.
-				row->val -= real_total_sleep_time;
-
-				// Check if this new timer value is the soonest
-				next_wakeup = min(row->val,next_wakeup);
-			}
-		}
-	}
-	
-	// Remember how much time we should sleep.
-	total_sleep_time = next_wakeup;
-
-	// Set timer to soonest occurence
-	setTimer(next_wakeup);
-
-	// Then trig them or not.
-	for(i=0; i<=last_timer_raw; i++)
-	{
-		s_timer_entry *row = (timers+i);
-
-		if (row->state & TIMER_TRIG)
-		{
-			row->state &= ~TIMER_TRIG; // reset trig state (will be free if not periodic)
-			(*row->callback)(row->d, row->id); // trig !
-		}
-	}
-}
-
-
-
-
-TIMER_HANDLE SetAlarm(CO_Data* d, UNS32 id, TimerCallback_t callback, TIMEVAL value, TIMEVAL period)
-{
-	int i;
-	TIMER_HANDLE row_number = TIMER_NONE;
-
-	if (callback == NULL) // nothing to store
-		return TIMER_NONE;
-
-	// in order to decide new timer setting we have to run over all timer rows
-	
-	for(i=0; i <= last_timer_raw + 1 && i < MAX_NB_TIMER; i++)
-	{
-		s_timer_entry *row = (timers+i);
-
-		if (row->state == TIMER_FREE) // an empty row
-		{	// just store
-			row->callback = callback;
-			row->d = d;
-			row->id = id;
-			row->val = value;
-			row->interval = period;
-			row->state = TIMER_ARMED;
-
-			row_number = i;
-			break;
-		}
-	}
-	
-	if (row_number != TIMER_NONE) // if successfull
-	{
-		if (row_number == last_timer_raw + 1) last_timer_raw++;
-		
-		// set next wakeup alarm if new entry is sooner than others, or if it is alone
-		unsigned int real_timer_value = min(value, TIMEVAL_MAX);
-		unsigned int elapsed_time = getElapsedTime();
-
-		if (total_sleep_time > elapsed_time && total_sleep_time - elapsed_time > real_timer_value)
-		{
-			total_sleep_time = elapsed_time + real_timer_value;
-			setTimer(real_timer_value);
-		}
-
-		return row_number;
-	}
-
-	return TIMER_NONE;
-}
-
-// ---------  Use this to remove an alarm ---------
-TIMER_HANDLE DelAlarm(TIMER_HANDLE handle)
-{
-	if (handle != TIMER_NONE)
-	{
-		if (handle == last_timer_raw) 
-			last_timer_raw--;
-		timers[handle].state = TIMER_FREE; 		
-	}
-	else 
-	{
-	}
-
-	return TIMER_NONE;
-}
--- a/drivers/ecos_lpc2138_sja1000/time_slicer.h	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack.
-
- Author: Christian Fortin (canfestival@canopencanada.ca)
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-
-#if !defined(_TIME_SLICER_H_)
-#define _TIME_SLICER_H_
-
-
-extern cyg_handle_t alarm_handle_timer;
-
-void chrono_timer(cyg_handle_t alarmH, cyg_addrword_t data);
-void init_timer(void);
-
-
-#endif
--- a/drivers/ecos_lpc2138_sja1000/timerscfg.h	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack. 
-
-Copyright (C): Edouard TISSERANT and Francis DUPIN
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#ifndef __TIMERSCFG_H__
-#define __TIMERSCFG_H__
-
-#include <pthread.h>
-
-// Time unit : us
-// Time resolution : 64bit (~584942 years)
-// #define TIMEVAL unsigned long long
-// #define TIMEVAL_MAX 0xffffffffffffffff
-// #define MS_TO_TIMEVAL(ms) ms*1000
-// #define US_TO_TIMEVAL(us) us
-
-#define TASK_HANDLE pthread_t
-
-#endif
--- a/drivers/led_stdout/.cvsignore	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-Makefile
--- a/drivers/led_stdout/Makefile.in	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-#! gmake
-
-#
-# Copyright (C) 2006 Laurent Bessard
-# 
-# This file is part of canfestival, a library implementing the canopen
-# stack
-# 
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-# 
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-# 
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-# 
-
-CC = SUB_CC
-OPT_CFLAGS = -O2
-CFLAGS = SUB_OPT_CFLAGS
-PROG_CFLAGS = SUB_PROG_CFLAGS
-LIBS = -lm
-SHAREDLIBOPT = -shared
-OS_NAME = SUB_OS_NAME
-ARCH_NAME = SUB_ARCH_NAME
-PREFIX = SUB_PREFIX
-TARGET = SUB_TARGET
-TIMERS_DRIVER = SUB_TIMERS_DRIVER
-CAN_DRIVER = SUB_CAN_DRIVER
-LED_DRIVER = SUB_LED_DRIVER
-NVRAM_DRIVER = SUB_NVRAM_DRIVER
-
-INCLUDES = -I../../include -I../../include/$(TARGET) -I../../include/$(CAN_DRIVER) -I../../include/$(TIMERS_DRIVER)
-
-OBJS = $(LED_DRIVER).o
-
-all: driver
-
-driver: $(OBJS)
-
-%o: %c
-	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $<
-
-install:
-
-uninstall:
-
-clean:
-	rm -f $(OBJS)
-
-mrproper: clean
-
-
--- a/drivers/led_stdout/led_stdout.c	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-/***************************************************************************/
-#include <data.h>
-#include <led.h>
-
-void led_set_redgreen(CO_Data *d, unsigned char state)
-{
-        if (state & 0x01)
-                printf("\e[41m ERROR LED ON \e[m          ");
-        else
-                printf("\e[31m error led off \e[m         ");
-
-        if (state & 0x02)
-                printf("\e[34;42m RUN LED ON \e[m\n");
-        else
-                printf("\e[32m run led off \e[m\n");
-}
-
-
--- a/drivers/nvram_file/nvram_file.c	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-#include <stdio.h>
-
-
-/* size of NVRAM in bytes */
-#define NVRAM_MAX_SIZE 262144
-
-/* size of block in byte */
-#define NVRAM_BLOCK_SIZE 256
-
-#define NVRAM_FILE_NAME "__nvram__"
-
-FILE *nvram_file = NULL;
-
-
-void iat_flash_read_regs();
-void iat_flash_write_regs();
-void iat_flash_write_page(unsigned int);
-void iat_flash_read_page(unsigned int);
-
-
-short data_len; /* 0 to NVRAM_BLOCK_SIZE bytes */
-short data_num_pages;
-unsigned int *data_page = NULL;
-unsigned int data_addr;
-
-unsigned int *regs_page = NULL;
-
-int iat_init()
-{
-	int i;
-
-	nvram_file = fopen(NVRAM_FILE_NAME, "wr");
-	if (nvram_file  == NULL)
-		return -1;
-
-	int n = NVRAM_BLOCK_SIZE / sizeof(unsigned int);
-
-	/* some actions to initialise the flash */
-	data_len = 0;
-	data_num_pages = 0;
-
-	data_page = (unsigned int *)malloc(sizeof(unsigned int) * n);
-	memset(data_page, 0, sizeof(unsigned int)*n);
-
-	if (data_page == NULL)
-		return -1;
-
-	regs_page = (unsigned int *)malloc(sizeof(unsigned int) * n);
-	memset(regs_page, 0, sizeof(unsigned int)*n);
-	if (regs_page == NULL)
-		return -2;
-
-	iat_flash_read_regs();
-
-	/* start the data at the location specified in the registers */ 
-	if (0) /* for now it is 0, but put here a test to know whether
-                  or not the NVRAM has been written before */
-		data_addr = regs_page[1];
-	else
-		data_addr = NVRAM_BLOCK_SIZE; /* let start at block 1 */
-
-	/* create a file the size of the simulated NVRAM */
-	for(i=0; i<NVRAM_MAX_SIZE/NVRAM_BLOCK_SIZE + 1; i++)
-		fwrite(data_page, sizeof(unsigned int), n, nvram_file);
-
-	return 0;
-}
-
-
-void iat_end()
-{
-	iat_flash_write_page(data_addr);
-
-	iat_flash_write_regs();
-
-	fclose(nvram_file);
-}
-
- 
-void iat_flash_read_regs()
-{
-	fseek(nvram_file, 0, SEEK_SET);
-	fread(regs_page, sizeof(unsigned int), NVRAM_BLOCK_SIZE, nvram_file);
-}
-
-
-void iat_flash_write_regs()
-{
-	fseek(nvram_file, 0, SEEK_SET);
-	fwrite(regs_page, sizeof(unsigned int), NVRAM_BLOCK_SIZE, nvram_file);
-}
-
-
-void iat_flash_read_page(unsigned int addr)
-{
-	fseek(nvram_file, addr*sizeof(unsigned int), SEEK_SET);
-	fread(data_page, sizeof(unsigned int), NVRAM_BLOCK_SIZE, nvram_file);
-}
-
-
-void iat_flash_write_page(unsigned int addr)
-{
-	fseek(nvram_file, addr*sizeof(unsigned int), SEEK_SET);
-	fwrite(data_page, sizeof(unsigned int), NVRAM_BLOCK_SIZE, nvram_file);
-}
-
-
-/*------------------------------------------------------*/
-int main()
-{
-	iat_init();
-	iat_end();
-}
-/*------------------------------------------------------*/
--- a/drivers/unix/Makefile.in	Tue Feb 13 17:21:19 2007 +0100
+++ b/drivers/unix/Makefile.in	Tue Feb 13 18:06:18 2007 +0100
@@ -50,16 +50,6 @@
 OBJS += ../$(CAN_DRIVER)/$(CAN_DRIVER).o
 endif
 
-# add led driver if any
-ifneq ($(LED_DRIVER),led_)
-OBJS += ../$(LED_DRIVER)/$(LED_DRIVER).o
-endif
-
-# add nvram driver if any
-ifneq ($(NVRAM_DRIVER),nvram_)
-OBJS += ../$(NVRAM_DRIVER)/$(NVRAM_DRIVER).o
-endif
-
 SRC_HFILES = ../../include/$(TARGET)/applicfg.h
 
 TARGET_HFILES = $(PREFIX)/include/$(TARGET)/applicfg.h
--- a/examples/AppliMaster_HCS12/Makefile.in	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-#! gmake
-
-#
-# Copyright (C) 2006 Laurent Bessard
-# 
-# This file is part of canfestival, a library implementing the canopen
-# stack
-# 
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-# 
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-# 
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-# 
-
-CC = SUB_CC
-OPT_CFLAGS = -Os
-CFLAGS = SUB_OPT_CFLAGS
-PROG_CFLAGS = SUB_PROG_CFLAGS
-OS_NAME = SUB_OS_NAME
-ARCH_NAME = SUB_ARCH_NAME
-PREFIX = SUB_PREFIX
-BINUTILS_PREFIX = SUB_BINUTILS_PREFIX
-TARGET = SUB_TARGET
-
-INCLUDES = -I../../include -I../../include/hcs12
-MEMORY_X = ../../include/hcs12/board/arch
-
-OBJCOPY = $(BINUTILS_PREFIX)objcopy
-OBJCOPY_FLAGS = --only-section=.text --only-section=.rodata --only-section=.vectors --only-section=.data
-
-PROGDEFINES = -mnoshort -Wall -Wmissing-prototypes -fno-strict-aliasing -g
-
-PGR=AppliMaster
-
-MASTER_OBJS = objdict.o appli.o vectors.o
-
-OBJS = ../../src/hc12_pdo.o ../../src/hc12_sdo.o ../../src/hc12_init.o ../../src/hc12_sync.o\
-       ../../src/hc12_objacces.o ../../src/hc12_lifegrd.o ../../src/hc12_timer.o ../../src/hc12_nmtMaster.o\
-       ../../drivers/hc12/canOpenDriver.o ../../drivers/hc12/ports.o ../../drivers/hc12/interrupt.o\
-       ../../drivers/hc12/timerhw.o ../../drivers/hc12/variahw.o $(MASTER_OBJS)
-
-LDFLAGS= -Wl,-m,m68hc12elfb -L$(MEMORY_X)
-
-all: $(PGR).elf $(PGR).s19 $(PGR).b $(PGR).s MSG
-
-%o: %c
-	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -c -o $@ $<
-
-%o: %s
-	$(CC)  -c -x assembler-with-cpp $(PROG_CFLAGS) -o  $@ $<
-
-$(PGR).elf: $(OBJS)
-	$(CC) $(CFLAGS) $(LDFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ $(OBJS)
-
-$(PGR).s19: $(PGR).elf
-	$(OBJCOPY) --output-target=srec $(OBJCOPY_FLAGS) $< $@
-
-$(PGR).b: $(PGR).elf
-	$(OBJCOPY) --output-target=binary --gap-fill=255 --only-section=.data $(OBJCOPY_FLAGS) $< $@
-
-$(PGR).s: $(PGR).elf
-	@echo "Desassemble"
-	$(BINUTILS_PREFIX)objdump -D $(PGR).elf > $(PGR).s
-
-MSG:
-	$(BINUTILS_PREFIX)readelf -S $(PGR).elf
-	@echo
-	$(BINUTILS_PREFIX)size $(PGR).elf
-
-clean:
-	rm -f $(MASTER_OBJS)
-
-mrproper: clean
-	rm -f $(PGR).elf $(PGR).s19 $(PGR).b $(PGR).s
-
--- a/examples/AppliMaster_HCS12/appli.c	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1143 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack. 
-
-Copyright (C): Edouard TISSERANT and Francis DUPIN
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <stddef.h> /* for NULL */
-
-#include <asm-m68hc12/portsaccess.h>
-#include <asm-m68hc12/ports_def.h>
-#include <asm-m68hc12/ports.h>
-#include  <interrupt.h>
-
-#include <applicfg.h>
-#include <candriver.h>
-#include <timerhw.h>
-
-#include "def.h"
-#include "can.h"
-#include "objdictdef.h"
-#include "objacces.h"
-#include "canOpenDriver.h"
-#include "sdo.h"
-#include "pdo.h"
-#include "init.h"
-#include "timer.h"
-#include "lifegrd.h"
-#include "sync.h"
-
-#include "nmtMaster.h"
-
-// For prototype of exit();
-#define exit _exit
-
-
-
-
-// HCS12 configuration
-// -----------------------------------------------------
-
-enum E_CanBaudrate 
-{
-   CAN_BAUDRATE_250K,
-   CAN_BAUDRATE_500K,
-   CAN_BAUDRATE_1M,
-   CAN_BAUDRATE_OLD_VALUE
-};
-
-const canBusTime CAN_Baudrates[] =
-{
-   {
-      1,  /* clksrc: Use the bus clock : 16 MHz, the freq. of the quartz's board        */
-      3,  /* brp :  chose btw 0 and 63 (6 bits).  freq time quantum = 16MHz / (brp + 1) */
-      0,  /* sjw : chose btw 0 and 3 (2 bits). Sync on (sjw + 1 ) time quantum          */
-      0,  /* samp : chose btw 0 and 3 (2 bits) (samp + 1 ) samples per bit              */
-      1,  /* tseg2 : chose btw 0 and 7 (3 bits) Segment 2 width = (tseg2 + 1)  tq       */
-     12,  /* tseg1 : chose btw 0 and 15 (4 bits) Segment 1 width = (tseg1 + 1)  tq      */
-
-      /*
-      With these values, 
-      - The width of the bit time is 16 time quantum :
-          - 1 tq for the SYNC segment (could not be modified)
-          - 13 tq for the TIME 1 segment (tseg1 = 12)
-          - 2 tq for the TIME 2 segment (tseg2 = 1)
-      - Because the bus clock of the MSCAN is 16 MHZ, and the 
-        freq of the time quantum is 4 MHZ (brp = 3+1), and  there are 16 tq in the bit time,
-        so the freq of the bit time is 250 kHz.
-      */
-   },
-
-   {
-      1,  /* clksrc: Use the bus clock : 16 MHz, the freq. of the quartz's board        */
-      1,  /* brp :  chose btw 0 and 63 (6 bits).  freq time quantum = 16MHz / (brp + 1) */
-      0,  /* sjw : chose btw 0 and 3 (2 bits). Sync on (sjw + 1 ) time quantum          */
-      0,  /* samp : chose btw 0 and 3 (2 bits) (samp + 1 ) samples per bit              */
-      1,  /* tseg2 : chose btw 0 and 7 (3 bits) Segment 2 width = (tseg2 + 1)  tq       */
-     12,  /* tseg1 : chose btw 0 and 15 (4 bits) Segment 1 width = (tseg1 + 1)  tq      */
-
-      /*
-      With these values, 
-      - The width of the bit time is 16 time quantum :
-          - 1 tq for the SYNC segment (could not be modified)
-          - 13 tq for the TIME 1 segment (tseg1 = 12)
-          - 2 tq for the TIME 2 segment (tseg2 = 1)
-      - Because the bus clock of the MSCAN is 16 MHZ, and the 
-        freq of the time quantum is 8 MHZ (brp = 1+1), and  there are 16 tq in the bit time,
-        so the freq of the bit time is 500 kHz.
-      */
-    },
-
-	{
-      1,  /* clksrc: Use the bus clock : 16 MHz, the freq. of the quartz's board        */
-      1,  /* brp :  chose btw 0 and 63 (6 bits).  freq time quantum = 16MHz / (brp + 1) */
-      0,  /* sjw : chose btw 0 and 3 (2 bits). Sync on (sjw + 1 ) time quantum          */
-      0,  /* samp : chose btw 0 and 3 (2 bits) (samp + 1 ) samples per bit              */
-      1,  /* tseg2 : chose btw 0 and 7 (3 bits) Segment 2 width = (tseg2 + 1)  tq       */
-      4,  /* tseg1 : chose btw 0 and 15 (4 bits) Segment 1 width = (tseg1 + 1)  tq      */
-
-      /*
-      With these values, 
-      - The width of the bit time is 16 time quantum :
-          - 1 tq for the SYNC segment (could not be modified)
-          - 5 tq for the TIME 1 segment (tseg1 = 4)
-          - 2 tq for the TIME 2 segment (tseg2 = 1)
-      - Because the bus clock of the MSCAN is 16 MHZ, and the 
-        freq of the time quantum is 8 MHZ (brp = 1+1), and  there are 8 tq in the bit time,
-        so the freq of the bit time is 1 MHz.
-      */
-    },
-
-	{
-      1,  /* clksrc: Use the bus clock : 16 MHz, the freq. of the quartz's board        */
-      0,  /* brp :  chose btw 0 and 63 (6 bits).  freq time quantum = 16MHz / (brp + 1) */
-      1,  /* sjw : chose btw 0 and 3 (2 bits). Sync on (sjw + 1 ) time quantum          */
-      1,  /* samp : chose btw 0 and 3 (2 bits) (samp + 1 ) samples per bit              */
-      4,  /* tseg2 : chose btw 0 and 7 (3 bits) Segment 2 width = (tseg2 + 1)  tq       */
-      9,  /* tseg1 : chose btw 0 and 15 (4 bits) Segment 1 width = (tseg1 + 1)  tq      */
-
-      /*
-      With these values, 
-      - The width of the bit time is 16 time quantum :
-          - 1 tq for the SYNC segment (could not be modified)
-          - 10 tq for the TIME 1 segment (tseg1 = 9)
-          - 5 tq for the TIME 2 segment (tseg2 = 4)
-      - Because the bus clock of the MSCAN is 16 MHZ, and the 
-        freq of the time quantum is 16 MHZ (brp = 0), and  there are 16 tq in the bit time,
-        so the freq of the bit time is 1 MHz.
-      */
-    }
-};
-
-
-
-// Required definition variables
-// -----------------------------
-// The variables that you should define for debugging.
-// They are used by the macro MSG_ERR and MSG_WAR in applicfg.h
-// if the node is a slave, they can be mapped in the object dictionnary.
-
-UNS8 printMsgErrToConsole = 1;
-UNS8 printMsgWarToConsole = 1;
-
-// The variables mapped in the object dictionnary
-// ----------------------------------------------
-extern UNS32 canopenErrNB_node5;   // Mapped at index 0x6000, subindex 0x0
-extern UNS32 canopenErrVAL_node5;  // Mapped at index 0x6001, subindex 0x0
-extern UNS8 second;		   // Mapped at index 0x6002, subindex 0x1
-extern UNS8 minutes;		   // Mapped at index 0x6002, subindex 0x2
-extern UNS8 hour;		   // Mapped at index 0x6002, subindex 0x3
-extern UNS8 day;		   // Mapped at index 0x6002, subindex 0x4
-extern UNS32 canopenErrNB;	   // Mapped at index 0x6003, subindex 0x1
-extern UNS32 canopenErrVAL;	   // Mapped at index 0x6003, subindex 0x2
-
-/*************************User's variables declaration**************************/
-UNS8 connectedNode[128];
-volatile UNS8 sec = 0; // To count the time every second
-UNS8 softCount = 0;
-
-/* The variable to map in a PDO is defined at index and subIndex. Its length is size bytes */
-typedef struct mappedVar 
-{
-  UNS32 index;
-  UNS8  subIndex;
-  UNS8  size; // in byte
-} s_mappedVar;
-
-typedef struct heartbeatConsumer
-{
-  UNS8 nodeProducer;
-  UNS16 time_ms;
-} s_heartbeatConsumer;
-
-/**************************prototypes*****************************************/
-/* You *must* have these 2 functions in your code*/
-void heartbeatError(UNS8 heartbeatID );
-void SD0timeoutError(UNS8 bus_id, UNS8 line);
-
-void waitMessage (void );
-void heartBeat (void );
-void transmitSync (void);
-e_nodeState stateNode (UNS8 node);
-void configure_master_SDO (UNS32 index, UNS8 serverNode);
-UNS8 waitingWriteToSlaveDict ( UNS8 slaveNode, UNS8 error);
-UNS8 waitingReadToSlaveDict (UNS8 slaveNode, void * data, UNS8 * size, UNS8 error);
-UNS8 configure_client_SDO (UNS8 slaveNode, UNS8 clientNode);
-void masterMappingPDO (UNS32 indexPDO, UNS32 cobId, 
-		      s_mappedVar *tabMappedVar, UNS8 nbVar);
-void slaveMappingPDO (UNS8 slaveNode, UNS32 indexPDO, UNS32 cobId, 
-		     s_mappedVar *tabMappedVar, UNS8 nbVar);
-void masterHeartbeatConsumer (s_heartbeatConsumer 
-			     *tabHeartbeatConsumer, UNS8 nbHeartbeats);
-void masterHeartbeatProducer (UNS16 time);
-void slaveHeartbeatConsumer (UNS8 slaveNode, s_heartbeatConsumer 
-			    *tabHeartbeatConsumer, UNS8 nbHeartbeats);
-void slaveHeartbeatProducer (UNS8 slaveNode, UNS16 time);
-void masterPDOTransmissionMode (UNS32 indexPDO,  UNS8 transType);
-void slavePDOTransmissionMode (UNS8 slaveNode, UNS32 indexPDO,  UNS8 transType);
-void masterSYNCPeriod (UNS32 SYNCPeriod);
-int main (void);
-
-// Interruption timer 3. (The timer 4 is used by CanOpen)
-void __attribute__((interrupt)) timer3Hdl (void);
-void incDate (void);
-void initLeds (void);
-void initCanHCS12 (void);
-void initTimerClk (void);
-
-
-/*****************************************************************************/
-void heartbeatError(UNS8 heartbeatID)
-{
-  // MSG_ERR should send the values canopenErrNB and canopenErrVAL on event in a PDO,
-  // But we do not have mapped the variables in a PDO, so it sends nothing.
-  // See the note at the end of END CONFIGURING THE NETWORK.
-  MSG_WAR(0x2F00, "HeartBeat, no response from node : ", heartbeatID);
-}
-
-/*****************************************************************************/
-void SD0timeoutError (UNS8 bus_id, UNS8 line)
-{
-  // Informations on what occurs are in transfers[bus_id][line]....
-  // See scanSDOtimeout() in sdo.c
-}
-
-//------------------------------------------------------------------------------
-/************************** FUNCTIONS TO CONFIGURE THE NETWORK******************/
-
-//------------------------------------------------------------------------------
-/* Node mode result after NodeGuard query */
-e_nodeState stateNode(UNS8 node) 
-{
-  e_nodeState state = getNodeState(0, node);
-  switch (state) {
-  case Unknown_state: 
-    MSG_WAR(0x3F05, "Not connected (Does not have sent its status) node :", node);
-    break;
-  case Operational: 
-    MSG_WAR(0x3F06, "Ok, in operational mode, node : ", node);
-    break;
-  case Pre_operational: 
-    MSG_WAR(0x3F07, "OK in pre-operational mode, node : ", node);
-    break;
-  default:
-    MSG_WAR(0x3F08, "OK connected but in curious mode, node : ", node);
-  }
-  return state;
-}
-
-//------------------------------------------------------------------------------
-/* The master is writing in its dictionnary to configure the SDO parameters 
-to communicate with server_node
-*/
-void configure_master_SDO(UNS32 index, UNS8 serverNode)
-{
-  UNS32 data32;
-  UNS8  data8;
-  UNS8 sizeData = 4 ; // in bytes
-
-  /* At subindex 1, the cobId of the Can message from the client.
-  It is always defined inside the server dictionnary as 0x600 + server_node.
-  So, we have no choice here ! */
-  data32 = 0x600 + serverNode;
-  setODentry(index, 1, &data32, sizeData, 0);
-
-  {
-    // Test
-    UNS32  *pbData;
-    UNS8 length;
-    UNS32 returnValue;
-    UNS8 dataType;
-    // Relecture
-    MSG_WAR(0x1000, "Reading index : ", index);
-    MSG_WAR(0x1000, "     subindex : ", 1);
-    returnValue = getODentry(index, 1, (void * *)&pbData, (UNS8 *)&length, &dataType, 0);
-    MSG_WAR(0x1000, "          val : ", *pbData);
-  }
-
-
-  /* At subindex 2, the cobId of the Can message from the server to the client.
-  It is always defined inside the server dictionnary as 0x580 + client_node.
-  So, we have no choice here ! */
-  data32 = 0x580 + serverNode;
-  setODentry(index, 2, &data32, sizeData, 0);
-
-  /* At subindex 3, the node of the server */
-  data8 = serverNode;
-  sizeData = 1;
-  setODentry(index, 3, &data8, sizeData, 0);
-
-  {
-    UNS8  *pbData;
-    UNS8 length;
-    UNS32 returnValue;
-    UNS8 dataType;
-    // Relecture
-    MSG_WAR(0x1000, "Reading  index : ", index);
-    MSG_WAR(0x1000, "      subindex : ", 3);
-    returnValue = getODentry(index, 1, (void * *)&pbData, (UNS8 *)&length, &dataType, 0);
-    MSG_WAR(0x1000, "           val : ", *pbData);
-  }
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-UNS8 waitingWriteToSlaveDict(UNS8 slaveNode, UNS8 error)
-{
-   UNS8 err;
-  UNS32 abortCode;
-  MSG_WAR(0x3F21, "Sending SDO to write in dictionnary of node : ", slaveNode);
-  if (error) {
-    MSG_ERR(0x1F22, "Unable to send the SDO to node ", slaveNode);
-    return -1;
-  }
-  /* Waiting until the slave has responded */
-  while (getWriteResultNetworkDict (0, slaveNode, &abortCode) == SDO_DOWNLOAD_IN_PROGRESS) {
-    // Check if some SDO response are missing
-    scanSDOtimeout();
-  }
-
-  err = getWriteResultNetworkDict (0, slaveNode, &abortCode);
-  if (err == SDO_FINISHED) {
-    MSG_WAR(0x3F22, "SDO download finished to Node : ", slaveNode);
-    // Release the line. Don't forget !!!
-    closeSDOtransfer(0, slaveNode, SDO_CLIENT);
-    return 0;
-  }
-
-  if (err == SDO_ABORTED_RCV) {
-    MSG_WAR(0x2F20, "Received SDO abort from node : ", slaveNode);
-  }
-
-  if (err == SDO_ABORTED_INTERNAL) {
-    MSG_WAR(0x2F20, "Internal SDO abort for node : ", slaveNode);
-  }
-  // Looking for the line transfert number to read the index, subindex and releasing the line.
-  {
-    UNS8 line;
-    err = getSDOlineOnUse(0, slaveNode, SDO_CLIENT, &line);
-    if (err) {
-      MSG_WAR(0x2F21, "No line found for node : ", slaveNode);
-      exit(-1);
-    }
-    MSG_WAR (0x2F22, "while writing at his index : ", transfers[0][line].index);
-    MSG_WAR (0x2F23, "                  subIndex : ", transfers[0][line].subIndex);
-    //Releasing the line.
-    closeSDOtransfer(0, slaveNode, SDO_CLIENT);
-    exit(-1);
-  }
- return 0;
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-UNS8 waitingReadToSlaveDict(UNS8 slaveNode, void * data, UNS8 * size, UNS8 error)
-{
-  UNS8 err;
-  UNS32 abortCode;
-  MSG_WAR(0x3F2A, "Sending SDO to read in dictionnary of node : ", slaveNode);
-  if (error) {
-    MSG_ERR(0x1F2B, "Unable to send the SDO to node ", slaveNode);
-    return -1;
-  }
-  /* Waiting until the slave has responded */
-  while (getReadResultNetworkDict (0, slaveNode, data, size, &abortCode) == SDO_UPLOAD_IN_PROGRESS) {
-    // Check if some SDO response are missing
-    scanSDOtimeout();
-  }
-  err = getReadResultNetworkDict (0, slaveNode, data, size, &abortCode);
-  if (err == SDO_FINISHED) {
-    MSG_WAR(0x3F2C, "SDO upload finished to Node : ", slaveNode);
-    // Release the line. Don't forget !!!
-    closeSDOtransfer(0, slaveNode, SDO_CLIENT);
-    return 0;
-  }
-  if (err == SDO_ABORTED_RCV) {
-    MSG_WAR(0x2F2D, "Received SDO abort from node : ", slaveNode);
-  }
-
-  if (err == SDO_ABORTED_INTERNAL) {
-    MSG_WAR(0x2F2E, "Internal SDO abort for node : ", slaveNode);
-  }
-  // Looking for the line transfert number to read the index, subindex and releasing the line.
-  {
-    UNS8 line;
-    err = getSDOlineOnUse(0, slaveNode, SDO_CLIENT, &line);
-    if (err) {
-      MSG_WAR(0x2F2F, "No line found for node : ", slaveNode);
-      exit(-1);
-    }
-    MSG_WAR (0x2F30, "while writing at his index : ", transfers[0][line].index);
-    MSG_WAR (0x2F31, "                  subIndex : ", transfers[0][line].subIndex);
-    //Releasing the line.
-    closeSDOtransfer(0, slaveNode, SDO_CLIENT);
-    exit(-1);
-  }    
-
- return 0;
-}
-
-//------------------------------------------------------------------------------
-/* The master is writing in the slave dictionnary to configure the SDO parameters
-Remember that the slave is the server, and the master is the client.
- */
-UNS8 configure_client_SDO(UNS8 slaveNode, UNS8 clientNode)
-{
-  UNS8 data;
-  UNS8 NbDataToWrite = 1 ; // in bytes
-  UNS8 err = 0;
-  MSG_WAR(0x3F20, "Configuring SDO by writing in dictionnary Node ", slaveNode);
-  /* It is only to put at subindex 3 the serverNode. It is optionnal.
-     In the slave dictionary, only one SDO server is defined, at index 
-     0x1200 */
-  data = clientNode;
-  err = writeNetworkDict(0, slaveNode, 0x1200, 3, NbDataToWrite, 0, &data); 
-  waitingWriteToSlaveDict(slaveNode, err);
- 
-  return 0;
-}		
-  
-//------------------------------------------------------------------------------
-/*
- */
-
-void masterMappingPDO(UNS32 indexPDO, UNS32 cobId, 
-		      s_mappedVar *tabMappedVar, UNS8 nbVar)
-{
-  UNS32 *pbData;
-  UNS32 data32; 
-  UNS8 i;
-  UNS8 size = 0;
-  UNS8 dataType;
-
-  if ((indexPDO >= 0x1400) && (indexPDO <= 0x15FF))
-    MSG_WAR(0x3F30, "Configuring MASTER for PDO receive, COBID : ", cobId);
-
-  if ((indexPDO >= 0x1800) && (indexPDO <= 0x19FF))
-    MSG_WAR(0x3F31, "Configuring MASTER for PDO transmit, COBID : ", cobId);
-
-  /* At indexPDO, subindex 1, defining the cobId of the PDO */
-  setODentry(indexPDO, 1, &cobId, 4, 0);
-  /* The mapping ... */
-  /* ----------------*/
-  /* At subindex 0, the number of variables in the PDO */
-  setODentry(indexPDO + 0x200, 0, &nbVar, 1, 0);
-  getODentry(indexPDO + 0x200, 0, (void * *)&pbData, &size, &dataType, 0);
-  /* At each subindex 1 .. nbVar, The index,subindex and size of the variable to map in 
-     the PDO. The first variable after the COBID is defined at subindex 1, ... 
-     The data to write is the concatenation on 32 bits of (msb ... lsb) : 
-     index(16b),subIndex(8b),sizeVariable(8b)
-*/
-  for (i = 0 ; i < nbVar ; i++) {
-    data32 = ((tabMappedVar + i)->index << 16) |
-      (((tabMappedVar + i)->subIndex & 0xFF) << 8) |
-      ((tabMappedVar + i)->size & 0xFF);
-    // Write dictionary
-    setODentry(indexPDO + 0x200, i + 1, &data32, 4, 0);
-
-#   ifdef MORE_COMMENTS
-    printf("Mapped variable defined  at index 0x%X, subIndex 0x%X, %d bits\n", 
-	   (tabMappedVar + i)->index, (tabMappedVar + i)->subIndex, 8 * (tabMappedVar + i)->size);
-    // Only to verify.
-    // Read dictionnary
-    getODentry(indexPDO + 0x200, i + 1, (void * *)&pbData, &size, &dataType, 0);
-    printf("Writen à  index 0x%X, subIndex 0x%X, %d bits : 0x%08X\n", 
-	   indexPDO + 0x200, i + 1, 8 * size, *pbData);
-#   endif
-    
-  }
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-
-void slaveMappingPDO(UNS8 slaveNode, UNS32 indexPDO, UNS32 cobId, 
-		     s_mappedVar *tabMappedVar, UNS8 nbVar)
-{
-  UNS32 data32; 
-  UNS8 i;
-  UNS8 err;
-  UNS8 nbBytes = 1;
-  if ((indexPDO >= 0x1400) && (indexPDO <= 0x15FF))
-    MSG_WAR(0x3F32, "Configuring slave for PDO receive, COBID : ", cobId);
-
-  if ((indexPDO >= 0x1800) && (indexPDO <= 0x19FF))
-    MSG_WAR(0x3F33, "Configuring slave for PDO transmit, COBID : ", cobId);
-
-  /* At indexPDO, subindex 1, defining the cobId of the PDO */
-  err = writeNetworkDict(0, slaveNode, indexPDO, 1, 4, 0, &cobId); 
-  waitingWriteToSlaveDict(slaveNode, err);
-
-  /* The mapping ... */
-  /* ----------------*/
-  /* At subindex 0, the number of variables in the PDO */
-  err = writeNetworkDict(0, slaveNode, indexPDO + 0x200, 0, nbBytes, 0, &nbVar); 
-  waitingWriteToSlaveDict(slaveNode, err);
-
-  /* At each subindex 1 .. nbVar, The index,subindex and size of the variable to map in 
-     the PDO. The first variable after the COBID is defined at subindex 1, ... 
-     The data to write is the concatenation on 32 bits of (msb ... lsb) : 
-     index(16b),subIndex(8b),sizeVariable(8b)
-*/
-  for (i = 0 ; i < nbVar ; i++) {
-    data32 = ((tabMappedVar + i)->index << 16) |
-      (((tabMappedVar + i)->subIndex & 0xFF) << 8) |
-      ((tabMappedVar + i)->size & 0xFF);
-
-    // Write dictionary
-    err = writeNetworkDict(0, slaveNode, indexPDO + 0x200, i + 1, 4, 0, &data32); 
-    waitingWriteToSlaveDict(slaveNode, err);
-
-#   ifdef MORE_COMMENTS
-    printf("Mapped variable defined  at index 0x%X, subIndex 0x%X, %d bits\n", 
-	   (tabMappedVar + i)->index, (tabMappedVar + i)->subIndex, 8 * (tabMappedVar + i)->size);
-
-    printf("At node 0x%X Writen at  index 0x%X, subIndex 0x%X, %d bits : 0x%08X\n", 
-	   slaveNode, indexPDO + 0x200, i + 1, 32, data32);
-#   endif
-    
-  }
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-void masterHeartbeatConsumer(s_heartbeatConsumer 
-			     *tabHeartbeatConsumer, UNS8 nbHeartbeats)
-{
-  UNS32 data;
-  UNS8 i;
-  UNS8 nbHB = nbHeartbeats;
-
-  MSG_WAR(0x3F40, "Configuring heartbeats consumers for master", 0);
-  /* At index 1016, subindex 0 : the nb of consumers (ie nb of nodes of which are expecting heartbeats) */
-  setODentry(0x1016, 0, & nbHB, 1, 0);
-  
-  /* At Index 1016, subindex 1, ... : 32 bit values : msb ... lsb :
-     00 - node_consumer (8b) - time_ms (16b)
-     Put 0 to ignore the entry.
-  */
-  for (i = 0 ; i < nbHeartbeats ; i++) {
-    data = (((tabHeartbeatConsumer + i)->nodeProducer & 0xFF)<< 16) | ((tabHeartbeatConsumer + i)->time_ms & 0xFFFF);
-    setODentry(0x1016, i + 1, & data, 4, 0);
-  }
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-
-void masterHeartbeatProducer(UNS16 time)
-{
-  UNS16 hbTime = time;
-  MSG_WAR(0x3F45, "Configuring heartbeat producer for master", 0);
-  /* At index 1017, subindex 0, defining the time to send the heartbeat. Put 0 to never send heartbeat */
-  setODentry(0x1017, 0, &hbTime, 2, 0);
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-void slaveHeartbeatConsumer(UNS8 slaveNode, s_heartbeatConsumer 
-			    *tabHeartbeatConsumer, UNS8 nbHeartbeats)
-{
-  UNS32 data;
-  UNS8 err;
-  UNS8 i;
-  
-  MSG_WAR(0x3F46, "Configuring heartbeats consumers for node  : ", slaveNode);
-  
-  /* At Index 1016, subindex 1, ... : 32 bit values : msb ... lsb :
-     00 - node_consumer (8b) - time_ms (16b)
-     Put 0 to ignore the entry.
-  */
-  for (i = 0 ; i < nbHeartbeats ; i++) {
-    data = (((tabHeartbeatConsumer + i)->nodeProducer & 0xFF)<< 16) | 
-      ((tabHeartbeatConsumer + i)->time_ms & 0xFFFF);
-    err = writeNetworkDict(0, slaveNode, 0x1016, i + 1, 4, 0, &data); 
-    waitingWriteToSlaveDict(slaveNode, err);
-  }
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-
-void slaveHeartbeatProducer(UNS8 slaveNode, UNS16 time)
-{
-  UNS8 err;
-  MSG_WAR(0x3F47, "Configuring heartbeat producer for node  : ", slaveNode);
-  /* At index 1017, subindex 0, defining the time to send the heartbeat. Put 0 to never send heartbeat */
-
-  err = writeNetworkDict(0, slaveNode, 0x1017, 0, 2, 0, &time); 
-  waitingWriteToSlaveDict(slaveNode, err);
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-
-void masterPDOTransmissionMode(UNS32 indexPDO,  UNS8 transType)
-{
-  MSG_WAR(0x3F48, "Configuring transmission from master, indexPDO : ", indexPDO);
- 
-  /* At subindex 2, the transmission type */
-  setODentry(indexPDO, 2, &transType, 1, 0);
-}
-
-
-//------------------------------------------------------------------------------
-/*
- */
-
-void slavePDOTransmissionMode(UNS8 slaveNode, UNS32 indexPDO,  UNS8 transType)
-{
-  UNS8 err;
-  MSG_WAR(0x3F41, "Configuring transmission mode for node : ", slaveNode);
-  MSG_WAR(0x3F42, "                              indexPDO : ", indexPDO);
-
-  err = writeNetworkDict(0, slaveNode, indexPDO, 2, 1, 0, &transType); 
-  waitingWriteToSlaveDict(slaveNode, err);
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-
-void masterSYNCPeriod(UNS32 SYNCPeriod)
-{
- UNS32 cobId = 0x40000080;
- MSG_WAR(0x3F49, "Configuring master to send SYNC every ... micro-seconds :", SYNCPeriod);
- /* At index 0x1006, subindex 0 : the period in ms */
- setODentry(0x1006, 0, &SYNCPeriod , 4, 0);
- /* At index 0x1005, subindex 0 : Device generate SYNC signal with CobId 0x80 */
- setODentry(0x1005, 0, &cobId, 4, 0);
-}
-
-//------------------------------------------------------------------------------
-
-
-//Initialisation of the port B for the leds.
-void initLeds(void)
-{
-  // Port B is output
-  IO_PORTS_8(DDRB)= 0XFF;
-  // RAZ
-  IO_PORTS_8(PORTB) = 0xFF;
-}
-
-//------------------------------------------------------------------------------
-
-
-
-void initCanHCS12 (void)
-{  
-  //Init the HCS12 microcontroler for CanOpen 
-  initHCS12();
-   // Init the HCS12  CAN driver
-  const canBusInit bi0 = {
-    0,    /* no low power                 */ 
-    0,    /* no time stamp                */
-    1,    /* enable MSCAN                 */
-    0,    /* clock source : oscillator (In fact, it is not used)   */
-    0,    /* no loop back                 */
-    0,    /* no listen only               */
-    0,    /* no low pass filter for wk up */
-	CAN_Baudrates[CAN_BAUDRATE_250K],
-    {
-      0x00,    /* Filter on 16 bits. See Motorola Block Guide V02.14 fig 4-3 */
-      0x00, 0xFF, /* filter 0 hight accept all msg      */
-      0x00, 0xFF, /* filter 0 low accept all msg        */
-      0x00, 0xFF, /* filter 1 hight filter all of  msg  */
-      0x00, 0xFF, /* filter 1 low filter all of  msg    */
-      0x00, 0xFF, /* filter 2 hight filter most of  msg */
-      0x00, 0xFF, /* filter 2 low filter most of  msg   */
-      0x00, 0xFF, /* filter 3 hight filter most of  msg */
-      0x00, 0xFF, /* filter 3 low filter most of  msg   */
-    }
-  };   
-
-  canInit(CANOPEN_LINE_NUMBER_USED, bi0);  //initialize filters...
-  unlock(); // Allow interruptions
-}
-
-/*********************************************************************/
-// For Second timer
-void incDate(void)
-{
-  if (sec == 59) 
-    sec = 0;
-  else
-    sec++;
-
-  // Toggle the led 4 every seconds
-  IO_PORTS_8(PORTB) ^= 0x10;
-
-}
-
-// Init the time for the second counter
-void initTimerClk(void)
-{
-
-  lock();   // Inhibe les interruptions
-
-  // Configuration du Channel 3
-  IO_PORTS_8(TIOS) |= 0x08;     // Canal 3 en sortie
-  IO_PORTS_8(TCTL2) &= ~(0xC0); // Canal 3 déconnecté du pin de sortie
-  IO_PORTS_8(TIE) |= 0x08;      // Autorise interruption Canal 3
-  IO_PORTS_8(TSCR1) |= 0x80;    // Mise en route du timer
-  unlock(); // Autorise les interruptions
-}
-
-
-/*********************************************************************/
-void __attribute__((interrupt)) timer3Hdl(void)
-{
-  //IO_PORTS_8(PORTB) ^= 0x10;
-  //IO_PORTS_8(PORTB) &= ~0x20;
-  IO_PORTS_8(TFLG1) = 0x08; // RAZ du flag interruption timer 3
-  // Calcul evt suivant. Clock 8 MHz -> 8000 evt de 1 ms!! Doit tenir sur 16 bits
-  // Attention, ça change si on utilise la pll
-  // Lorsque le timer atteindra la valeur de TC3 (16 bits), l'interruption timer3Hdl sera déclenchée
-  // Si on utilise la PLL à 24 MHZ, alors la vitesse du bus est multipliée par 3.
-
-/*   Assume that our board uses a 16 MHz quartz */
-/*   Without pre-division, 8000 counts takes 1 ms. */
-/*   We are using a pre-divisor of 32. (register TSCR2) See in CanOpenDriverHC12/timerhw.c  */
-/*   So 1000 counts takes 4 ms. */
-/*   We must have a soft counter of 250 to count a second. */
-  
-/*
-  We check in an interrupt handler if a message is arrived.
-*/
-  receiveMsgHandler(0);
-
-  IO_PORTS_16(TC3H) += (1000); // IT every 4000 count.
-  softCount++;
-  if (softCount == 250) {
-    softCount = 0;
-    incDate();
-  }
-}
-
-
-
-
-/*****************************************************************************/
-
-
-
-/********************************* MAIN ***************************************/
-
- 
-int main()
-{
-
-  UNS8 second_last;
-  UNS8 minutes_last;
-  UNS8 sendingResetError = 0;
-  UNS8 ok, i;
-
-  /* initialisation du bus Can */
-  initCanHCS12();  
- 
-  /* arrays initialisation, etc */
-  initCANopenMain();     
-      
-  /* arrays initialisation, etc */
-  initCANopenMaster();  
-
-/* Defining the node Id */
-  setNodeId(0x01);
-  MSG_WAR(0x3F50, "My node ID is : ", getNodeId()); 
-
-  /* Put the master in operational mode */
-  setState(Operational);
-
- /* Init the table of connected nodes */
-  for (i = 0 ; i < 128 ; i++)
-    connectedNode[i] = 0;
-
-  /* Initialisation */
-  initLeds();
-  initTimer( );
-  initTimerClk();
-    
-
-
-  /******************** CONFIGURING THE NETWORK **************************/
-  
-  /* Which nodes are connected ? */
-  /* Sending a request Node guard to node 5 and 6 */
-  MSG_WAR(0x3F04, "Sending a node guard to node : ", 5);
-  masterReadNodeState(0, 0x05);
-
-  /* Sending a message to the node 6, only as example */
-  MSG_WAR(0x3F04, "Sending a node guard to node : ", 6);
-  masterReadNodeState(0, 0x06);
-  /* Waiting for a second the response */
-  sec = 0;
-  while (sec < 2) {};
-
-  /* Whose node have answered ? */
-  connectedNode[5] = stateNode(5);
-  if (connectedNode[5] != Unknown_state) {
-    MSG_WAR(0x3F06, "Node 5 connected. Its state is : ", connectedNode[5]);
-  }
-  else {
-    MSG_WAR(0x3F07, "Node 5 NOT connected ", connectedNode[5]);
-  }
-
-  connectedNode[6] = stateNode(6);
-  if (connectedNode[6] != Unknown_state) {
-    MSG_WAR(0x3F08, "Node 6 connected. Its state is : ", connectedNode[6]);
-  }
-  else {
-    MSG_WAR(0x3F09, "Node 6 NOT connected ", connectedNode[6]);
-  }
-
-  /* Configure the SDO master to communicate with node 5 and node 6 */
-  configure_master_SDO(0x1280, 0x05);
-  /* Configure the SDO of node 5 */
-  /* getNodeId() returns my node Id */
-  configure_client_SDO(0x05, getNodeId());
-
-  /* Mapping of the PDO 
-     Chose some COBID in (hexa) 181-1FF, 201-27F, 281-2FF, 301-37F, 
-     381-3FF, 401-47F, 481-4FF, 501-57F,
-     without other restriction.
-     (Of course, you must not define 2 PDO transmit with the same cobId !!)
-  */
- 
-  /*
-     *** PDO node 1 <-- node 5 ***
-     *** cobId 0x181 *************
-     MASTER (node 1)
-     Mapped to variables (node1) [index-subindex-size_bits]: 
-       day    [0x6002 - 0x04 - 8]
-       hour   [0x6002 - 0x03 - 8]
-       second [0x6002 - 0x01 - 8]
-
-     SLAVE (node 5)
-     Mapped to variables (node5) [index-subindex-size_bits]: 
-       day    [0x2000 - 0x04 - 8]
-       hour   [0x2000 - 0x03 - 8]
-       second [0x2000 - 0x01 - 8]
-*/
-
-  /* Configuring the first PDO receive, defined at index 0x1400 and 0x1600 */
-  {
-    s_mappedVar tabMappedVar[8] = { {0x6002,4,8}, {0x6002,3,8}, {0x6002,1,8}, };
-    masterMappingPDO(0x1400, 0x181, tabMappedVar, 3);
-  }
-
-  /* Configuring the first PDO transmit, defined at index 0x1800 and 0x1A00 */
-  {
-    s_mappedVar tabMappedVar[8] = { {0x2000,4,8}, {0x2000,3,8}, {0x2000,1,8}, };
-    slaveMappingPDO(0x05, 0x1800, 0x181, tabMappedVar, 3);
-  }
-   /*
-     *** PDO node 1 <-- node 5 ***
-     *** cobId 0x182 *************
-     MASTER (node 1)
-     Mapped to variables (node1) [index-subindex-size_bits]: 
-       minute    [0x6002 - 0x02 - 8]
-
-     SLAVE (node 5)
-     Mapped to variables (node5) [index-subindex-size_bits]: 
-       minute    [0x2000 - 0x02 - 8]
-   */
-
-  /* Configuring PDO receive, defined at index 0x1400 and 0x1600 */
-  {
-    s_mappedVar tabMappedVar[8] = { {0x6002,2,8} };
-    masterMappingPDO(0x1401, 0x182, tabMappedVar, 1);
-  }
-
-  /* Configuring PDO transmit, defined at index 0x1800 and 0x1A00 */
-  {
-    s_mappedVar tabMappedVar[8] = { {0x2000,2,8} };
-    slaveMappingPDO(0x05, 0x1801, 0x182, tabMappedVar, 1);
-  }
-
-
-  /*
-     *** PDO node 1 <-- node 5 ***
-     *** cobId 0x183 *************
-     Error management :  By this way, The node can send by PDO an error
-     MASTER (node 1)
-     Mapped to variables (node1) [index-subindex-size_bits]: 
-       canopenErrNb_node5     [0x6000 - 0x00 - 32]
-       canopenErrVal_node5    [0x6001 - 0x00 - 32] 
-
-     SLAVE (node 5)
-     Mapped to variables (node5) [index-subindex-size_bytes]: 
-       canopenErrNb     [0x6000 - 0x00 - 32]
-       canopenErrVal    [0x6001 - 0x00 - 32]  
-  */
-
-  /* Configuring  PDO receive, defined at index 0x1402 and 0x1602 */
-  {
-    s_mappedVar tabMappedVar[8] = { {0x6000,0,32}, {0x6001, 0, 32}};
-    masterMappingPDO(0x1402, 0x183, tabMappedVar, 2);
-  }
-
-  /* Configuring PDO transmit, defined at index 0x1802 and 0x1A02 */
-  {
-    s_mappedVar tabMappedVar[8] = { {0x6000,0,32}, {0x6001, 0, 32}};
-    slaveMappingPDO(0x05, 0x1802, 0x183, tabMappedVar, 2);
-  }
- 
-  /*
-     *** PDO node 1 --> node 5 ***
-     *** cobId 0x184 *************
-     Error management :  To reset the error
-     MASTER (node 1)
-     Mapped to variables (node1) [index-subindex-size_bits]: 
-       canopenErrNb_node5     [0x6000 - 0x00 - 32]
-       canopenErrVal_node5    [0x6001 - 0x00 - 32] 
-
-     SLAVE (node 5)
-     Mapped to variables (node5) [index-subindex-size_bytes]: 
-       canopenErrNb     [0x6000 - 0x00 - 32]
-       canopenErrVal    [0x6001 - 0x00 - 32]  
-  */
-
-  /* Configuring  PDO transmit, defined at index 0x1803 and 0x1103 */
-  {
-    s_mappedVar tabMappedVar[8] = { {0x6000,0,32}, {0x6001, 0, 32}};
-    masterMappingPDO(0x1801, 0x184, tabMappedVar, 2);
-  }
-
-  /* Configuring PDO transmit, defined at index 0x1403 and 0x1603 */
-  {
-    s_mappedVar tabMappedVar[8] = { {0x6000,0,32}, {0x6001, 0, 32}};
-    slaveMappingPDO(0x05, 0x1400, 0x184, tabMappedVar, 2);
-  }
-
-  /* Configuring the node 5 heartbeat */
-  /* Check every 3000 ms if it have received a heartbeat from node 1 */
-  {
-    UNS8 nbHeartbeatsToReceive = 1;
-    s_heartbeatConsumer tabHeartbeatConsumer[10] = {{1, 0xBB8}};
-    slaveHeartbeatConsumer(0x05, tabHeartbeatConsumer, nbHeartbeatsToReceive);
-  }
-  /* Sending every 1000 ms an heartbeat */
-  slaveHeartbeatProducer(0x05, 0x3E8);
-
-  /* Configuring the master heartbeat */
-  /* Check every 3000 ms if it have received a heartbeat from node 5 */
-    {
-    UNS8 nbHeartbeatsToReceive = 1;
-    s_heartbeatConsumer tabHeartbeatConsumer[10] = {{5, 0xBB8}};
-    masterHeartbeatConsumer(tabHeartbeatConsumer, nbHeartbeatsToReceive);
-  }
-
-    /* Sending every 1000 ms an heartbeat */
-    masterHeartbeatProducer(0x3E8);
-
-
-    
-    /* Configuring the transmission mode of the PDO */
-    slavePDOTransmissionMode(0x05, 0x1800,  TRANS_EVERY_N_SYNC (1));
-    slavePDOTransmissionMode(0x05, 0x1801,  TRANS_EVENT);
-    slavePDOTransmissionMode(0x05, 0x1802,  TRANS_EVENT);
-    masterPDOTransmissionMode(0x1801,  TRANS_EVENT);
-
-
-    /* Configuring the master to send a SYNC message every 1 s */
-    /* Note than any other node can send the SYNC instead of the master */
-    masterSYNCPeriod(1000000); 
-
-    {
-      // Reading the period of heartbeat which has been written in node 5 dictionary
-      UNS8 node = 5;
-      UNS16 index = 0x1017;
-      UNS8 subindex = 0;
-      //UNS8 notused = 0;
-      UNS16 hb = 0;
-      UNS8  size_data = 0;
-      UNS8 error;
-      MSG_WAR(0x3F50, "Reading dictionary noeud 5, 1017/0", 0);
-      error = readNetworkDict(0, node, index, subindex, 0);
-      //error = readNetworkDict(0, node, index, subindex, &notused);
-      if (error) {
-	MSG_ERR(0x1F50, "!!! ERROR reading dictionary noeud 5, 1017/0", 0);
-	exit (-1);
-      }
-      /* Waiting until the server has responded */
-      error = waitingReadToSlaveDict(node,  (UNS16 *)&hb,  &size_data, error);
-      MSG_WAR(0x1F51, "Read dictionary of node 5, index/subindex 1017/0 value = ", hb);
-      MSG_WAR(0x1F51, "         size of data (bytes) = ", size_data);
-    }
-
-    /* Put the node 5 in operational mode 
-       The mode is changed according to the slave state machine mode :
-         initialisation  ---> pre-operational (Automatic transition)
-         pre-operational <--> operational
-         pre-operational <--> stopped
-         pre-operational, operational, stopped -> initialisation
-       NMT_Start_Node           // Put the node in operational mode       
-       NMT_Stop_Node		// Put the node in stopped mode    
-       NMT_Enter_PreOperational // Put the node in pre_operational mode
-       NMT_Reset_Node		// Put the node in initialization mode 
-       NMT_Reset_Comunication	// Put the node in initialization mode 
-    */
-    masterSendNMTstateChange(0, 0x05, NMT_Start_Node);
-
-    // Note
-    //-----
-    // We do not have mapped the variable canopenErrNB and canopenErrVAL.
-    // We should have done that !
-    // the macro MSG_ERR try to send the PDO(s) which contains these two variables.
-    // While the PDO will not be found, if you are printing the warnings in file pdo.c,
-    // it will print "0X393B Unable to send variable on event :  not mapped in a PDO to send on event" for  
-    // example when you enter the function heartbeatError. 
-
-   /******************** END CONFIGURING THE NETWORK **********************/
-    
-    
-    
-    /* Init the errors values that may send the node 5 */
-    canopenErrNB_node5 = 0;
-    canopenErrVAL_node5 = 0;
-
-    /***********/
-    /* Running */
-    /***********/
-
-  /* SDO test with node 5 */
-  /* This code may takes too much room in memory if you are also debugging the file sdo.c */
-  {
-    // Reading string
-    UNS8 dataW[20];
-    UNS8 dataR[20];
-    UNS8 size;
-    UNS8 err;
-    MSG_WAR(0x3F05, "Test SDO", 0);
-
-    MSG_WAR(0x3F10, "Writing to node 5 at 0x6002-0 ...", 0);
-    strcpy(dataW, "Au Revoir");
-    MSG_WAR(0x3F10, dataW, 0);
-    size = 20;
-    err = writeNetworkDict(0, 5, 0x6002, 0, 10, visible_string, dataW);
-    err = waitingWriteToSlaveDict(5, err);
-  
-    err = readNetworkDict(0, 5, 0x6002, 0, visible_string);
-    err = waitingReadToSlaveDict(5, dataR, &size, err);
-    MSG_WAR(0x3F08, "Read from node 5 at 0x6002-0" , 0);
-    MSG_WAR(0x3F08, dataR, 0);
-    
-    MSG_WAR(0x3F08, "node 5. Hardware version. (default = compil. date) ...", 0);
-    err = readNetworkDict(0, 5, 0x1009, 0, visible_string);
- 
-    err = waitingReadToSlaveDict(5, dataR, &size, err);
-    MSG_WAR(0x3F08, dataR, 0);
-
-    MSG_WAR(0x3F08, "node 5. Software version. (default = compil. time) ...", 0);
-    err = readNetworkDict(0, 5, 0x100A, 0, visible_string);
-    err = waitingReadToSlaveDict(5, dataR, &size, err);
-    MSG_WAR(0x3F08, dataR, 0);
-  }
-
-  // Node identity ?
-  {
-    UNS8 *data;
-    UNS8 size;
-    UNS8 dataType;
-    // Manufacturer Device name (default = empty string)
-    getODentry(0x1008, 0x0, (void **)&data, &size, &dataType, 0);
-    MSG_WAR(0x3F09, data, 0);
-    // Manufacturer Hardware version. (default = compilation. date)
-    getODentry(0x1009, 0x0, (void **)&data, &size, &dataType, 0);
-    MSG_WAR(0x3F09, data, 0);
-    // Manufacturer Software version. (default = compilation. time)
-    getODentry(0x100A, 0x0, (void **)&data, &size, &dataType, 0);
-    MSG_WAR(0x3F09, data, 0);
-  }
-    
-  while(1) { 
-    // To transmit the SYNC if it is time to do.
-    computeSYNC();
-
-    // Testing if heartsbeat have been received, and send a heartbeat if it is time.
-     heartbeatMGR();
-
-     // Messages received ?
-     // The function is called in void __attribute__((interrupt)) timer3Hdl (void)
-     //receiveMsgHandler(0);
-
- if (minutes != minutes_last) {
-	MSG_WAR(0x3F80, "Minutes changed :", minutes);
-	minutes_last = minutes;
-      }
-
-      if (second != second_last) {
-	MSG_WAR(0x3F81, "Seconds : ", second);
-	second_last = second;
-
-	if (canopenErrNB_node5) {
-	  MSG_WAR(0x3F82, "Received an error from node 5, NB : ", canopenErrNB_node5);
-	  MSG_WAR(0x3F83, "                            VALUE : ", canopenErrVAL_node5);
-	  // Reseting the error
-	  canopenErrNB_node5 = 0;
-	  canopenErrVAL_node5 = 0;
-	  sendingResetError = 1;
-	}
-       
-	if ((second == 00) && sendingResetError) {
-	  MSG_WAR(0x3F84, 
-		 "Sending to node 5 a PDO envent to reset the error NB and VAL : ",0);
-	  sendPDOevent(0, &canopenErrNB_node5);
-	  sendingResetError = 0; 
-	}
-      
-      
-      }	// end if (second != second_last)
-
-      
-  } // end while
-      
- 
-  return (0); 
-}
- 
--- a/examples/AppliMaster_HCS12/objdict.c	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,642 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack. 
-
-Copyright (C): Edouard TISSERANT and Francis DUPIN
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <stddef.h>
-
-#include <applicfg.h>
-#include "def.h"
-#include "can.h"
-#include "objdictdef.h"
-#include "pdo.h"
-#include "sdo.h"
-#include "sync.h"
-#include "lifegrd.h"
-#include "nmtSlave.h"
-
-/**************************************************************************/
-/* Declaration of the mapped variables                                    */
-/**************************************************************************/
-
-
-
-/*// Copy and uncomment this code to your main file
-extern UNS32 canopenErrNB_node5;		// Mapped at index 0x6000, subindex 0x00
-extern UNS32 canopenErrVAL_node5;		// Mapped at index 0x6001, subindex 0x00
-extern UNS8 second;		// Mapped at index 0x6002, subindex 0x01
-extern UNS8 minutes;		// Mapped at index 0x6002, subindex 0x02
-extern UNS8 hour;		// Mapped at index 0x6002, subindex 0x03
-extern UNS8 day;		// Mapped at index 0x6002, subindex 0x04
-extern UNS32 canopenErrNB;		// Mapped at index 0x6003, subindex 0x01
-extern UNS32 canopenErrVAL;		// Mapped at index 0x6003, subindex 0x02
-
-// END copy to main file
-*/
-
-UNS32 canopenErrNB_node5;		// Mapped at index 0x6000, subindex 0x00
-UNS32 canopenErrVAL_node5;		// Mapped at index 0x6001, subindex 0x00
-UNS8 second;		// Mapped at index 0x6002, subindex 0x01
-UNS8 minutes;		// Mapped at index 0x6002, subindex 0x02
-UNS8 hour;		// Mapped at index 0x6002, subindex 0x03
-UNS8 day;		// Mapped at index 0x6002, subindex 0x04
-UNS32 canopenErrNB;		// Mapped at index 0x6003, subindex 0x01
-UNS32 canopenErrVAL;		// Mapped at index 0x6003, subindex 0x02
-
-/**************************************************************************/
-/* Declaration of the value range types                                   */
-/**************************************************************************/
-
-
-
-UNS32 valueRangeTest (UNS8 typeValue, UNS32 unsValue, REAL32 realValue)
-{
-  return 0;
-}
-
-
-/**************************************************************************/
-/* The node id                                                            */
-/**************************************************************************/
-/* Computed by strNode */
-/* node_id default value. 
-   This default value is deprecated.
-   You should always overwrite this by using the function setNodeId(UNS8 nodeId) in your C code.
-*/
-#define NODE_ID 0x01
-UNS8 bDeviceNodeId = NODE_ID;
-
-
-//*****************************************************************************/
-/* Computed by strStartDico */
-
-/* Array of message processing information */
-/* Should not be modified */
-volatile const proceed_info proceed_infos[] = {
-  {NMT,		"NMT",	        NULL},
-  {SYNC,        "SYNC",         proceedSYNC},
-  {TIME_STAMP,	"TStmp",	NULL},
-  {PDO1tx,	"PDO1t",        proceedPDO},
-  {PDO1rx,	"PDO1r",	proceedPDO},
-  {PDO2tx,	"PDO2t",	proceedPDO},
-  {PDO2rx,	"PDO2r",	proceedPDO},
-  {PDO3tx,	"PDO3t",	proceedPDO},
-  {PDO3rx,	"PDO3r",	proceedPDO},
-  {PDO4tx,	"PDO4t",	proceedPDO},
-  {PDO4rx,	"PDO4r",	proceedPDO},
-  {SDOtx,	"SDOt",	        proceedSDO},
-  {SDOrx,	"SDOr",         proceedSDO},
-  {0xD,		"Unkw",	        NULL},
-  {NODE_GUARD,	"NGrd",         proceedNMTerror},
-  {0xF,		"Unkw",	        NULL}
-};
-
-  // Macros definition
-
-/* Beware : 
-index                 *must* be writen 4 numbers in hexa
-sub_index             *must* be writen 2 numbers in hexa
-size_variable_in_UNS8 *must* be writen 2 numbers in hexa
-*/
-#define PDO_MAP(index, sub_index, size_variable_in_bits)\
-0x ## index ## sub_index ## size_variable_in_bits
-
-//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
-//
-//                       OBJECT DICTIONARY
-//                   
-//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
-// Make your change, depending of your application
- 
-
-/* index 0x1000 :   Device type. 
-                    You have to change the value below, so
-                    it fits your canopen-slave-module */
- 
-                    /* Not used, so, should not be modified */
-                    
-                    UNS32 obj1000 = 0;
-                    subindex Index1000[] =
-                    {
-                      { RO, uint32, sizeof(UNS32), (void*)&obj1000 }
-                    };
-
-/* index 0x1001 :   Error register. 
-                    Change the entries to fit your application 
-                    Not used, so, should not be modified */
-                    /*const*/ UNS8 obj1001 = 0x0;
-                    /*const*/ subindex Index1001[] =
-                    {
-                      { RO, uint8, sizeof(UNS8), (void*)&obj1001 }
-                    };
-
-/* index 0x1005 :   COB_ID SYNC */
-                    /* Should not be modified */
-                    UNS32 obj1005 = 0x00000080; // bit 30 = 1 : device can generate a SYNC message
-                                                // Beware, it is over written when the node 
-                                                // enters in reset mode
-                                                // See initResetMode() in init.c
-                    /*const*/ subindex Index1005[] =
-                    {
-                      { RW, uint32, sizeof(UNS32), (void*)&obj1005 }
-                    };
-
-/* index 0x1006 :   SYNC period */
-                    // For producing the SYNC signal every n micro-seconds.
-                    // Put O to not producing SYNC
-                    /*const*/ UNS32 obj1006 = 0x0; 
-                                         // Default 0 to not produce SYNC //
-                                         // Beware, it is over written when the 
-                                         // node enters in reset mode.
-                                         // See initResetMode() in init.c
-                    /*const*/ subindex Index1006[] =
-                    {
-                      { RW, uint32, sizeof(UNS32), (void*)&obj1006 }
-                    };
- 
-/* index 0x1007 :   Synchronous Window Length
-                    Seems to be needed by DS401 to generate the SYNC signal ! */
-                    /*const*/ UNS32 obj1007 = 0x0; /* Default 0 */
-                    /*const*/ subindex Index1007[] =
-                    {
-                      { RW, uint32, sizeof(UNS32), (void*)&obj1007 }
-                    };
-
-/* index 0x1008 :   Manufacturer device name */
-                    UNS8 obj1008[] = "Appli_Master_HC12"; /* Default 0 */
-                    subindex Index1008[] =
-                    {
-                      { RO, uint32, sizeof(obj1008), (void*)&obj1008 }
-                    };
-
-/* index 0x1009 :   Manufacturer hardware version */
-                    UNS8 obj1009[] = __DATE__; /* Default 0 */
-                    subindex Index1009[] =
-                    {
-                      { RO, uint32, sizeof(obj1009), (void*)&obj1009 }
-                    };
-
-/* index 0x100A :   Manufacturer software version */
-                    UNS8 obj100A[] = __TIME__; /* Default 0 */
-                    subindex Index100A[] =
-                    {
-                      { RO, uint32, sizeof(obj100A), (void*)&obj100A}
-                    };
-
-/* index 0x1016 :   HeartBeat consumers 
-                    The nodes which can send a heartbeat */ 
-                    static  UNS32 obj1016[] = {// Consumer time for each node 
-                    0x00000000}; // Format 0x00NNTTTT (N=Node T=time in ms)
-
-                    static  UNS8 obj1016_cnt = 1; // 1 nodes could send me
-                                                  // their heartbeat.
-                    subindex Index1016[] = 
-                    {
-                      { RO, uint8, sizeof(UNS8), (void*)&obj1016_cnt },
-                      { RW, uint32, sizeof(UNS32), (void*)&obj1016[0] }
-                    }; 
-
-/* index 0x1017 :   Heartbeat producer                    
-                    Every HBProducerTime, the node sends its heartbeat */
-                    static UNS16 obj1017 = 0; //HBProducerTime in ms. If 0 : not activated 
-                                                     // Beware, it is over written when the 
-                                                     // node enters in reset mode.
-                                                     // See initResetMode() in init.c
-                    subindex Index1017[] =
-                    {
-	              { RW, uint16, sizeof(UNS16), &obj1017 }
-                    };
-
-/* index 0x1018 :   Identity object */
-                    /** index 1018: identify object. Adjust the entries for your node/company
-                    */
-                    /* Values can be modified */
-
-                    s_identity obj1018 =
-                    {
-                      4,       // number of supported entries
-                      0,  // Vendor-ID (given by the can-cia)
-                      0,  // Product Code
-                      0,  // Revision number
-                      0  // serial number
-                    };
-
-                    subindex Index1018[] =
-                    {
-                      { RO, uint8,  sizeof(UNS8),  (void*)&obj1018.count },
-                      { RO, uint32, sizeof(UNS32), (void*)&obj1018.vendor_id},
-                      { RO, uint32, sizeof(UNS32), (void*)&obj1018.product_code},
-                      { RO, uint32, sizeof(UNS32), (void*)&obj1018.revision_number},
-                      { RO, uint32, sizeof(UNS32), (void*)&obj1018.serial_number}
-                    };
-
-/* index 0x1200 :   The SDO Server parameters */
-                    /* BEWARE You cannot define more than one SDO server */
-                    /* The values should not be modified here, 
-                    but can be changed at runtime */
-                    // Beware that the default values that you could put here
-                    // will be over written at the initialisation of the node. 
-                    // See setNodeId() in init.c
-                    static s_sdo_parameter obj1200  = 
-                      { 3,                   // Number of entries. Always 3 for the SDO	       
-                        0x600 + NODE_ID,     // The cob_id transmited in CAN msg to the server     
-                        0x580 + NODE_ID,     // The cob_id received in CAN msg from the server  
-                        NODE_ID              // The node id of the client. Should not be modified 
-                      };
-                    static subindex Index1200[] =
-                    {
-                      { RO, uint8,  sizeof( UNS8 ), (void*)&obj1200.count },
-                      { RO, uint32, sizeof( UNS32), (void*)&obj1200.cob_id_client },
-                      { RO, uint32, sizeof( UNS32), (void*)&obj1200.cob_id_server },
-                      { RW, uint8,  sizeof( UNS8),  (void*)&obj1200.node_id }
-                    };
-
-/* index 0x1280 :   SDO client parameter */
-                    static s_sdo_parameter obj1280 = 
-                      { 3,     // Nb of entries 
-                        0x600, // cobid transmited to the server. The good value should be 0x600 + server nodeId
-                        0x580, // cobid received from the server. The good value should be 0x580 + server nodeId
-                        0x0    // server NodeId
-                      };
-                    static subindex Index1280[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1280.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1280.cob_id_client },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1280.cob_id_server },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1280.node_id }
-                      }; 
-
-/* index 0x1281 :   SDO client parameter */
-                    static s_sdo_parameter obj1281 = 
-                      { 3,     // Nb of entries 
-                        0x600, // cobid transmited to the server. The good value should be 0x600 + server nodeId
-                        0x580, // cobid received from the server. The good value should be 0x580 + server nodeId
-                        0x0    // server NodeId
-                      };
-                    static subindex Index1281[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1281.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1281.cob_id_client },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1281.cob_id_server },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1281.node_id }
-                      }; 
-
-/* index 0x1400 :   PDO receive communication parameter */
-                    static s_pdo_communication_parameter obj1400 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1400[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1400.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1400.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1400.type },
-                      }; 
-
-/* index 0x1401 :   PDO receive communication parameter */
-                    static s_pdo_communication_parameter obj1401 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1401[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1401.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1401.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1401.type },
-                      }; 
-
-/* index 0x1402 :   PDO receive communication parameter */
-                    static s_pdo_communication_parameter obj1402 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1402[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1402.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1402.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1402.type },
-                      }; 
-
-/* index 0x1600 :   PDO receive mapping parameter of PDO communication index 0x1400 */
-                    static UNS8 obj1600_cnt = 0; // Number of mapped variables
-                    static UNS32 obj1600_mappedVar[] = { 
-                        // Example to map a variable of 16 bits defined at index 0x6035, subindex 0x12 :
-                        // PDO_MAP(6035,12,16)
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00)
-                      };
-                    subindex Index1600[] = 
-                      { 
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1600_cnt },
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[0]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[1]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[2]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[3]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[4]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[5]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[6]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[7]}
-                      }; 
-
-/* index 0x1601 :   PDO receive mapping parameter of PDO communication index 0x1401 */
-                    static UNS8 obj1601_cnt = 0; // Number of mapped variables
-                    static UNS32 obj1601_mappedVar[] = { 
-                        // Example to map a variable of 16 bits defined at index 0x6035, subindex 0x12 :
-                        // PDO_MAP(6035,12,16)
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00)
-                      };
-                    subindex Index1601[] = 
-                      { 
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1601_cnt },
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[0]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[1]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[2]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[3]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[4]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[5]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[6]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[7]}
-                      }; 
-
-/* index 0x1602 :   PDO receive mapping parameter of PDO communication index 0x1402 */
-                    static UNS8 obj1602_cnt = 0; // Number of mapped variables
-                    static UNS32 obj1602_mappedVar[] = { 
-                        // Example to map a variable of 16 bits defined at index 0x6035, subindex 0x12 :
-                        // PDO_MAP(6035,12,16)
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00)
-                      };
-                    subindex Index1602[] = 
-                      { 
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1602_cnt },
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[0]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[1]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[2]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[3]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[4]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[5]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[6]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[7]}
-                      }; 
-
-/* index 0x1800 :   PDO transmit communication parameter */
-                    static s_pdo_communication_parameter obj1800 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1800[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1800.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1800.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1800.type },
-                      }; 
-
-/* index 0x1801 :   PDO transmit communication parameter */
-                    static s_pdo_communication_parameter obj1801 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1801[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1801.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1801.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1801.type },
-                      }; 
-
-/* index 0x1802 :   PDO transmit communication parameter */
-                    static s_pdo_communication_parameter obj1802 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1802[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1802.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1802.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1802.type },
-                      }; 
-
-/* index 0x1A00 :   PDO transmit mapping parameter of PDO communication index 0x1800 */
-                    static UNS8 obj1A00_cnt = 0; // Number of mapped variables
-                    static UNS32 obj1A00_mappedVar[] = { 
-                        // Example to map a variable of 16 bits defined at index 0x6035, subindex 0x12 :
-                        // PDO_MAP(6035,12,16)
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00)
-                      };
-                    subindex Index1A00[] = 
-                      { 
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1A00_cnt },
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A00_mappedVar[0]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A00_mappedVar[1]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A00_mappedVar[2]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A00_mappedVar[3]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A00_mappedVar[4]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A00_mappedVar[5]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A00_mappedVar[6]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A00_mappedVar[7]}
-                      }; 
-
-/* index 0x1A01 :   PDO transmit mapping parameter of PDO communication index 0x1801 */
-                    static UNS8 obj1A01_cnt = 0; // Number of mapped variables
-                    static UNS32 obj1A01_mappedVar[] = { 
-                        // Example to map a variable of 16 bits defined at index 0x6035, subindex 0x12 :
-                        // PDO_MAP(6035,12,16)
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00)
-                      };
-                    subindex Index1A01[] = 
-                      { 
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1A01_cnt },
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A01_mappedVar[0]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A01_mappedVar[1]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A01_mappedVar[2]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A01_mappedVar[3]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A01_mappedVar[4]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A01_mappedVar[5]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A01_mappedVar[6]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A01_mappedVar[7]}
-                      }; 
-
-/* index 0x1A02 :   PDO transmit mapping parameter of PDO communication index 0x1802 */
-                    static UNS8 obj1A02_cnt = 0; // Number of mapped variables
-                    static UNS32 obj1A02_mappedVar[] = { 
-                        // Example to map a variable of 16 bits defined at index 0x6035, subindex 0x12 :
-                        // PDO_MAP(6035,12,16)
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00)
-                      };
-                    subindex Index1A02[] = 
-                      { 
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1A02_cnt },
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A02_mappedVar[0]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A02_mappedVar[1]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A02_mappedVar[2]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A02_mappedVar[3]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A02_mappedVar[4]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A02_mappedVar[5]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A02_mappedVar[6]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A02_mappedVar[7]}
-                      }; 
-
-
-/* index 0x6000 :   Mapped variable */
-                    subindex Index6000[] = 
-                     {
-                       { RW, uint32, sizeof (UNS32), (void*)&canopenErrNB_node5 }
-                     };
-
-/* index 0x6001 :   Mapped variable */
-                    subindex Index6001[] = 
-                     {
-                       { RW, uint32, sizeof (UNS32), (void*)&canopenErrVAL_node5 }
-                     };
-
-/* index 0x6002 :   Mapped variable */
-                    static UNS8 highestSubIndex_6002 = 4; // number of subindex - 1
-                    subindex Index6002[] = 
-                     {
-                       { RO, uint8, sizeof (UNS8), (void*)&highestSubIndex_6002 },
-                       { RW, uint8, sizeof (UNS8), (void*)&second },
-                       { RW, uint8, sizeof (UNS8), (void*)&minutes },
-                       { RW, uint8, sizeof (UNS8), (void*)&hour },
-                       { RW, uint8, sizeof (UNS8), (void*)&day }
-                     };
-
-/* index 0x6003 :   Mapped variable */
-                    static UNS8 highestSubIndex_6003 = 2; // number of subindex - 1
-                    subindex Index6003[] = 
-                     {
-                       { RO, uint8, sizeof (UNS8), (void*)&highestSubIndex_6003 },
-                       { RW, uint32, sizeof (UNS32), (void*)&canopenErrNB },
-                       { RW, uint32, sizeof (UNS32), (void*)&canopenErrVAL }
-                     };
-
-const indextable objdict[] = 
-{
-  DeclareIndexTableEntry(Index1000, 0x1000),
-  DeclareIndexTableEntry(Index1001, 0x1001),
-  DeclareIndexTableEntry(Index1005, 0x1005),
-  DeclareIndexTableEntry(Index1006, 0x1006),
-  DeclareIndexTableEntry(Index1007, 0x1007),
-  DeclareIndexTableEntry(Index1008, 0x1008),
-  DeclareIndexTableEntry(Index1009, 0x1009),
-  DeclareIndexTableEntry(Index100A, 0x100A),
-  DeclareIndexTableEntry(Index1016, 0x1016),
-  DeclareIndexTableEntry(Index1017, 0x1017),
-  DeclareIndexTableEntry(Index1018, 0x1018),
-  DeclareIndexTableEntry(Index1200, 0x1200),
-  DeclareIndexTableEntry(Index1280, 0x1280),
-  DeclareIndexTableEntry(Index1281, 0x1281),
-  DeclareIndexTableEntry(Index1400, 0x1400),
-  DeclareIndexTableEntry(Index1401, 0x1401),
-  DeclareIndexTableEntry(Index1402, 0x1402),
-  DeclareIndexTableEntry(Index1600, 0x1600),
-  DeclareIndexTableEntry(Index1601, 0x1601),
-  DeclareIndexTableEntry(Index1602, 0x1602),
-  DeclareIndexTableEntry(Index1800, 0x1800),
-  DeclareIndexTableEntry(Index1801, 0x1801),
-  DeclareIndexTableEntry(Index1802, 0x1802),
-  DeclareIndexTableEntry(Index1A00, 0x1A00),
-  DeclareIndexTableEntry(Index1A01, 0x1A01),
-  DeclareIndexTableEntry(Index1A02, 0x1A02),
-  DeclareIndexTableEntry(Index6000, 0x6000),
-  DeclareIndexTableEntry(Index6001, 0x6001),
-  DeclareIndexTableEntry(Index6002, 0x6002),
-  DeclareIndexTableEntry(Index6003, 0x6003),
-};
-
-// To count at which received SYNC a PDO must be sent.
-// Even if no pdoTransmit are defined, at least one entry is computed
-// for compilations issues.
-UNS8 count_sync[1] = {0, };
-  
-UNS16 firstIndex (enum e_first_object object, UNS16 *lastIndex)
-{
-  switch (object) {
-    case FIRST_SDO_SERVER :
-      *lastIndex = 11;
-      return 11;
-    case FIRST_SDO_CLIENT :
-      *lastIndex = 13;
-      return 12;
-    case FIRST_PDO_RCV :
-      *lastIndex = 16;
-      return 14;
-    case FIRST_PDO_RCV_MAP :
-      *lastIndex = 19;
-      return 17;
-    case FIRST_PDO_TRS :
-      *lastIndex = 22;
-      return 20;
-    case FIRST_PDO_TRS_MAP :
-      *lastIndex = 25;
-      return 23;
-  }
-  *lastIndex = 0;
-  return 0;
-}
-
-UNS16 getObjdictSize (void) 
-{
-  return sizeof(objdict)/sizeof(objdict[0]);
-} 
--- a/examples/AppliMaster_HCS12/objdict.html	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>CANOpen object dictionary Configuration</title>
-<style type="text/css">
-         h1 {
-	   background: #FFDD66;
-	   border: 3px solid #AA0000;
-           margin: 2em;
-           padding: 1em;
-	 }
-
-         h2, h2.dico, h2.pdo {
-	   background: #5577FF;
-	   border: 1px solid #AA0000;
-           margin: 1em;
-	 }
-	 
-	  h1 em.node-id {
-	  color: #0728FF;
-	  padding-left: 1em;
-	  padding-right: 1em;
-	  }
-
-	  h1 em.type-node {
-	  color: #26BE08;
-	  padding-left: 1em;
-	  padding-right: 1em;
-	  }
-
-	  em.pdo-mode {
-	  color: #26BE08;
-	  }
-
-	  .entree {
-	  color: #AA0000;
-	  }
-         
-	  .nom-var, .node-nom {
-	  color: #660000;
-	  }
-
-	</style>
-</head>
-<body text="#000000" bgcolor="#ffffff">
-<h1>Object dictionary for Node : </h1>
-<h1>
-<em class="node-nom">Master</em><em class="type-node">master</em>
-</h1>
-<h2>Overview</h2>
-<p>
-	How to make the object dictionary of the node ?
-	First, use Jaxe (command run_objdict) to edit an xml description file
-of the dictionary : objdict.xml.
-Then, run the php program : makeobjetdict.php. You can launch php through a web browser
-if you have installed a server, or, on Linux, you can launch php in command line :
-php-cgi makeobjetdict.php. It compute the file objdict.c. Link it to
-        your project.
-<br>Note : To define the node id, use in your code the function setNodeId(UNS8 nodeId)
-	</p>
-<p>
-	  Then the node can be connected to the network. The master must configure it
-	  by sending SDO. It will write values in its index, subindex. What to configure ? 
-	  <ul>
-<li>Receiving heartbeats from which nodes ? Waiting time ?</li>
-<li>Emitting heartbeats or not ? time btw 2 heartbeats ? </li>
-<li>Defining a cobId for each PDO receive and transmit</li>
-<li>How to transmit a PDO ? on synchro ? request ? event ?</li>
-<li>What variables to put in each PDO receive and transmit ? </li>
-<li>...</li>
-</ul>
-</p>
-	To avoid configuring the node at the connection, you can put the values directly
-in the dictionary objdict.c. But it is boring and unsafe because it is too easy to make
-a mistake !
-
-      
-	<h2>Number of heartbeat consumers : 
-    <em class="entree">1</em>
-</h2>
-<p>This means that the node can expect heartbeats sent by 1 nodes. </p>
-<h2>Number of SDO clients : 
-    <em class="entree">10</em>
-</h2>
-<p>Usualy, a slave node does not have the use of SDO clients, but
-    today, for the library, you must define one. The Master, which can
-    send SDO to "n" slaves nodes, must define here "n" SDO
-    clients. Remember that in most cases, the SDO protocol is used by
-    the master to configure a slave dictionary or read a value. In
-    this use, the master is the client, and the slave is the server.</p>
-<h2>Maximum objects in a PDO (receive or transmit) : 
-    <em class="entree">8</em>
-</h2>
-<p>This is defining how many variables can be transmited in a
-    PDO. (maximum is 8).</p>
-<p>For each variable, a table is created, so if you have less room
-    in memory, put a value under 8.</p>
-<h2>Number of PDO receive : 
-    <em class="entree">3</em>
-</h2>
-<p>The node can receive 3 PDO.</p>
-<p>The communication parameters are defined at index 0x1400 to 0x1400 + 2</p>
-<p>The mapping parameters are defined at index 0x1600 to 0x1600 + 2</p>
-<h2>Number of PDO transmit : 
-    <em class="entree">3</em>
-</h2>
-<p>The node can transmit 3 PDO.</p>
-<p>The communication parameters are defined at index 0x1800 to 0x1800 + 2</p>
-<p>The mapping parameters are defined at index 0x1A00 to 0x1A00 + 2</p>
-<h2>Mapped variables and tables</h2>
-<p>3 tables are defined for the mapping, starting at index 0x2000, 0x6000 and 0x6200.
-	You must start the mapping at the beginning of one of a table, without holes in index
-or subindex. For example, variables in 0x2000 and 0x2001 is ok, but variables in 0x2000 and 0x2002 is not allowed, because you are loosing room in memory. It is the same for the subindex.
-</p>
-<p>Here are some others rules for the mapping : </p>
-<ul>
-<li>At an Index, you can map a variable at subindex 0x0 or 0x1, as you like.</li>
-<li>To map several variables at the same Index, you must start at subindex 0x1,
-	  because in this case, the subindex 0x0 contains the number of subindex.</li>
-<li>You cannot map variables and tables at the same index.</li>
-<li>The mapping of a table is always starting at subindex 0x1.</li>
-</ul>
-<table class="mapping">
-<tr>
-<td>Name</td><td>Bits</td><td>Index</td><td>Sub-index</td>
-</tr>
-<tr>
-<td><em>canopenErrNB_node5</em></td><td><em class="entree">32</em></td><td><em class="entree">0x6000</em></td><td><em class="entree">0x0</em></td>
-</tr>
-<tr>
-<td><em>canopenErrVAL_node5</em></td><td><em class="entree">32</em></td><td><em class="entree">0x6001</em></td><td><em class="entree">0x0</em></td>
-</tr>
-<tr>
-<td><em>second</em></td><td><em class="entree">8</em></td><td><em class="entree">0x6002</em></td><td><em class="entree">0x1</em></td>
-</tr>
-<tr>
-<td><em>minutes</em></td><td><em class="entree">8</em></td><td><em class="entree">0x6002</em></td><td><em class="entree">0x02</em></td>
-</tr>
-<tr>
-<td><em>hour</em></td><td><em class="entree">8</em></td><td><em class="entree">0x6002</em></td><td><em class="entree">0x3</em></td>
-</tr>
-<tr>
-<td><em>day</em></td><td><em class="entree">8</em></td><td><em class="entree">0x6002</em></td><td><em class="entree">0x4</em></td>
-</tr>
-<tr>
-<td><em>canopenErrNB</em></td><td><em class="entree">32</em></td><td><em class="entree">0x6003</em></td><td><em class="entree">0x01</em></td>
-</tr>
-<tr>
-<td><em>canopenErrVAL</em></td><td><em class="entree">32</em></td><td><em class="entree">0x6003</em></td><td><em class="entree">0x02</em></td>
-</tr>
-</table>
-</body>
-</html>
--- a/examples/AppliMaster_HCS12/objdict.xml	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<node manufacturer_device_name_1008="Appli_Master_HC12" name="Master" type_node="master">
-<heartbeat_consumers nombre="1"/>
-<sdo_clients nombre="2"/>
-<pdo type_rx_tx="rx">
-
-</pdo>
-<pdo type_rx_tx="rx">
-
-</pdo>
-<pdo type_rx_tx="rx">
-
-</pdo>
-<pdo type_rx_tx="tx">
-
-</pdo>
-<pdo type_rx_tx="tx">
-
-</pdo>
-<pdo type_rx_tx="tx">
-
-</pdo>
-<mapped_variable index="0x6000" name="canopenErrNB_node5" size_in_bits="32" sub_index="0x0"/>
-<mapped_variable index="0x6001" name="canopenErrVAL_node5" size_in_bits="32" sub_index="0x0"/>
-<mapped_variable index="0x6002" name="second" size_in_bits="8" sub_index="0x1"/>
-<mapped_variable index="0x6002" name="minutes" size_in_bits="8" sub_index="0x02"/>
-<mapped_variable index="0x6002" name="hour" size_in_bits="8" sub_index="0x3"/>
-<mapped_variable index="0x6002" name="day" size_in_bits="8" sub_index="0x4"/>
-<mapped_variable index="0x6003" name="canopenErrNB" size_in_bits="32" sub_index="0x01"/>
-<mapped_variable index="0x6003" name="canopenErrVAL" size_in_bits="32" sub_index="0x02"/>
-</node>
\ No newline at end of file
--- a/examples/AppliMaster_HCS12/trace32_flash_debug.cmm	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-; Réinitialisation
-SYS.d
-
-; Effacer l'écran
-WinCLEAR
-
-;Raffraichissement de trace32 toutes les 1 secondes
-setup.urate 1
-
-; Choix du microcontrôleur cible
-SYStem.CPU MCS12DP256 
-
-; Vitesse de commuication debugger / carte HCS12
- SYStem.BdmClock 8.0MHZ
-
-; initialiser le uc en mode debug
-SYStem.UP 
-
-; Reset des registres
-r.reset
-
-; Charger le programme
-DATA.LOAD.ELF appliMaster.elf /gnu /nocode /GHILLS
-
-; Positionner le compteur de programme
-r.set PC _start
-
-; Positionner le pointeur de pile
-r.set SP _stack
-
-; Afficher le code source
-data.list
-
-; Afficher les registres
-r
-
-; Afficher le contenu de la mémoire
-DATA.dump 140
-
-
-; Fin du programme de script
-ENDDO
-
--- a/examples/AppliMaster_HCS12/trace32_flash_debug_sans_init.cmm	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-; Réinitialisation
-SYS.d
-
-; Effacer l'écran
-;WinCLEAR
-
-;Raffraichissement de trace32 toutes les 1 secondes
-setup.urate 1
-
-; Choix du microcontrôleur cible
-SYStem.CPU MCS12DP256 
-
-; Vitesse de commuication debugger / carte HCS12
- SYStem.BdmClock 8.0MHZ
-
-; initialiser le uc en mode debug
-SYStem.UP 
-
-; Reset des registres
-r.reset
-
-; Charger le programme
-DATA.LOAD.ELF appliMaster.elf /gnu /nocode /GHILLS
-
-; Positionner le compteur de programme
-r.set PC _start
-
-; Positionner le pointeur de pile
-r.set SP _stack
-
-
-
-
-; Fin du programme de script
-ENDDO
-
--- a/examples/AppliMaster_HCS12/trace32_flash_programmer.cmm	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-; Programmation de la mémoire flash
-
-
-; Réinitialisation
-SYS.d
-
-; Effacer l'écran
-WinCLEAR
-
-; Vitesse de transmission : 
-SYStem.BdmClock 8.0MHZ
-
-; Choix du microcontrôleur cible
-SYStem.CPU MCS12DP256
-
-; Flash page 0X3E accessible entre 0X4000 et 0X7FFF
-; cf Motorola, registre MISC
-
-system.option ROMHM ON
-
-
-; Enlever tous les points d'arrêt
-b.res
-
-; Utiliser les points d'arrêts onchip
-map.bonchip
-
-; Connexion à la carte CS12
-system.up
-
-flash.reset
-
-
-; Effacement de la flash
-PRINT "Effacement de la flash"
-FLASH.Erase all
-
-; Passage en mode programmation de la flash
-print "Programmation de la flash non paginée (48KO) 1 "
-FLASH.Program 0x4000--0x7FFF
-
-;print "Chargement du programme en flash 1"
-DATA.LOAD.ELF appliMaster.elf 0x4000--0x7FFF
-
-
-FLASH.Program off
-print "Flash programmée 1"
-
-
-; Passage en mode programmation de la flash
-print "Programmation de la flash non paginée (48KO) 2"
-FLASH.Program 0x308000--0x30BFFF
-
-;print "Chargement du programme en flash 2"
-DATA.LOAD.ELF appliMaster.elf 0x8000--0xBFFF
-
-
-FLASH.Program off
-print "Flash programmée 2"
-
-; Passage en mode programmation de la flash
-print "Programmation de la flash non paginée (48KO) 3"
-FLASH.Program 0xC000--0xFFFF
-
-;print "Chargement du programme en flash 3"
-DATA.LOAD.ELF appliMaster.elf 0xC000--0xFFFF
-
-
-FLASH.Program off
-print "Flash programmée 3"
-
-
-;Reset du HCS12
-system.up
-
-;Reset de trace32
-SYS.d
-
-
-ENDDO
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--- a/examples/AppliMaster_HCS12/vectors.s	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,214 +0,0 @@
-;;/* M68HC11 Interrupt vectors table
-;;   Copyright (C) 1999 Free Software Foundation, Inc.
-;;   Written by Stephane Carrez (stcarrez@worldnet.fr)	
-;;
-;;This file is free software; you can redistribute it and/or modify it
-;;under the terms of the GNU General Public License as published by the
-;;Free Software Foundation; either version 2, or (at your option) any
-;;later version.
-;;
-;;In addition to the permissions in the GNU General Public License, the
-;;Free Software Foundation gives you unlimited permission to link the
-;;compiled version of this file with other programs, and to distribute
-;;those programs without any restriction coming from the use of this
-;;file.  (The General Public License restrictions do apply in other
-;;respects; for example, they cover modification of the file, and
-;;distribution when not linked into another program.)
-;;
-;;This file is distributed in the hope that it will be useful, but
-;;WITHOUT ANY WARRANTY; without even the implied warranty of
-;;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-;;General Public License for more details.
-;;
-;;You should have received a copy of the GNU General Public License
-;;along with this program; see the file COPYING.  If not, write to
-;;the Free Software Foundation, 59 Temple Place - Suite 330,
-;;Boston, MA 02111-1307, USA.  
-;; ----------------------------------------------
-;; Modified by  Francis Dupin for MC9S12DP256.  April 2003
-;; francis.dupin@inrets.fr
-;;*/
-
-	.sect .text
-	.globl _start
-        .globl can4HdlTra
- 	.globl can4HdlRcv
-	.globl can4HdlErr
-	.globl can4HdlWup
-	.globl can3HdlTra
- 	.globl can3HdlRcv
-	.globl can3HdlErr
- 	.globl can3HdlWup
-	.globl can2HdlTra
- 	.globl can2HdlRcv
-	.globl can2HdlErr
- 	.globl can2HdlWup
-        .globl can1HdlTra
- 	.globl can1HdlRcv
-	.globl can1HdlErr
- 	.globl can1HdlWup
-	.globl can0HdlTra
-	.globl can0HdlRcv
-	.globl can0HdlErr
- 	.globl can0HdlWup
-	.globl timerOvflHdl 
-	.globl timer3IC 
-	.globl timer2IC
-	.globl timer1IC
-	.globl timer0IC
-	  
-;; Default interrupt handler.
-	.sect .text
-def:
-	rti
-
-;; 
-;; Interrupt vectors are in a specific section that is
-;; mapped at 0xff00. For the example program, the reset handler
-;; points to the generic crt0 entry point.
-;;
-	.sect .vectors
-	.globl vectors
-vectors:
-       
-        .word def               ; ff00
-        .word def               ; ff02
-        .word def               ; ff04
-        .word def               ; ff06
-        .word def               ; ff08
-        .word def               ; ff0a
-        .word def               ; ff0c
-        .word def               ; ff0e
-        .word def               ; ff10
-        .word def               ; ff12
-        .word def               ; ff14
-        .word def               ; ff16
-        .word def               ; ff18
-        .word def               ; ff1a
-        .word def               ; ff1c
-        .word def               ; ff1e
-        .word def               ; ff20
-        .word def               ; ff22
-        .word def               ; ff24
-        .word def               ; ff26
-        .word def               ; ff28
-        .word def               ; ff2a
-        .word def               ; ff2c
-        .word def               ; ff2e
-        .word def               ; ff30
-        .word def               ; ff32
-        .word def               ; ff34
-        .word def               ; ff36
-        .word def               ; ff38
-        .word def               ; ff3a
-        .word def               ; ff3c
-        .word def               ; ff3e
-        .word def               ; ff40
-        .word def               ; ff42
-        .word def               ; ff44
-        .word def               ; ff46
-        .word def               ; ff48
-        .word def               ; ff4a
-        .word def               ; ff4c
-        .word def               ; ff4e
-        .word def               ; ff50
-        .word def               ; ff52
-        .word def               ; ff54
-        .word def               ; ff56
-        .word def               ; ff58
-        .word def               ; ff5a
-        .word def               ; ff5c
-        .word def               ; ff5e
-        .word def               ; ff60
-        .word def               ; ff62
-        .word def               ; ff64
-        .word def               ; ff66
-        .word def               ; ff68
-        .word def               ; ff6a
-        .word def               ; ff6c
-        .word def               ; ff6e
-        .word def               ; ff70
-        .word def               ; ff72
-        .word def               ; ff74
-        .word def               ; ff76
-        .word def               ; ff78
-        .word def               ; ff7a
-        .word def               ; ff7c
-        .word def               ; ff7e
-        .word def               ; ff80
-        .word def               ; ff82
-        .word def               ; ff84
-        .word def               ; ff86
-        .word def               ; ff88
-        .word def               ; ff8a
-        .word def               ; ff8c
-        .word def               ; ff8e
-	
-	;; MSCAN
-        .word can4HdlTra	; ff90 (MSCAN4 Transmit) 
-        .word can4HdlRcv	; ff92 (MSCAN4 Receive)  
-        .word can4HdlErr	; ff94 (MSCAN4 Errors)   
-        .word can4HdlWup	; ff96 (MSCAN4 Wake up)  
-        .word can3HdlTra	; ff98 (MSCAN3 Transmit) 
-        .word can3HdlRcv	; ff9a (MSCAN3 Receive)  
-        .word can3HdlErr	; ff9c (MSCAN3 Errors)   
-        .word can3HdlWup	; ff9e (MSCAN3 Wake up)  
-        .word can2HdlTra	; ffa0 (MSCAN2 Transmit) 
-        .word can2HdlRcv	; ffa2 (MSCAN2 Receive)  
-        .word can2HdlErr	; ffa4 (MSCAN2 Errors)   
-        .word can2HdlWup	; ffa6 (MSCAN2 Wake up)  
-        .word can1HdlTra	; ffa8 (MSCAN1 Transmit) 
-        .word can1HdlRcv	; ffaa (MSCAN1 Receive)  
-        .word can1HdlErr	; ffac (MSCAN1 Errors)   
-        .word can1HdlWup	; ffae (MSCAN1 Wake up)  
-        .word can0HdlTra	; ffb0 (MSCAN0 Transmit) 
-	.word can0HdlRcv	; ffb2 (MSCAN0 Receive)  
-        .word can0HdlErr        ; ffb4 (MSCAN0 Errors)   
-        .word can0HdlWup        ; ffb6 (MSCAN0 Wake up)      
-
-      	.word def               ; ffb8     
-        .word def               ; ffba 
-        .word def               ; ffbc
-        .word def               ; ffbe
-
-	.word def		; ffc0
-	.word def		; ffc2
-	.word def		; ffc4
-	.word def		; ffc6
-	.word def		; ffc8
-	.word def          	; ffca (Modulus Down Counter underflow)
-	.word def		; ffcc
-	.word def		; ffce
-	.word def		; ffd0
-	.word def		; ffd2
-	.word def		; ffd4
-
-	;; SCI
-	.word def		; ffd6
-
-	;; SPI
-	.word def						; ffd8
-	.word def						; ffda (PAII)
-	.word def						; ffdc (PAOVI)
-	.word def						;ffde (TOI)
-
-	;; Timer Output Compare
-	.word def		; ffe0 Timer Chanel 7
-	.word def		; ffe2 Timer Chanel 6
-	.word def		; ffe4 Timer Chanel 5
-	.word timer4Hdl         ; ffe6 Timer Chanel 4 used by Canopen
-	.word timer3Hdl		; ffe8 Timer Chanel 3 For the date
-	.word def		; ffea Timer Chanel 2
-	.word def		; ffec Timer Chanel 1
-	.word def		; ffee Timer Chanel 0
-
-	;;  Misc
-	.word def               ; fff0 (RTII)
-	.word def		; fff2 (IRQ)
-	.word def		; fff4 (XIRQ)
-	.word def               ; fff6 (SWI)
-	.word def		; fff8 (ILL)
-	.word def               ; fffa (COP Failure)
-	.word def		; fffc (COP Clock monitor)
-	.word _start		; fffe (reset)
-
--- a/examples/AppliMaster_Linux/.cvsignore	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-Makefile
--- a/examples/AppliMaster_Linux/Makefile.in	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#! gmake
-
-#
-# Copyright (C) 2006 Laurent Bessard
-# 
-# This file is part of canfestival, a library implementing the canopen
-# stack
-# 
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-# 
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-# 
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-# 
-
-CC = SUB_CC
-OPT_CFLAGS = -O2
-CFLAGS = SUB_OPT_CFLAGS
-PROG_CFLAGS = SUB_PROG_CFLAGS
-OS_NAME = SUB_OS_NAME
-ARCH_NAME = SUB_ARCH_NAME
-PREFIX = SUB_PREFIX
-TARGET = SUB_TARGET
-
-LIBPATH = /usr/lib
-LIBINC = /usr/include
-LIB = -L$(LIBPATH) -lpcan
-
-INCLUDES = -I../../include -I../../include/peak
-
-MASTER_OBJS = objdict.o appli.o
-
-OBJS = $(MASTER_OBJS) ../../src/peak_pdo.o ../../src/peak_sdo.o ../../src/peak_init.o ../../src/peak_sync.o\
-       ../../src/peak_objacces.o ../../src/peak_lifegrd.o ../../src/peak_timer.o ../../src/peak_nmtMaster.o\
-       ../../drivers/peak/canOpenDriver.o ../../drivers/peak/timerhw.o
-
-
-all: AppliMaster
-
-AppliMaster: $(OBJS)
-	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -lpthread  -lstdc++ $(OBJS) $(LIB)
-
-%o: %c
-	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -D_REENTRANT -c $<
-
-clean:
-	-rm $(MASTER_OBJS)
-
-mrproper: clean
-	-rm AppliMaster
-
-
-
--- a/examples/AppliMaster_Linux/appli.c	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1005 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack. 
-
-Copyright (C): Edouard TISSERANT and Francis DUPIN
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/time.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-
-#include <applicfg.h>
-#include <timerhw.h>
-#include <linuxCan.h>
-
-#include "def.h"
-#include "can.h"
-#include "objdictdef.h"
-#include "objacces.h"
-#include "canOpenDriver.h"
-#include "sdo.h"
-#include "pdo.h"
-#include "init.h"
-#include "timer.h"
-#include "lifegrd.h"
-#include "sync.h"
-
-#include "nmtMaster.h"
-
-
-
-// For prototype of exit();
-#define exit _exit
- 
-
-// Adlink 7841 or Peak PCI/CAN board
-// ---------------------------------
-
-// Baudrate values for Peak board :
-// CAN_BAUD_1M CAN_BAUD_500K CAN_BAUD_250K CAN_BAUD_125K CAN_BAUD_100K CAN_BAUD_50K
-// CAN_BAUD_20K CAN_BAUD_10K CAN_BAUD_5K
-
-#ifdef CAN_BAUD_250K
-# define BAUDRATE CAN_BAUD_250K
-#else
-// Appli have been compiled for Adlink-arbraca. Baudrate not used
-# define BAUDRATE 0
-#endif
-
-s_BOARD board = {"0", BAUDRATE};
-
-
-// Required definition variables
-// -----------------------------
-// The variables that you should define for debugging.
-// They are used by the macro MSG_ERR and MSG_WAR in applicfg.h
-// if the node is a slave, they can be mapped in the object dictionnary.
-
-UNS8 printMsgErrToConsole = 1;
-UNS8 printMsgWarToConsole = 1;
-
-// The variables mapped in the object dictionnary
-// ----------------------------------------------
-extern UNS32 canopenErrNB_node5;   // Mapped at index 0x6000, subindex 0x0
-extern UNS32 canopenErrVAL_node5;  // Mapped at index 0x6001, subindex 0x0
-extern UNS8 second;		   // Mapped at index 0x6002, subindex 0x1
-extern UNS8 minutes;		   // Mapped at index 0x6002, subindex 0x2
-extern UNS8 hour;		   // Mapped at index 0x6002, subindex 0x3
-extern UNS8 day;		   // Mapped at index 0x6002, subindex 0x4
-extern UNS32 canopenErrNB;	   // Mapped at index 0x6003, subindex 0x1
-extern UNS32 canopenErrVAL;	   // Mapped at index 0x6003, subindex 0x2
-
-      
-/*************************User's variables declaration**************************/
-pthread_t threadM;
-pthread_t threadH;
-pthread_t threadS;
-UNS8 connectedNode[128];
-
-/* The variable to map in a PDO is defined at index and subIndex. Its length is size bytes */
-typedef struct mappedVar 
-{
-  UNS32 index;
-  UNS8  subIndex;
-  UNS8  size; // in byte
-} s_mappedVar;
-
-typedef struct heartbeatConsumer
-{
-  UNS8 nodeProducer;
-  UNS16 time_ms;
-} s_heartbeatConsumer;
-
-/**************************prototypes*****************************************/
-/* You *must* have these 2 functions in your code*/
-void heartbeatError (UNS8 heartbeatID );
-void SD0timeoutError(UNS8 bus_id, UNS8 line);
-
-void waitMessage (void );
-void heartBeat (void );
-void transmitSync (void);
-e_nodeState stateNode (UNS8 node);
-void configure_master_SDO (UNS32 index, UNS8 serverNode);
-UNS8 waitingWriteToSlaveDict (UNS8 slaveNode, UNS8 error);
-UNS8 waitingReadToSlaveDict (UNS8 slaveNode, void * data, UNS8 * size, UNS8 error);
-UNS8 configure_client_SDO (UNS8 slaveNode, UNS8 clientNode);
-void masterMappingPDO (UNS32 indexPDO, UNS32 cobId, 
-		      s_mappedVar *tabMappedVar, UNS8 nbVar);
-void slaveMappingPDO (UNS8 slaveNode, UNS32 indexPDO, UNS32 cobId, 
-		     s_mappedVar *tabMappedVar, UNS8 nbVar);
-void masterHeartbeatConsumer (s_heartbeatConsumer 
-			     *tabHeartbeatConsumer, UNS8 nbHeartbeats);
-void masterHeartbeatProducer (UNS16 time);
-void slaveHeartbeatConsumer (UNS8 slaveNode, s_heartbeatConsumer 
-			    *tabHeartbeatConsumer, UNS8 nbHeartbeats);
-void slaveHeartbeatProducer (UNS8 slaveNode, UNS16 time);
-void masterPDOTransmissionMode (UNS32 indexPDO,  UNS8 transType);
-void slavePDOTransmissionMode (UNS8 slaveNode, UNS32 indexPDO,  UNS8 transType);
-void masterSYNCPeriod (UNS32 SYNCPeriod);
-int main (int argc,char **argv);
-
-/*****************************************************************************/
-void heartbeatError(UNS8 heartbeatID)
-{
-  // MSG_ERR should send the values canopenErrNB and canopenErrVAL on event in a PDO,
-  // But we do not have mapped the variables in a PDO, so it sends nothing.
-  // See the note at the end of END CONFIGURING THE NETWORK.
-  MSG_WAR(0x2F00, "HeartBeat, no response from node : ", heartbeatID);
-}
-
-/*****************************************************************************/
-void SD0timeoutError (UNS8 bus_id, UNS8 line)
-{
-  // Informations on what occurs are in transfers[bus_id][line]....
-  // See scanSDOtimeout() in sdo.c
-}
-
-/*********************************** THREADS **********************************/
-//------------------------------------------------------------------------------
-// Wait for a received message
-void waitMessage(void)
-{       
-  while (1) {
-    receiveMsgHandler(0); // blocked until new message
-  }
-}
-
-//------------------------------------------------------------------------------
-/* Sending SYNC */
-void transmitSync(void)
-{
-  while (1) {
-  computeSYNC(); // Use the value in the dictionnary
-  usleep(1000); // Sleep 1 ms
-
-  }
-}
-
-/************************** FUNCTIONS TO CONFIGURE THE NETWORK******************/
-
-
-
-//------------------------------------------------------------------------------
-/* Node mode result after NodeGuard query */
-e_nodeState stateNode(UNS8 node) 
-{
-  e_nodeState state = getNodeState(0, node);
-  switch (state) {
-  case Unknown_state: 
-    MSG_WAR(0x3F05, "Not connected (Does not have sent its status) node :", node);
-    break;
-  case Operational: 
-    MSG_WAR(0x3F06, "Ok, in operational mode, node : ", node);
-    break;
-  case Pre_operational: 
-    MSG_WAR(0x3F07, "OK in pre-operational mode, node : ", node);
-    break;
-  default:
-    MSG_WAR(0x3F08, "OK connected but in curious mode, node : ", node);
-  }
-  return state;
-}
-
-//------------------------------------------------------------------------------
-/* The master is writing in its dictionnary to configure the SDO parameters 
-to communicate with server_node
-*/
-void configure_master_SDO(UNS32 index, UNS8 serverNode)
-{
-  UNS32 data32;
-  UNS8  data8;
-  UNS8 sizeData = 4 ; // in bytes
-
-  /* At subindex 1, the cobId of the Can message from the client.
-  It is always defined inside the server dictionnary as 0x600 + server_node.
-  So, we have no choice here ! */
-  data32 = 0x600 + serverNode;
-  setODentry(index, 1, &data32, sizeData, 0);
-
-  {
-    // Test
-    UNS32  *pbData;
-    UNS8 length;
-    UNS32 returnValue;
-    UNS8 dataType;
-    // Relecture
-    MSG_WAR(0x1000, "Reading index : ", index);
-    MSG_WAR(0x1000, "     subindex : ", 1);
-    returnValue = getODentry(index, 1, (void * *)&pbData, (UNS8 *)&length, &dataType, 0);
-    MSG_WAR(0x1000, "          val : ", *pbData);
-  }
-
-
-  /* At subindex 2, the cobId of the Can message from the server to the client.
-  It is always defined inside the server dictionnary as 0x580 + client_node.
-  So, we have no choice here ! */
-  data32 = 0x580 + serverNode;
-  setODentry(index, 2, &data32, sizeData, 0);
-
-  /* At subindex 3, the node of the server */
-  data8 = serverNode;
-  sizeData = 1;
-  setODentry(index, 3, &data8, sizeData, 0);
-
-  {
-    UNS8  *pbData;
-    UNS8 length;
-    UNS32 returnValue;
-    UNS8 dataType;
-    // Relecture
-    MSG_WAR(0x1000, "Reading  index : ", index);
-    MSG_WAR(0x1000, "      subindex : ", 3);
-    returnValue = getODentry(index, 1, (void * *)&pbData, (UNS8 *)&length, &dataType, 0);
-    MSG_WAR(0x1000, "           val : ", *pbData);
-  }
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-UNS8 waitingWriteToSlaveDict(UNS8 slaveNode, UNS8 error)
-{
-  UNS8 err;
-  UNS32 abortCode;
-  MSG_WAR(0x3F21, "Sending SDO to write in dictionnary of node : ", slaveNode);
-  if (error) {
-    MSG_ERR(0x1F22, "Unable to send the SDO to node ", slaveNode);
-    return -1;
-  }
-  /* Waiting until the slave has responded */
-  while (getWriteResultNetworkDict (0, slaveNode, &abortCode) == SDO_DOWNLOAD_IN_PROGRESS) {
-    // Check if some SDO response are missing
-    scanSDOtimeout();
-  }
-
-  err = getWriteResultNetworkDict (0, slaveNode, &abortCode);
-  if (err == SDO_FINISHED) {
-    MSG_WAR(0x3F22, "SDO download finished to Node : ", slaveNode);
-    // Release the line. Don't forget !!!
-    closeSDOtransfer(0, slaveNode, SDO_CLIENT);
-    return 0;
-  }
-
-  if (err == SDO_ABORTED_RCV) {
-    MSG_WAR(0x2F20, "Received SDO abort from node : ", slaveNode);
-  }
-
-  if (err == SDO_ABORTED_INTERNAL) {
-    MSG_WAR(0x2F20, "Internal SDO abort for node : ", slaveNode);
-  }
-  // Looking for the line transfert number to read the index, subindex and releasing the line.
-  {
-    UNS8 line;
-    err = getSDOlineOnUse(0, slaveNode, SDO_CLIENT, &line);
-    if (err) {
-      MSG_WAR(0x2F21, "No line found for node : ", slaveNode);
-      exit(-1);
-    }
-    MSG_WAR (0x2F22, "while writing at his index : ", transfers[0][line].index);
-    MSG_WAR (0x2F23, "                  subIndex : ", transfers[0][line].subIndex);
-    //Releasing the line.
-    closeSDOtransfer(0, slaveNode, SDO_CLIENT);
-    exit(-1);
-  }
- return 0;
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-UNS8 waitingReadToSlaveDict(UNS8 slaveNode, void * data, UNS8 * size, UNS8 error)
-{
-  UNS8 err;
-  UNS32 abortCode;
-  MSG_WAR(0x3F2A, "Sending SDO to read in dictionnary of node : ", slaveNode);
-  if (error) {
-    MSG_ERR(0x1F2B, "Unable to send the SDO to node ", slaveNode);
-    return -1;
-  }
-  /* Waiting until the slave has responded */
-  while (getReadResultNetworkDict (0, slaveNode, data, size, &abortCode) == SDO_UPLOAD_IN_PROGRESS) {
-    // Check if some SDO response are missing
-    scanSDOtimeout();
-  }
-  err = getReadResultNetworkDict (0, slaveNode, data, size, &abortCode);
-  if (err == SDO_FINISHED) {
-    MSG_WAR(0x3F2C, "SDO upload finished to Node : ", slaveNode);
-    // Release the line. Don't forget !!!
-    closeSDOtransfer(0, slaveNode, SDO_CLIENT);
-    return 0;
-  }
-  if (err == SDO_ABORTED_RCV) {
-    MSG_WAR(0x2F2D, "Received SDO abort from node : ", slaveNode);
-  }
-
-  if (err == SDO_ABORTED_INTERNAL) {
-    MSG_WAR(0x2F2E, "Internal SDO abort for node : ", slaveNode);
-  }
-  // Looking for the line transfert number to read the index, subindex and releasing the line.
-  {
-    UNS8 line;
-    err = getSDOlineOnUse(0, slaveNode, SDO_CLIENT, &line);
-    if (err) {
-      MSG_WAR(0x2F2F, "No line found for node : ", slaveNode);
-      exit(-1);
-    }
-    MSG_WAR (0x2F30, "while writing at his index : ", transfers[0][line].index);
-    MSG_WAR (0x2F31, "                  subIndex : ", transfers[0][line].subIndex);
-    //Releasing the line.
-    closeSDOtransfer(0, slaveNode, SDO_CLIENT);
-    exit(-1);
-  }    
-
- return 0;
-}
-
-
-//------------------------------------------------------------------------------
-/* The master is writing in the slave dictionnary to configure the SDO parameters
-Remember that the slave is the server, and the master is the client.
- */ 
-UNS8 configure_client_SDO(UNS8 slaveNode, UNS8 clientNode)
-{
-  UNS8 data;
-  UNS8 NbDataToWrite = 1 ; // in bytes
-  UNS8 err = 0;
-  MSG_WAR(0x3F20, "Configuring SDO by writing in dictionnary Node", slaveNode);
-  /* It is only to put at subindex 3 the serverNode. It is optionnal.
-     In the slave dictionary, only one SDO server is defined, at index 
-     0x1200 */
-  data = clientNode;
-  err = writeNetworkDict(0, slaveNode, 0x1200, 3, NbDataToWrite, 0, &data); 
-  waitingWriteToSlaveDict(slaveNode, err);
- 
-  return 0;
-}		
-  
-//------------------------------------------------------------------------------
-
-void masterMappingPDO(UNS32 indexPDO, UNS32 cobId, 
-		      s_mappedVar *tabMappedVar, UNS8 nbVar)
-{
-  UNS32 *pbData;
-  UNS32 data32; 
-  UNS8 i;
-  UNS8 size = 0;
-  UNS8 dataType;
-
-  if ((indexPDO >= 0x1400) && (indexPDO <= 0x15FF))
-    MSG_WAR(0x3F30, "Configuring MASTER for PDO receive, COBID : ", cobId);
-
-  if ((indexPDO >= 0x1800) && (indexPDO <= 0x19FF))
-    MSG_WAR(0x3F31, "Configuring MASTER for PDO transmit, COBID : ", cobId);
-
-  /* At indexPDO, subindex 1, defining the cobId of the PDO */
-  setODentry(indexPDO, 1, &cobId, 4, 0);
-  /* The mapping ... */
-  /* ----------------*/
-  /* At subindex 0, the number of variables in the PDO */
-  setODentry(indexPDO + 0x200, 0, &nbVar, 1, 0);
-  getODentry(indexPDO + 0x200, 0, (void * *)&pbData, &size, &dataType, 0);
-  /* At each subindex 1 .. nbVar, The index,subindex and size of the variable to map in 
-     the PDO. The first variable after the COBID is defined at subindex 1, ... 
-     The data to write is the concatenation on 32 bits of (msb ... lsb) : 
-     index(16b),subIndex(8b),sizeVariable(8b)
-*/
-  for (i = 0 ; i < nbVar ; i++) {
-    data32 = ((tabMappedVar + i)->index << 16) |
-      (((tabMappedVar + i)->subIndex & 0xFF) << 8) |
-      ((tabMappedVar + i)->size & 0xFF);
-    // Write dictionary
-    setODentry(indexPDO + 0x200, i + 1, &data32, 4, 0);
-
-#   ifdef MORE_COMMENTS
-    printf("Mapped variable defined  at index 0x%X, subIndex 0x%X, %d bits\n", 
-	   (tabMappedVar + i)->index, (tabMappedVar + i)->subIndex, 8 * (tabMappedVar + i)->size);
-    // Only to verify.
-    // Read dictionnary
-    getODentry(indexPDO + 0x200, i + 1, (void * *)&pbData, &size, &dataType, 0);
-    printf("Writen à  index 0x%X, subIndex 0x%X, %d bits : 0x%08X\n", 
-	   indexPDO + 0x200, i + 1, 8 * size, *pbData);
-#   endif
-    
-  }
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-
-void slaveMappingPDO(UNS8 slaveNode, UNS32 indexPDO, UNS32 cobId, 
-		     s_mappedVar *tabMappedVar, UNS8 nbVar)
-{
-  UNS32 data32; 
-  UNS8 i;
-  UNS8 err;
-  UNS8 nbBytes = 1;
-  if ((indexPDO >= 0x1400) && (indexPDO <= 0x15FF))
-    MSG_WAR(0x3F32, "Configuring slave for PDO receive, COBID : ", cobId);
-
-  if ((indexPDO >= 0x1800) && (indexPDO <= 0x19FF))
-    MSG_WAR(0x3F33, "Configuring slave for PDO transmit, COBID : ", cobId);
-
-  /* At indexPDO, subindex 1, defining the cobId of the PDO */
-  err = writeNetworkDict(0, slaveNode, indexPDO, 1, 4, 0, &cobId); 
-  waitingWriteToSlaveDict(slaveNode, err);
-
-  /* The mapping ... */
-  /* ----------------*/
-  /* At subindex 0, the number of variables in the PDO */
-  err = writeNetworkDict(0, slaveNode, indexPDO + 0x200, 0, nbBytes, 0, &nbVar); 
-  waitingWriteToSlaveDict(slaveNode, err);
-
-  /* At each subindex 1 .. nbVar, The index,subindex and size of the variable to map in 
-     the PDO. The first variable after the COBID is defined at subindex 1, ... 
-     The data to write is the concatenation on 32 bits of (msb ... lsb) : 
-     index(16b),subIndex(8b),sizeVariable(8b)
-*/
-  for (i = 0 ; i < nbVar ; i++) {
-    data32 = ((tabMappedVar + i)->index << 16) |
-      (((tabMappedVar + i)->subIndex & 0xFF) << 8) |
-      ((tabMappedVar + i)->size & 0xFF);
-
-    // Write dictionary
-    err = writeNetworkDict(0, slaveNode, indexPDO + 0x200, i + 1, 4, 0, &data32); 
-    waitingWriteToSlaveDict(slaveNode, err);
-
-#   ifdef MORE_COMMENTS
-    printf("Mapped variable defined  at index 0x%X, subIndex 0x%X, %d bits\n", 
-	   (tabMappedVar + i)->index, (tabMappedVar + i)->subIndex, 8 * (tabMappedVar + i)->size);
-
-    printf("At node 0x%X Writen at  index 0x%X, subIndex 0x%X, %d bits : 0x%08X\n", 
-	   slaveNode, indexPDO + 0x200, i + 1, 32, data32);
-#   endif
-    
-  }
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-void masterHeartbeatConsumer(s_heartbeatConsumer 
-			     *tabHeartbeatConsumer, UNS8 nbHeartbeats)
-{
-  UNS32 data;
-  UNS8 i;
-  UNS8 nbHB = nbHeartbeats;
-
-  MSG_WAR(0x3F40, "Configuring heartbeats consumers for master", 0);
-  /* At index 1016, subindex 0 : the nb of consumers (ie nb of nodes of which are expecting heartbeats) */
-  setODentry(0x1016, 0, & nbHB, 1, 0);
-  
-  /* At Index 1016, subindex 1, ... : 32 bit values : msb ... lsb :
-     00 - node_consumer (8b) - time_ms (16b)
-     Put 0 to ignore the entry.
-  */
-  for (i = 0 ; i < nbHeartbeats ; i++) {
-    data = (((tabHeartbeatConsumer + i)->nodeProducer & 0xFF)<< 16) | ((tabHeartbeatConsumer + i)->time_ms & 0xFFFF);
-    setODentry(0x1016, i + 1, & data, 4, 0);
-  }
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-
-void masterHeartbeatProducer(UNS16 time)
-{
-  UNS16 hbTime = time;
-  MSG_WAR(0x3F45, "Configuring heartbeat producer for master", 0);
-  /* At index 1017, subindex 0, defining the time to send the heartbeat. Put 0 to never send heartbeat */
-  setODentry(0x1017, 0, &hbTime, 2, 0);
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-void slaveHeartbeatConsumer(UNS8 slaveNode, s_heartbeatConsumer 
-			    *tabHeartbeatConsumer, UNS8 nbHeartbeats)
-{
-  UNS32 data;
-  UNS8 err;
-  UNS8 i;
-  
-  MSG_WAR(0x3F46, "Configuring heartbeats consumers for node  : ", slaveNode);
-  
-  /* At Index 1016, subindex 1, ... : 32 bit values : msb ... lsb :
-     00 - node_consumer (8b) - time_ms (16b)
-     Put 0 to ignore the entry.
-  */
-  for (i = 0 ; i < nbHeartbeats ; i++) {
-    data = (((tabHeartbeatConsumer + i)->nodeProducer & 0xFF)<< 16) | 
-      ((tabHeartbeatConsumer + i)->time_ms & 0xFFFF);
-    err = writeNetworkDict(0, slaveNode, 0x1016, i + 1, 4, 0, &data); 
-    waitingWriteToSlaveDict(slaveNode, err);
-  }
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-
-void slaveHeartbeatProducer(UNS8 slaveNode, UNS16 time)
-{
-  UNS8 err;
-  MSG_WAR(0x3F47, "Configuring heartbeat producer for node  : ", slaveNode);
-  /* At index 1017, subindex 0, defining the time to send the heartbeat. Put 0 to never send heartbeat */
-
-  err = writeNetworkDict(0, slaveNode, 0x1017, 0, 2, 0, &time); 
-  waitingWriteToSlaveDict(slaveNode, err);
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-
-void masterPDOTransmissionMode(UNS32 indexPDO,  UNS8 transType)
-{
-  MSG_WAR(0x3F48, "Configuring transmission from master, indexPDO : ", indexPDO);
- 
-  /* At subindex 2, the transmission type */
-  setODentry(indexPDO, 2, &transType, 1, 0);
-}
-
-
-//------------------------------------------------------------------------------
-/*
- */
-
-void slavePDOTransmissionMode(UNS8 slaveNode, UNS32 indexPDO,  UNS8 transType)
-{
-  UNS8 err;
-  MSG_WAR(0x3F41, "Configuring transmission mode for node : ", slaveNode);
-  MSG_WAR(0x3F42, "                              indexPDO : ", indexPDO);
-
-  err = writeNetworkDict(0, slaveNode, indexPDO, 2, 1, 0, &transType); 
-  waitingWriteToSlaveDict(slaveNode, err);
-
-}
-
-//------------------------------------------------------------------------------
-/*
- */
-
-void masterSYNCPeriod(UNS32 SYNCPeriod)
-{
-  UNS32 cobId = 0x40000080;
-  MSG_WAR(0x3F49, "Configuring master to send SYNC every ... micro-seconds :", SYNCPeriod);
-  /* At index 0x1006, subindex 0 : the period in ms */
-  setODentry(0x1006, 0, &SYNCPeriod , 4, 0);
-  /* At index 0x1005, subindex 0 : Device generate SYNC signal with CobId 0x80 */
-  setODentry(0x1005, 0, &cobId, 4, 0);
-}
-
-void help()
-{
-  printf("**************************************************************\n");
-  printf("*  AppliMaster                                               *\n");
-  printf("*                [-b b]                                      *\n");
-  printf("*                                                            *\n");
-  printf("*     b : bus [default 0]                                    *\n");
-  printf("*                                                            *\n");
-  printf("*  This exemple run AppliMaster on bus 0                     *\n");
-  printf("*   AppliMaster -b 0                                         *\n");
-  printf("*                                                            *\n");
-  printf("**************************************************************\n");
-}
-
-/****************************************************************************/
-/***************************  MAIN  *****************************************/
-/****************************************************************************/
-int main(int argc,char **argv)
-{
-  UNS8 second_last;
-  UNS8 minutes_last;
-  UNS8 sendingResetError = 0;
-  int i;
-  HANDLE ok;
-  char c;
-  extern char *optarg;
-
-  while ((c = getopt(argc, argv, "-b:")) != EOF)
-  {
-    switch(c)
-    {
-      case 'b' :
-        if (optarg[0] == 0)
-        {
-          help();
-          exit(1);
-        }
-        board.busname = optarg;
-        break;
-      default:
-        help();
-        exit(1);
-    }
-  }
-
-  /****************************** INITIALISATION *******************************/
-  
-  /* Launch the timer*/
-    initTimer( );
-
-  /* arrays initialisation, etc */
-  initCANopenMain();     
-      
-  /* arrays initialisation, etc */
-  initCANopenMaster();  
-
-  /* Defining the node Id */
-  setNodeId(0x01);
-  MSG_WAR(0x3F50, "My node ID is : ", getNodeId()); 
-
-  /* Put the master in operational mode */
-  setState(Operational);
-
-
-  /* Init the table of connected nodes */
-  for (i = 0 ; i < 128 ; i++)
-    connectedNode[i] = 0;
-
-  
-  ok = f_can_open(& board);
-  if (ok == NULL) {
-    MSG_ERR(0x1F02,"Unable to open the board", 0);
-    MSG_ERR(0x1F03,"Edit includeMakefileLinux to verify that the application is configured for the good board", 0);
-    exit (-1);
-  }
-  else {
-    MSG_WAR(0x3F03, "Board 0 opened ", 0);
-  }
-  
-
-  /* Launch the thread to receive the messages */
-  pthread_create( &threadM, NULL, (void *)&waitMessage, NULL);	
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  /******************** CONFIGURING THE NETWORK **************************/
-  
-  /* Which nodes are connected ? */
-  /* Sending a request Node guard to node 5 and 6 */
-  MSG_WAR(0x3F04, "Sending a node guard to node : ", 5);
-  masterReadNodeState(0, 0x05);
-  /* Sending a message to the node 6, only as example */
-  MSG_WAR(0x3F04, "Sending a node guard to node : ", 6);
-  masterReadNodeState(0, 0x06);
-  /* Waiting for a second the response */
-  sleep(1);
-  
-  /* Whose node have answered ? */
-  connectedNode[5] = stateNode(5);
-  connectedNode[6] = stateNode(6);
-
-  /* Configure the SDO master to communicate with node 5 and node 6 */
-  configure_master_SDO(0x1280, 0x05);
-
-
-  /* Configure the SDO of node 5 */
-  /* getNodeId() returns my node Id */
-  configure_client_SDO(0x05, getNodeId());
-  /* Mapping of the PDO 
-     Chose some COBID in (hexa) 181-1FF, 201-27F, 281-2FF, 301-37F, 
-     381-3FF, 401-47F, 481-4FF, 501-57F,
-     without other restriction.
-     (Of course, you must not define 2 PDO transmit with the same cobId !!)
-  */
- 
-  /*
-     *** PDO node 1 <-- node 5 ***
-     *** cobId 0x181 *************
-     MASTER (node 1)
-     Mapped to variables (node1) [index-subindex-size_bits]: 
-       day    [0x6002 - 0x04 - 8]
-       hour   [0x6002 - 0x03 - 8]
-       second [0x6002 - 0x01 - 8]
-
-     SLAVE (node 5)
-     Mapped to variables (node5) [index-subindex-size_bits]: 
-       day    [0x2000 - 0x04 - 8]
-       hour   [0x2000 - 0x03 - 8]
-       second [0x2000 - 0x01 - 8]
-*/
-
-  /* Configuring the first PDO receive, defined at index 0x1400 and 0x1600 */
-  {
-    s_mappedVar tabMappedVar[8] = { {0x6002,4,8}, {0x6002,3,8}, {0x6002,1,8}, };
-    masterMappingPDO(0x1400, 0x181, tabMappedVar, 3);
-  }
-
-  /* Configuring the first PDO transmit, defined at index 0x1800 and 0x1A00 */
-  {
-    s_mappedVar tabMappedVar[8] = { {0x2000,4,8}, {0x2000,3,8}, {0x2000,1,8}, };
-    slaveMappingPDO(0x05, 0x1800, 0x181, tabMappedVar, 3);
-  }
-   /*
-     *** PDO node 1 <-- node 5 ***
-     *** cobId 0x182 *************
-     MASTER (node 1)
-     Mapped to variables (node1) [index-subindex-size_bits]: 
-       minute    [0x6002 - 0x02 - 8]
-
-     SLAVE (node 5)
-     Mapped to variables (node5) [index-subindex-size_bits]: 
-       minute    [0x2000 - 0x02 - 8]
-   */
-
-  /* Configuring PDO receive, defined at index 0x1400 and 0x1600 */
-  {
-    s_mappedVar tabMappedVar[8] = { {0x6002,2,8} };
-    masterMappingPDO(0x1401, 0x182, tabMappedVar, 1);
-  }
-
-  /* Configuring PDO transmit, defined at index 0x1800 and 0x1A00 */
-  {
-    s_mappedVar tabMappedVar[8] = { {0x2000,2,8} };
-    slaveMappingPDO(0x05, 0x1801, 0x182, tabMappedVar, 1);
-  }
-
-
-  /*
-     *** PDO node 1 <-- node 5 ***
-     *** cobId 0x183 *************
-     Error management :  By this way, The node can send by PDO an error
-     MASTER (node 1)
-     Mapped to variables (node1) [index-subindex-size_bits]: 
-       canopenErrNb_node5   [0x6000 - 0x00 - 32]
-       canopenErrVal_node5  [0x6001 - 0x00 - 32] 
-
-     SLAVE (node 5)
-     Mapped to variables (node5) [index-subindex-size_bytes]: 
-       canopenErrNb     [0x6000 - 0x00 - 32]
-       canopenErrVal    [0x6001 - 0x00 - 32]  
-  */
-
-  /* Configuring  PDO receive, defined at index 0x1402 and 0x1602 */
-  {
-    s_mappedVar tabMappedVar[8] = { {0x6000,0,32}, {0x6001, 0, 32}};
-    masterMappingPDO(0x1402, 0x183, tabMappedVar, 2);
-  }
-
-  /* Configuring PDO transmit, defined at index 0x1802 and 0x1A02 */
-  {
-    s_mappedVar tabMappedVar[8] = { {0x6000,0,32}, {0x6001, 0, 32}};
-    slaveMappingPDO(0x05, 0x1802, 0x183, tabMappedVar, 2);
-  }
- 
-  /*
-     *** PDO node 1 --> node 5 ***
-     *** cobId 0x184 *************
-     Error management :  To reset the error
-     MASTER (node 1)
-     Mapped to variables (node1) [index-subindex-size_bits]: 
-       canopenErrNb_node5     [0x6000 - 0x00 - 32]
-       canopenErrVal_node5    [0x6001 - 0x00 - 32] 
-
-     SLAVE (node 5)
-     Mapped to variables (node5) [index-subindex-size_bytes]: 
-       canopenErrNb     [0x6000 - 0x00 - 32]
-       canopenErrVal    [0x6001 - 0x00 - 32]  
-  */
-
-  /* Configuring  PDO transmit, defined at index 0x1803 and 0x1103 */
-  {
-    s_mappedVar tabMappedVar[8] = { {0x6000,0,32}, {0x6001, 0, 32}};
-    masterMappingPDO(0x1801, 0x184, tabMappedVar, 2);
-  }
-
-  /* Configuring PDO transmit, defined at index 0x1403 and 0x1603 */
-  {
-    s_mappedVar tabMappedVar[8] = { {0x6000,0,32}, {0x6001, 0, 32}};
-    slaveMappingPDO(0x05, 0x1400, 0x184, tabMappedVar, 2);
-  }
-
-  /* Configuring the node 5 heartbeat */
-  /* Check every 3000 ms if it have received a heartbeat from node 1 */
-  {
-    UNS8 nbHeartbeatsToReceive = 1;
-    s_heartbeatConsumer tabHeartbeatConsumer[10] = {{1, 0xBB8}};
-    slaveHeartbeatConsumer(0x05, tabHeartbeatConsumer, nbHeartbeatsToReceive);
-  }
-  /* Sending every 1000 ms an heartbeat */
-  slaveHeartbeatProducer(0x05, 0x3E8);
-
-  /* Configuring the master heartbeat */
-  /* Check every 3000 ms if it have received a heartbeat from node 5 */
-    {
-    UNS8 nbHeartbeatsToReceive = 1;
-    s_heartbeatConsumer tabHeartbeatConsumer[10] = {{5, 0xBB8}};
-    masterHeartbeatConsumer(tabHeartbeatConsumer, nbHeartbeatsToReceive);
-  }
-
-    /* Sending every 1000 ms an heartbeat */
-    masterHeartbeatProducer(0x3E8);
-
-
-    
-    /* Configuring the transmission mode of the PDO */
-    slavePDOTransmissionMode(0x05, 0x1800,  TRANS_EVERY_N_SYNC (1));
-    slavePDOTransmissionMode(0x05, 0x1801,  TRANS_EVENT);
-    slavePDOTransmissionMode(0x05, 0x1802,  TRANS_EVENT);
-    masterPDOTransmissionMode(0x1801,  TRANS_EVENT);
-
-    /* Configuring the master to send a SYNC message every 1 s */
-    /* Note than any other node can send the SYNC instead of the master */
-    masterSYNCPeriod(1000000); 
-
-    {
-      // Reading the period of heartbeat which has been written in node 5 dictionary
-      UNS8 node = 5;
-      UNS16 index = 0x1017;
-      UNS8 subindex = 0;
-      //UNS8 notused = 0;
-      UNS16 hb = 0;
-      UNS8  size_data = 0;
-      UNS8 error;
-      MSG_WAR(0x3F50, "Reading dictionary noeud 5, 1017/0", 0);
-      error = readNetworkDict(0, node, index, subindex, 0);
-      //error = readNetworkDict(0, node, index, subindex, &notused);
-      if (error) {
-	MSG_ERR(0x1F50, "!!! ERROR reading dictionary noeud 5, 1017/0", 0);
-	exit (-1);
-      }
-      /* Waiting until the server has responded */
-      error = waitingReadToSlaveDict(node,  (UNS16 *)&hb,  &size_data, error);
-      MSG_WAR(0x1F51, "Read dictionary of node 5, index/subindex 1017/0 value = ", hb);
-      MSG_WAR(0x1F51, "         size of data (bytes) = ", size_data);
-    }
-
-
-
-    /* Put the node 5 in operational mode 
-       The mode is changed according to the slave state machine mode :
-         initialisation  ---> pre-operational (Automatic transition)
-         pre-operational <--> operational
-         pre-operational <--> stopped
-         pre-operational, operational, stopped -> initialisation
-       NMT_Start_Node           // Put the node in operational mode       
-       NMT_Stop_Node		// Put the node in stopped mode    
-       NMT_Enter_PreOperational // Put the node in pre_operational mode
-       NMT_Reset_Node		// Put the node in initialization mode 
-       NMT_Reset_Comunication	// Put the node in initialization mode 
-    */
-    masterSendNMTstateChange(0, 0x05, NMT_Start_Node);
-
-
-    // Note
-    //-----
-    // We do not have mapped the variable canopenErrNB and canopenErrVAL.
-    // We should have done that !
-    // the macro MSG_ERR try to send the PDO(s) which contains these two variables.
-    // While the PDO will not be found, if you are printing the warnings in file pdo.c,
-    // it will print "0X393B Unable to send variable on event :  not mapped in a PDO to send on event" for  
-    // example when you enter the function heartbeatError. 
-
-   /******************** END CONFIGURING THE NETWORK **********************/
-    
-    /* Launch the thread to send the SYNC message    */
-    pthread_create( &threadS, NULL, (void *)&transmitSync , NULL);
-    /* Init the errors values that may send the node 5 */
-    canopenErrNB_node5 = 0;
-    canopenErrVAL_node5 = 0;
-    
-    /****************************** RUNNING *******************************/
-
-  /* SDO test with node 5 */
-  {
-    // Reading string
-    UNS8 dataW[20];
-    UNS8 dataR[20];
-    UNS8 size;
-    UNS8 err;
-    MSG_WAR(0x3F05, "Test SDO", 0);
-
-    MSG_WAR(0x3F10, "Writing string to node 5 index 0x6002, subindex 0 ...", 0);
-    strcpy(dataW, "Au Revoir");
-    MSG_WAR(0x3F10, dataW, 0);
-    size = 20;
-    err = writeNetworkDict(0, 5, 0x6002, 0, 10, visible_string, dataW);
-    err = waitingWriteToSlaveDict(5, err);
-  
-    err = readNetworkDict(0, 5, 0x6002, 0, visible_string);
-    err = waitingReadToSlaveDict(5, dataR, &size, err);
-    MSG_WAR(0x3F08, "Data read from node 5 index 0x6002, subindex 0 ..." , 0);
-    MSG_WAR(0x3F08, dataR, 0);
-    
-    MSG_WAR(0x3F08, "node 5. Hardware version. (default = compil. date) ...", 0);
-    err = readNetworkDict(0, 5, 0x1009, 0, visible_string);
-    err = waitingReadToSlaveDict(5, dataR, &size, err);
-    MSG_WAR(0x3F08, dataR, 0);
-
-    MSG_WAR(0x3F08, "node 5. Software version. (default = compil. time) ...", 0);
-    err = readNetworkDict(0, 5, 0x100A, 0, visible_string);
-    err = waitingReadToSlaveDict(5, dataR, &size, err);
-    MSG_WAR(0x3F08, dataR, 0);
-  }
-
-  // Node identity ?
-    {
-      UNS8 *data;
-      UNS8 size;
-      UNS8 dataType;
-      // Manufacturer Device name (default = empty string)
-      getODentry(0x1008, 0x0, (void **)&data, &size, &dataType, 0);
-      MSG_WAR(0x3F09, data, 0);
-      // Manufacturer Hardware version. (default = compilation. date)
-      getODentry(0x1009, 0x0, (void **)&data, &size, &dataType, 0);
-      MSG_WAR(0x3F09, data, 0);
-      // Manufacturer Software version. (default = compilation. time)
-      getODentry(0x100A, 0x0, (void **)&data, &size, &dataType, 0);
-      MSG_WAR(0x3F09, data, 0);
-    }
-
-    while (1) {
-      if (minutes != minutes_last) {
-	printf("Minutes changed\n");
-	minutes_last = minutes;
-      }
-
-      if (second != second_last) {
-	printf("Date : %d, %02dH%02d-%02d\n", day, hour, minutes, second);
-	second_last = second;
-
-	if (canopenErrNB_node5) {
-	  printf("Received an error from node 5, NB : 0x%X, value : 0x%X\n", 
-		canopenErrNB_node5 , canopenErrVAL_node5);
-	  // Resetting the error
-	  canopenErrNB_node5 = 0;
-	  canopenErrVAL_node5 = 0;
-	  sendingResetError = 1;
-	}
-       
-	if ((second < 5) && sendingResetError) {
-	  printf("Sending to node 5 a PDO event to reset the error NB: 0x%X and VAL: 0x%X\n",
-		 canopenErrNB_node5, canopenErrVAL_node5);
-	    
-	  sendPDOevent(0, &canopenErrNB_node5);
-	  sendingResetError = 0; 
-	}
-      
-      
-      }	// end if (second != second_last)
-
-      // Testing if heartsbeat have been received, and send a heartbeat if it is time.
-      // I have put that in a thread, but I don't know why, on HB not received,
-      // it doesn't returns from heartbeatError() to the thread.
-      heartbeatMGR();  
-      
-      usleep(10000);
-      
-    }
-  return 0;
-}
--- a/examples/AppliMaster_Linux/objdict.c	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,770 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack. 
-
-Copyright (C): Edouard TISSERANT and Francis DUPIN
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <stddef.h>
-
-#include <applicfg.h>
-#include "def.h"
-#include "can.h"
-#include "objdictdef.h"
-#include "pdo.h"
-#include "sdo.h"
-#include "sync.h"
-#include "lifegrd.h"
-#include "nmtSlave.h"
-
-/**************************************************************************/
-/* Declaration of the mapped variables                                    */
-/**************************************************************************/
-
-
-
-/*// Copy and uncomment this code to your main file
-extern UNS32 canopenErrNB_node5;		// Mapped at index 0x6000, subindex 0x00
-extern UNS32 canopenErrVAL_node5;		// Mapped at index 0x6001, subindex 0x00
-extern UNS8 second;		// Mapped at index 0x6002, subindex 0x01
-extern UNS8 minutes;		// Mapped at index 0x6002, subindex 0x02
-extern UNS8 hour;		// Mapped at index 0x6002, subindex 0x03
-extern UNS8 day;		// Mapped at index 0x6002, subindex 0x04
-extern UNS32 canopenErrNB;		// Mapped at index 0x6003, subindex 0x01
-extern UNS32 canopenErrVAL;		// Mapped at index 0x6003, subindex 0x02
-
-// END copy to main file
-*/
-
-UNS32 canopenErrNB_node5;		// Mapped at index 0x6000, subindex 0x00
-UNS32 canopenErrVAL_node5;		// Mapped at index 0x6001, subindex 0x00
-UNS8 second;		// Mapped at index 0x6002, subindex 0x01
-UNS8 minutes;		// Mapped at index 0x6002, subindex 0x02
-UNS8 hour;		// Mapped at index 0x6002, subindex 0x03
-UNS8 day;		// Mapped at index 0x6002, subindex 0x04
-UNS32 canopenErrNB;		// Mapped at index 0x6003, subindex 0x01
-UNS32 canopenErrVAL;		// Mapped at index 0x6003, subindex 0x02
-
-/**************************************************************************/
-/* Declaration of the value range types                                   */
-/**************************************************************************/
-
-
-
-UNS32 valueRangeTest (UNS8 typeValue, UNS32 unsValue, REAL32 realValue)
-{
-  return 0;
-}
-
-
-/**************************************************************************/
-/* The node id                                                            */
-/**************************************************************************/
-/* Computed by strNode */
-/* node_id default value. 
-   This default value is deprecated.
-   You should always overwrite this by using the function setNodeId(UNS8 nodeId) in your C code.
-*/
-#define NODE_ID 0x01
-UNS8 bDeviceNodeId = NODE_ID;
-
-
-//*****************************************************************************/
-/* Computed by strStartDico */
-
-/* Array of message processing information */
-/* Should not be modified */
-volatile const proceed_info proceed_infos[] = {
-  {NMT,		"NMT",	        NULL},
-  {SYNC,        "SYNC",         proceedSYNC},
-  {TIME_STAMP,	"TStmp",	NULL},
-  {PDO1tx,	"PDO1t",        proceedPDO},
-  {PDO1rx,	"PDO1r",	proceedPDO},
-  {PDO2tx,	"PDO2t",	proceedPDO},
-  {PDO2rx,	"PDO2r",	proceedPDO},
-  {PDO3tx,	"PDO3t",	proceedPDO},
-  {PDO3rx,	"PDO3r",	proceedPDO},
-  {PDO4tx,	"PDO4t",	proceedPDO},
-  {PDO4rx,	"PDO4r",	proceedPDO},
-  {SDOtx,	"SDOt",	        proceedSDO},
-  {SDOrx,	"SDOr",         proceedSDO},
-  {0xD,		"Unkw",	        NULL},
-  {NODE_GUARD,	"NGrd",         proceedNMTerror},
-  {0xF,		"Unkw",	        NULL}
-};
-
-  // Macros definition
-
-/* Beware : 
-index                 *must* be writen 4 numbers in hexa
-sub_index             *must* be writen 2 numbers in hexa
-size_variable_in_UNS8 *must* be writen 2 numbers in hexa
-*/
-#define PDO_MAP(index, sub_index, size_variable_in_bits)\
-0x ## index ## sub_index ## size_variable_in_bits
-
-//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
-//
-//                       OBJECT DICTIONARY
-//                   
-//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
-// Make your change, depending of your application
- 
-
-/* index 0x1000 :   Device type. 
-                    You have to change the value below, so
-                    it fits your canopen-slave-module */
- 
-                    /* Not used, so, should not be modified */
-                    
-                    UNS32 obj1000 = 0;
-                    subindex Index1000[] =
-                    {
-                      { RO, uint32, sizeof(UNS32), (void*)&obj1000 }
-                    };
-
-/* index 0x1001 :   Error register. 
-                    Change the entries to fit your application 
-                    Not used, so, should not be modified */
-                    /*const*/ UNS8 obj1001 = 0x0;
-                    /*const*/ subindex Index1001[] =
-                    {
-                      { RO, uint8, sizeof(UNS8), (void*)&obj1001 }
-                    };
-
-/* index 0x1005 :   COB_ID SYNC */
-                    /* Should not be modified */
-                    UNS32 obj1005 = 0x00000080; // bit 30 = 1 : device can generate a SYNC message
-                                                // Beware, it is over written when the node 
-                                                // enters in reset mode
-                                                // See initResetMode() in init.c
-                    /*const*/ subindex Index1005[] =
-                    {
-                      { RW, uint32, sizeof(UNS32), (void*)&obj1005 }
-                    };
-
-/* index 0x1006 :   SYNC period */
-                    // For producing the SYNC signal every n micro-seconds.
-                    // Put O to not producing SYNC
-                    /*const*/ UNS32 obj1006 = 0x0; 
-                                         // Default 0 to not produce SYNC //
-                                         // Beware, it is over written when the 
-                                         // node enters in reset mode.
-                                         // See initResetMode() in init.c
-                    /*const*/ subindex Index1006[] =
-                    {
-                      { RW, uint32, sizeof(UNS32), (void*)&obj1006 }
-                    };
- 
-/* index 0x1007 :   Synchronous Window Length
-                    Seems to be needed by DS401 to generate the SYNC signal ! */
-                    /*const*/ UNS32 obj1007 = 0x0; /* Default 0 */
-                    /*const*/ subindex Index1007[] =
-                    {
-                      { RW, uint32, sizeof(UNS32), (void*)&obj1007 }
-                    };
-
-/* index 0x1008 :   Manufacturer device name */
-                    UNS8 obj1008[] = "Appli_Master_Linux"; /* Default 0 */
-                    subindex Index1008[] =
-                    {
-                      { RO, uint32, sizeof(obj1008), (void*)&obj1008 }
-                    };
-
-/* index 0x1009 :   Manufacturer hardware version */
-                    UNS8 obj1009[] = __DATE__; /* Default 0 */
-                    subindex Index1009[] =
-                    {
-                      { RO, uint32, sizeof(obj1009), (void*)&obj1009 }
-                    };
-
-/* index 0x100A :   Manufacturer software version */
-                    UNS8 obj100A[] = __TIME__; /* Default 0 */
-                    subindex Index100A[] =
-                    {
-                      { RO, uint32, sizeof(obj100A), (void*)&obj100A}
-                    };
-
-/* index 0x1016 :   HeartBeat consumers 
-                    The nodes which can send a heartbeat */ 
-                    static  UNS32 obj1016[] = {// Consumer time for each node 
-                    0x00000000}; // Format 0x00NNTTTT (N=Node T=time in ms)
-
-                    static  UNS8 obj1016_cnt = 1; // 1 nodes could send me
-                                                  // their heartbeat.
-                    subindex Index1016[] = 
-                    {
-                      { RO, uint8, sizeof(UNS8), (void*)&obj1016_cnt },
-                      { RW, uint32, sizeof(UNS32), (void*)&obj1016[0] }
-                    }; 
-
-/* index 0x1017 :   Heartbeat producer                    
-                    Every HBProducerTime, the node sends its heartbeat */
-                    static UNS16 obj1017 = 0; //HBProducerTime in ms. If 0 : not activated 
-                                                     // Beware, it is over written when the 
-                                                     // node enters in reset mode.
-                                                     // See initResetMode() in init.c
-                    subindex Index1017[] =
-                    {
-	              { RW, uint16, sizeof(UNS16), &obj1017 }
-                    };
-
-/* index 0x1018 :   Identity object */
-                    /** index 1018: identify object. Adjust the entries for your node/company
-                    */
-                    /* Values can be modified */
-
-                    s_identity obj1018 =
-                    {
-                      4,       // number of supported entries
-                      0,  // Vendor-ID (given by the can-cia)
-                      0,  // Product Code
-                      0,  // Revision number
-                      0  // serial number
-                    };
-
-                    subindex Index1018[] =
-                    {
-                      { RO, uint8,  sizeof(UNS8),  (void*)&obj1018.count },
-                      { RO, uint32, sizeof(UNS32), (void*)&obj1018.vendor_id},
-                      { RO, uint32, sizeof(UNS32), (void*)&obj1018.product_code},
-                      { RO, uint32, sizeof(UNS32), (void*)&obj1018.revision_number},
-                      { RO, uint32, sizeof(UNS32), (void*)&obj1018.serial_number}
-                    };
-
-/* index 0x1200 :   The SDO Server parameters */
-                    /* BEWARE You cannot define more than one SDO server */
-                    /* The values should not be modified here, 
-                    but can be changed at runtime */
-                    // Beware that the default values that you could put here
-                    // will be over written at the initialisation of the node. 
-                    // See setNodeId() in init.c
-                    static s_sdo_parameter obj1200  = 
-                      { 3,                   // Number of entries. Always 3 for the SDO	       
-                        0x600 + NODE_ID,     // The cob_id transmited in CAN msg to the server     
-                        0x580 + NODE_ID,     // The cob_id received in CAN msg from the server  
-                        NODE_ID              // The node id of the client. Should not be modified 
-                      };
-                    static subindex Index1200[] =
-                    {
-                      { RO, uint8,  sizeof( UNS8 ), (void*)&obj1200.count },
-                      { RO, uint32, sizeof( UNS32), (void*)&obj1200.cob_id_client },
-                      { RO, uint32, sizeof( UNS32), (void*)&obj1200.cob_id_server },
-                      { RW, uint8,  sizeof( UNS8),  (void*)&obj1200.node_id }
-                    };
-
-/* index 0x1280 :   SDO client parameter */
-                    static s_sdo_parameter obj1280 = 
-                      { 3,     // Nb of entries 
-                        0x600, // cobid transmited to the server. The good value should be 0x600 + server nodeId
-                        0x580, // cobid received from the server. The good value should be 0x580 + server nodeId
-                        0x0    // server NodeId
-                      };
-                    static subindex Index1280[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1280.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1280.cob_id_client },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1280.cob_id_server },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1280.node_id }
-                      }; 
-
-/* index 0x1281 :   SDO client parameter */
-                    static s_sdo_parameter obj1281 = 
-                      { 3,     // Nb of entries 
-                        0x600, // cobid transmited to the server. The good value should be 0x600 + server nodeId
-                        0x580, // cobid received from the server. The good value should be 0x580 + server nodeId
-                        0x0    // server NodeId
-                      };
-                    static subindex Index1281[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1281.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1281.cob_id_client },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1281.cob_id_server },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1281.node_id }
-                      }; 
-
-/* index 0x1282 :   SDO client parameter */
-                    static s_sdo_parameter obj1282 = 
-                      { 3,     // Nb of entries 
-                        0x600, // cobid transmited to the server. The good value should be 0x600 + server nodeId
-                        0x580, // cobid received from the server. The good value should be 0x580 + server nodeId
-                        0x0    // server NodeId
-                      };
-                    static subindex Index1282[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1282.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1282.cob_id_client },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1282.cob_id_server },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1282.node_id }
-                      }; 
-
-/* index 0x1283 :   SDO client parameter */
-                    static s_sdo_parameter obj1283 = 
-                      { 3,     // Nb of entries 
-                        0x600, // cobid transmited to the server. The good value should be 0x600 + server nodeId
-                        0x580, // cobid received from the server. The good value should be 0x580 + server nodeId
-                        0x0    // server NodeId
-                      };
-                    static subindex Index1283[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1283.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1283.cob_id_client },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1283.cob_id_server },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1283.node_id }
-                      }; 
-
-/* index 0x1284 :   SDO client parameter */
-                    static s_sdo_parameter obj1284 = 
-                      { 3,     // Nb of entries 
-                        0x600, // cobid transmited to the server. The good value should be 0x600 + server nodeId
-                        0x580, // cobid received from the server. The good value should be 0x580 + server nodeId
-                        0x0    // server NodeId
-                      };
-                    static subindex Index1284[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1284.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1284.cob_id_client },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1284.cob_id_server },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1284.node_id }
-                      }; 
-
-/* index 0x1285 :   SDO client parameter */
-                    static s_sdo_parameter obj1285 = 
-                      { 3,     // Nb of entries 
-                        0x600, // cobid transmited to the server. The good value should be 0x600 + server nodeId
-                        0x580, // cobid received from the server. The good value should be 0x580 + server nodeId
-                        0x0    // server NodeId
-                      };
-                    static subindex Index1285[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1285.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1285.cob_id_client },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1285.cob_id_server },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1285.node_id }
-                      }; 
-
-/* index 0x1286 :   SDO client parameter */
-                    static s_sdo_parameter obj1286 = 
-                      { 3,     // Nb of entries 
-                        0x600, // cobid transmited to the server. The good value should be 0x600 + server nodeId
-                        0x580, // cobid received from the server. The good value should be 0x580 + server nodeId
-                        0x0    // server NodeId
-                      };
-                    static subindex Index1286[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1286.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1286.cob_id_client },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1286.cob_id_server },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1286.node_id }
-                      }; 
-
-/* index 0x1287 :   SDO client parameter */
-                    static s_sdo_parameter obj1287 = 
-                      { 3,     // Nb of entries 
-                        0x600, // cobid transmited to the server. The good value should be 0x600 + server nodeId
-                        0x580, // cobid received from the server. The good value should be 0x580 + server nodeId
-                        0x0    // server NodeId
-                      };
-                    static subindex Index1287[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1287.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1287.cob_id_client },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1287.cob_id_server },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1287.node_id }
-                      }; 
-
-/* index 0x1288 :   SDO client parameter */
-                    static s_sdo_parameter obj1288 = 
-                      { 3,     // Nb of entries 
-                        0x600, // cobid transmited to the server. The good value should be 0x600 + server nodeId
-                        0x580, // cobid received from the server. The good value should be 0x580 + server nodeId
-                        0x0    // server NodeId
-                      };
-                    static subindex Index1288[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1288.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1288.cob_id_client },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1288.cob_id_server },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1288.node_id }
-                      }; 
-
-/* index 0x1289 :   SDO client parameter */
-                    static s_sdo_parameter obj1289 = 
-                      { 3,     // Nb of entries 
-                        0x600, // cobid transmited to the server. The good value should be 0x600 + server nodeId
-                        0x580, // cobid received from the server. The good value should be 0x580 + server nodeId
-                        0x0    // server NodeId
-                      };
-                    static subindex Index1289[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1289.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1289.cob_id_client },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1289.cob_id_server },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1289.node_id }
-                      }; 
-
-/* index 0x1400 :   PDO receive communication parameter */
-                    static s_pdo_communication_parameter obj1400 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1400[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1400.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1400.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1400.type },
-                      }; 
-
-/* index 0x1401 :   PDO receive communication parameter */
-                    static s_pdo_communication_parameter obj1401 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1401[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1401.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1401.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1401.type },
-                      }; 
-
-/* index 0x1402 :   PDO receive communication parameter */
-                    static s_pdo_communication_parameter obj1402 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1402[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1402.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1402.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1402.type },
-                      }; 
-
-/* index 0x1600 :   PDO receive mapping parameter of PDO communication index 0x1400 */
-                    static UNS8 obj1600_cnt = 0; // Number of mapped variables
-                    static UNS32 obj1600_mappedVar[] = { 
-                        // Example to map a variable of 16 bits defined at index 0x6035, subindex 0x12 :
-                        // PDO_MAP(6035,12,16)
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00)
-                      };
-                    subindex Index1600[] = 
-                      { 
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1600_cnt },
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[0]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[1]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[2]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[3]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[4]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[5]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[6]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[7]}
-                      }; 
-
-/* index 0x1601 :   PDO receive mapping parameter of PDO communication index 0x1401 */
-                    static UNS8 obj1601_cnt = 0; // Number of mapped variables
-                    static UNS32 obj1601_mappedVar[] = { 
-                        // Example to map a variable of 16 bits defined at index 0x6035, subindex 0x12 :
-                        // PDO_MAP(6035,12,16)
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00)
-                      };
-                    subindex Index1601[] = 
-                      { 
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1601_cnt },
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[0]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[1]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[2]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[3]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[4]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[5]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[6]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[7]}
-                      }; 
-
-/* index 0x1602 :   PDO receive mapping parameter of PDO communication index 0x1402 */
-                    static UNS8 obj1602_cnt = 0; // Number of mapped variables
-                    static UNS32 obj1602_mappedVar[] = { 
-                        // Example to map a variable of 16 bits defined at index 0x6035, subindex 0x12 :
-                        // PDO_MAP(6035,12,16)
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00)
-                      };
-                    subindex Index1602[] = 
-                      { 
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1602_cnt },
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[0]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[1]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[2]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[3]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[4]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[5]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[6]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[7]}
-                      }; 
-
-/* index 0x1800 :   PDO transmit communication parameter */
-                    static s_pdo_communication_parameter obj1800 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1800[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1800.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1800.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1800.type },
-                      }; 
-
-/* index 0x1801 :   PDO transmit communication parameter */
-                    static s_pdo_communication_parameter obj1801 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1801[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1801.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1801.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1801.type },
-                      }; 
-
-/* index 0x1802 :   PDO transmit communication parameter */
-                    static s_pdo_communication_parameter obj1802 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1802[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1802.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1802.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1802.type },
-                      }; 
-
-/* index 0x1A00 :   PDO transmit mapping parameter of PDO communication index 0x1800 */
-                    static UNS8 obj1A00_cnt = 0; // Number of mapped variables
-                    static UNS32 obj1A00_mappedVar[] = { 
-                        // Example to map a variable of 16 bits defined at index 0x6035, subindex 0x12 :
-                        // PDO_MAP(6035,12,16)
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00)
-                      };
-                    subindex Index1A00[] = 
-                      { 
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1A00_cnt },
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A00_mappedVar[0]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A00_mappedVar[1]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A00_mappedVar[2]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A00_mappedVar[3]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A00_mappedVar[4]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A00_mappedVar[5]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A00_mappedVar[6]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A00_mappedVar[7]}
-                      }; 
-
-/* index 0x1A01 :   PDO transmit mapping parameter of PDO communication index 0x1801 */
-                    static UNS8 obj1A01_cnt = 0; // Number of mapped variables
-                    static UNS32 obj1A01_mappedVar[] = { 
-                        // Example to map a variable of 16 bits defined at index 0x6035, subindex 0x12 :
-                        // PDO_MAP(6035,12,16)
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00)
-                      };
-                    subindex Index1A01[] = 
-                      { 
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1A01_cnt },
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A01_mappedVar[0]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A01_mappedVar[1]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A01_mappedVar[2]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A01_mappedVar[3]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A01_mappedVar[4]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A01_mappedVar[5]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A01_mappedVar[6]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A01_mappedVar[7]}
-                      }; 
-
-/* index 0x1A02 :   PDO transmit mapping parameter of PDO communication index 0x1802 */
-                    static UNS8 obj1A02_cnt = 0; // Number of mapped variables
-                    static UNS32 obj1A02_mappedVar[] = { 
-                        // Example to map a variable of 16 bits defined at index 0x6035, subindex 0x12 :
-                        // PDO_MAP(6035,12,16)
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00)
-                      };
-                    subindex Index1A02[] = 
-                      { 
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1A02_cnt },
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A02_mappedVar[0]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A02_mappedVar[1]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A02_mappedVar[2]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A02_mappedVar[3]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A02_mappedVar[4]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A02_mappedVar[5]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A02_mappedVar[6]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1A02_mappedVar[7]}
-                      }; 
-
-
-/* index 0x6000 :   Mapped variable */
-                    subindex Index6000[] = 
-                     {
-                       { RW, uint32, sizeof (UNS32), (void*)&canopenErrNB_node5 }
-                     };
-
-/* index 0x6001 :   Mapped variable */
-                    subindex Index6001[] = 
-                     {
-                       { RW, uint32, sizeof (UNS32), (void*)&canopenErrVAL_node5 }
-                     };
-
-/* index 0x6002 :   Mapped variable */
-                    static UNS8 highestSubIndex_6002 = 4; // number of subindex - 1
-                    subindex Index6002[] = 
-                     {
-                       { RO, uint8, sizeof (UNS8), (void*)&highestSubIndex_6002 },
-                       { RW, uint8, sizeof (UNS8), (void*)&second },
-                       { RW, uint8, sizeof (UNS8), (void*)&minutes },
-                       { RW, uint8, sizeof (UNS8), (void*)&hour },
-                       { RW, uint8, sizeof (UNS8), (void*)&day }
-                     };
-
-/* index 0x6003 :   Mapped variable */
-                    static UNS8 highestSubIndex_6003 = 2; // number of subindex - 1
-                    subindex Index6003[] = 
-                     {
-                       { RO, uint8, sizeof (UNS8), (void*)&highestSubIndex_6003 },
-                       { RW, uint32, sizeof (UNS32), (void*)&canopenErrNB },
-                       { RW, uint32, sizeof (UNS32), (void*)&canopenErrVAL }
-                     };
-
-const indextable objdict[] = 
-{
-  DeclareIndexTableEntry(Index1000, 0x1000),
-  DeclareIndexTableEntry(Index1001, 0x1001),
-  DeclareIndexTableEntry(Index1005, 0x1005),
-  DeclareIndexTableEntry(Index1006, 0x1006),
-  DeclareIndexTableEntry(Index1007, 0x1007),
-  DeclareIndexTableEntry(Index1008, 0x1008),
-  DeclareIndexTableEntry(Index1009, 0x1009),
-  DeclareIndexTableEntry(Index100A, 0x100A),
-  DeclareIndexTableEntry(Index1016, 0x1016),
-  DeclareIndexTableEntry(Index1017, 0x1017),
-  DeclareIndexTableEntry(Index1018, 0x1018),
-  DeclareIndexTableEntry(Index1200, 0x1200),
-  DeclareIndexTableEntry(Index1280, 0x1280),
-  DeclareIndexTableEntry(Index1281, 0x1281),
-  DeclareIndexTableEntry(Index1282, 0x1282),
-  DeclareIndexTableEntry(Index1283, 0x1283),
-  DeclareIndexTableEntry(Index1284, 0x1284),
-  DeclareIndexTableEntry(Index1285, 0x1285),
-  DeclareIndexTableEntry(Index1286, 0x1286),
-  DeclareIndexTableEntry(Index1287, 0x1287),
-  DeclareIndexTableEntry(Index1288, 0x1288),
-  DeclareIndexTableEntry(Index1289, 0x1289),
-  DeclareIndexTableEntry(Index1400, 0x1400),
-  DeclareIndexTableEntry(Index1401, 0x1401),
-  DeclareIndexTableEntry(Index1402, 0x1402),
-  DeclareIndexTableEntry(Index1600, 0x1600),
-  DeclareIndexTableEntry(Index1601, 0x1601),
-  DeclareIndexTableEntry(Index1602, 0x1602),
-  DeclareIndexTableEntry(Index1800, 0x1800),
-  DeclareIndexTableEntry(Index1801, 0x1801),
-  DeclareIndexTableEntry(Index1802, 0x1802),
-  DeclareIndexTableEntry(Index1A00, 0x1A00),
-  DeclareIndexTableEntry(Index1A01, 0x1A01),
-  DeclareIndexTableEntry(Index1A02, 0x1A02),
-  DeclareIndexTableEntry(Index6000, 0x6000),
-  DeclareIndexTableEntry(Index6001, 0x6001),
-  DeclareIndexTableEntry(Index6002, 0x6002),
-  DeclareIndexTableEntry(Index6003, 0x6003),
-};
-
-// To count at which received SYNC a PDO must be sent.
-// Even if no pdoTransmit are defined, at least one entry is computed
-// for compilations issues.
-UNS8 count_sync[1] = {0, };
-  
-UNS16 firstIndex (enum e_first_object object, UNS16 *lastIndex)
-{
-  switch (object) {
-    case FIRST_SDO_SERVER :
-      *lastIndex = 11;
-      return 11;
-    case FIRST_SDO_CLIENT :
-      *lastIndex = 21;
-      return 12;
-    case FIRST_PDO_RCV :
-      *lastIndex = 24;
-      return 22;
-    case FIRST_PDO_RCV_MAP :
-      *lastIndex = 27;
-      return 25;
-    case FIRST_PDO_TRS :
-      *lastIndex = 30;
-      return 28;
-    case FIRST_PDO_TRS_MAP :
-      *lastIndex = 33;
-      return 31;
-  }
-  *lastIndex = 0;
-  return 0;
-}
-
-UNS16 getObjdictSize (void) 
-{
-  return sizeof(objdict)/sizeof(objdict[0]);
-} 
--- a/examples/AppliMaster_Linux/objdict.html	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>CANOpen object dictionary Configuration</title>
-<style type="text/css">
-         h1 {
-	   background: #FFDD66;
-	   border: 3px solid #AA0000;
-           margin: 2em;
-           padding: 1em;
-	 }
-
-         h2, h2.dico, h2.pdo {
-	   background: #5577FF;
-	   border: 1px solid #AA0000;
-           margin: 1em;
-	 }
-	 
-	  h1 em.node-id {
-	  color: #0728FF;
-	  padding-left: 1em;
-	  padding-right: 1em;
-	  }
-
-	  h1 em.type-node {
-	  color: #26BE08;
-	  padding-left: 1em;
-	  padding-right: 1em;
-	  }
-
-	  em.pdo-mode {
-	  color: #26BE08;
-	  }
-
-	  .entree {
-	  color: #AA0000;
-	  }
-         
-	  .nom-var, .node-nom {
-	  color: #660000;
-	  }
-
-	</style>
-</head>
-<body text="#000000" bgcolor="#ffffff">
-<h1>Object dictionary for Node : </h1>
-<h1>
-<em class="node-nom">Master</em><em class="type-node">master</em>
-</h1>
-<h2>Overview</h2>
-<p>
-	How to make the object dictionary of the node ?
-	First, use Jaxe (command run_objdict) to edit an xml description file
-of the dictionary : objdict.xml.
-Then, run the php program : makeobjetdict.php. You can launch php through a web browser
-if you have installed a server, or, on Linux, you can launch php in command line :
-php-cgi makeobjetdict.php. It compute the file objdict.c. Link it to
-        your project.
-<br>Note : To define the node id, use in your code the function setNodeId(UNS8 nodeId)
-	</p>
-<p>
-	  Then the node can be connected to the network. The master must configure it
-	  by sending SDO. It will write values in its index, subindex. What to configure ? 
-	  <ul>
-<li>Receiving heartbeats from which nodes ? Waiting time ?</li>
-<li>Emitting heartbeats or not ? time btw 2 heartbeats ? </li>
-<li>Defining a cobId for each PDO receive and transmit</li>
-<li>How to transmit a PDO ? on synchro ? request ? event ?</li>
-<li>What variables to put in each PDO receive and transmit ? </li>
-<li>...</li>
-</ul>
-</p>
-	To avoid configuring the node at the connection, you can put the values directly
-in the dictionary objdict.c. But it is boring and unsafe because it is too easy to make
-a mistake !
-
-      
-	<h2>Number of heartbeat consumers : 
-    <em class="entree">1</em>
-</h2>
-<p>This means that the node can expect heartbeats sent by 1 nodes. </p>
-<h2>Number of SDO clients : 
-    <em class="entree">10</em>
-</h2>
-<p>Usualy, a slave node does not have the use of SDO clients, but
-    today, for the library, you must define one. The Master, which can
-    send SDO to "n" slaves nodes, must define here "n" SDO
-    clients. Remember that in most cases, the SDO protocol is used by
-    the master to configure a slave dictionary or read a value. In
-    this use, the master is the client, and the slave is the server.</p>
-<h2>Maximum objects in a PDO (receive or transmit) : 
-    <em class="entree">8</em>
-</h2>
-<p>This is defining how many variables can be transmited in a
-    PDO. (maximum is 8).</p>
-<p>For each variable, a table is created, so if you have less room
-    in memory, put a value under 8.</p>
-<h2>Number of PDO receive : 
-    <em class="entree">3</em>
-</h2>
-<p>The node can receive 3 PDO.</p>
-<p>The communication parameters are defined at index 0x1400 to 0x1400 + 2</p>
-<p>The mapping parameters are defined at index 0x1600 to 0x1600 + 2</p>
-<h2>Number of PDO transmit : 
-    <em class="entree">3</em>
-</h2>
-<p>The node can transmit 3 PDO.</p>
-<p>The communication parameters are defined at index 0x1800 to 0x1800 + 2</p>
-<p>The mapping parameters are defined at index 0x1A00 to 0x1A00 + 2</p>
-<h2>Mapped variables and tables</h2>
-<p>3 tables are defined for the mapping, starting at index 0x2000, 0x6000 and 0x6200.
-	You must start the mapping at the beginning of one of a table, without holes in index
-or subindex. For example, variables in 0x2000 and 0x2001 is ok, but variables in 0x2000 and 0x2002 is not allowed, because you are loosing room in memory. It is the same for the subindex.
-</p>
-<p>Here are some others rules for the mapping : </p>
-<ul>
-<li>At an Index, you can map a variable at subindex 0x0 or 0x1, as you like.</li>
-<li>To map several variables at the same Index, you must start at subindex 0x1,
-	  because in this case, the subindex 0x0 contains the number of subindex.</li>
-<li>You cannot map variables and tables at the same index.</li>
-<li>The mapping of a table is always starting at subindex 0x1.</li>
-</ul>
-<table class="mapping">
-<tr>
-<td>Name</td><td>Bits</td><td>Index</td><td>Sub-index</td>
-</tr>
-<tr>
-<td><em>canopenErrNB_node5</em></td><td><em class="entree">32</em></td><td><em class="entree">0x6000</em></td><td><em class="entree">0x0</em></td>
-</tr>
-<tr>
-<td><em>canopenErrVAL_node5</em></td><td><em class="entree">32</em></td><td><em class="entree">0x6001</em></td><td><em class="entree">0x0</em></td>
-</tr>
-<tr>
-<td><em>second</em></td><td><em class="entree">8</em></td><td><em class="entree">0x6002</em></td><td><em class="entree">0x1</em></td>
-</tr>
-<tr>
-<td><em>minutes</em></td><td><em class="entree">8</em></td><td><em class="entree">0x6002</em></td><td><em class="entree">0x02</em></td>
-</tr>
-<tr>
-<td><em>hour</em></td><td><em class="entree">8</em></td><td><em class="entree">0x6002</em></td><td><em class="entree">0x3</em></td>
-</tr>
-<tr>
-<td><em>day</em></td><td><em class="entree">8</em></td><td><em class="entree">0x6002</em></td><td><em class="entree">0x4</em></td>
-</tr>
-<tr>
-<td><em>canopenErrNB</em></td><td><em class="entree">32</em></td><td><em class="entree">0x6003</em></td><td><em class="entree">0x01</em></td>
-</tr>
-<tr>
-<td><em>canopenErrVAL</em></td><td><em class="entree">32</em></td><td><em class="entree">0x6003</em></td><td><em class="entree">0x02</em></td>
-</tr>
-</table>
-</body>
-</html>
--- a/examples/AppliMaster_Linux/objdict.xml	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<node manufacturer_device_name_1008="Appli_Master_Linux" name="Master" type_node="master">
-<heartbeat_consumers nombre="1"/>
-<sdo_clients nombre="10"/>
-<pdo type_rx_tx="rx">
-
-</pdo>
-<pdo type_rx_tx="rx">
-
-</pdo>
-<pdo type_rx_tx="rx">
-
-</pdo>
-<pdo type_rx_tx="tx">
-
-</pdo>
-<pdo type_rx_tx="tx">
-
-</pdo>
-<pdo type_rx_tx="tx">
-
-</pdo>
-<mapped_variable index="0x6000" name="canopenErrNB_node5" size_in_bits="32" sub_index="0x0"/>
-<mapped_variable index="0x6001" name="canopenErrVAL_node5" size_in_bits="32" sub_index="0x0"/>
-<mapped_variable index="0x6002" name="second" size_in_bits="8" sub_index="0x1"/>
-<mapped_variable index="0x6002" name="minutes" size_in_bits="8" sub_index="0x02"/>
-<mapped_variable index="0x6002" name="hour" size_in_bits="8" sub_index="0x3"/>
-<mapped_variable index="0x6002" name="day" size_in_bits="8" sub_index="0x4"/>
-<mapped_variable index="0x6003" name="canopenErrNB" size_in_bits="32" sub_index="0x01"/>
-<mapped_variable index="0x6003" name="canopenErrVAL" size_in_bits="32" sub_index="0x02"/>
-</node>
\ No newline at end of file
--- a/examples/AppliSlave_HCS12/Makefile.in	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-#! gmake
-
-#
-# Copyright (C) 2006 Laurent Bessard
-# 
-# This file is part of canfestival, a library implementing the canopen
-# stack
-# 
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-# 
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-# 
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-# 
-
-CC = SUB_CC
-OPT_CFLAGS = -Os
-CFLAGS = SUB_OPT_CFLAGS
-PROG_CFLAGS = SUB_PROG_CFLAGS
-OS_NAME = SUB_OS_NAME
-ARCH_NAME = SUB_ARCH_NAME
-PREFIX = SUB_PREFIX
-BINUTILS_PREFIX = SUB_BINUTILS_PREFIX
-TARGET = SUB_TARGET
-
-INCLUDES = -I../../include -I../../include/hcs12
-MEMORY_X = ../../include/hcs12/board/arch
-
-OBJCOPY = $(BINUTILS_PREFIX)objcopy
-OBJCOPY_FLAGS = --only-section=.text --only-section=.rodata --only-section=.vectors --only-section=.data
-
-PROGDEFINES = -mnoshort -Wall -Wmissing-prototypes -fno-strict-aliasing -g
-
-PGR=AppliSlave
-
-SLAVE_OBJS = objdict.o appli.o vectors.o
-
-OBJS = ../../src/hc12_pdo.o ../../src/hc12_sdo.o ../../src/hc12_init.o ../../src/hc12_sync.o\
-       ../../src/hc12_objacces.o ../../src/hc12_lifegrd.o ../../src/hc12_timer.o ../../src/hc12_nmtSlave.o\
-       ../../drivers/hc12/canOpenDriver.o ../../drivers/hc12/ports.o ../../drivers/hc12/interrupt.o\
-       ../../drivers/hc12/timerhw.o ../../drivers/hc12/variahw.o $(SLAVE_OBJS)
-
-LDFLAGS= -Wl,-m,m68hc12elfb  -L$(MEMORY_X)
-
-all: $(PGR).elf $(PGR).s19 $(PGR).b $(PGR).s MSG
-
-%o: %c
-	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -c -o $@ $<
-
-%o: %s
-	$(CC)  -c -x assembler-with-cpp $(PROG_CFLAGS) -o  $@ $<
-
-$(PGR).elf: $(OBJS)
-	$(CC) $(CFLAGS) $(LDFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ $(OBJS)
-
-$(PGR).s19: $(PGR).elf
-	$(OBJCOPY) --output-target=srec $(OBJCOPY_FLAGS) $< $@
-
-$(PGR).b: $(PGR).elf
-	$(OBJCOPY) --output-target=binary --gap-fill=255 --only-section=.data $(OBJCOPY_FLAGS) $< $@
-
-$(PGR).s: $(PGR).elf
-	@echo "Desassemble"
-	$(BINUTILS_PREFIX)objdump -D $(PGR).elf > $(PGR).s
-
-MSG:
-	$(BINUTILS_PREFIX)readelf -S $(PGR).elf
-	@echo
-	$(BINUTILS_PREFIX)size $(PGR).elf
-
-clean:
-	rm -f $(SLAVE_OBJS)
-
-mrproper: clean
-	rm -f $(PGR).elf $(PGR).s19 $(PGR).b $(PGR).s
-
--- a/examples/AppliSlave_HCS12/appli.c	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,514 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack. 
-
-Copyright (C): Edouard TISSERANT and Francis DUPIN
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <stddef.h> /* for NULL */
-
-#include <asm-m68hc12/portsaccess.h>
-#include <asm-m68hc12/ports_def.h>
-#include <asm-m68hc12/ports.h>
-#include  <interrupt.h>
-
-#include <applicfg.h>
-#include <candriver.h>
-#include <timerhw.h>
-
-#include "../include/def.h"
-#include "../include/can.h"
-#include "../include/objdictdef.h"
-#include "../include/objacces.h"
-#include "../include/canOpenDriver.h"
-#include "../include/sdo.h"
-#include "../include/pdo.h"
-#include "../include/init.h"
-#include "../include/timer.h"
-#include "../include/lifegrd.h"
-#include "../include/sync.h"
-
-#include "../include/nmtSlave.h"
-
-
-
-// HCS12 configuration
-// -----------------------------------------------------
-
-enum E_CanBaudrate 
-{
-   CAN_BAUDRATE_250K,
-   CAN_BAUDRATE_500K,
-   CAN_BAUDRATE_1M,
-   CAN_BAUDRATE_OLD_VALUE
-};
-
-const canBusTime CAN_Baudrates[] =
-{
-   {
-      1,  /* clksrc: Use the bus clock : 16 MHz, the freq. of the quartz's board        */
-      3,  /* brp :  chose btw 0 and 63 (6 bits).  freq time quantum = 16MHz / (brp + 1) */
-      0,  /* sjw : chose btw 0 and 3 (2 bits). Sync on (sjw + 1 ) time quantum          */
-      0,  /* samp : chose btw 0 and 3 (2 bits) (samp + 1 ) samples per bit              */
-      1,  /* tseg2 : chose btw 0 and 7 (3 bits) Segment 2 width = (tseg2 + 1)  tq       */
-     12,  /* tseg1 : chose btw 0 and 15 (4 bits) Segment 1 width = (tseg1 + 1)  tq      */
-
-      /*
-      With these values, 
-      - The width of the bit time is 16 time quantum :
-          - 1 tq for the SYNC segment (could not be modified)
-          - 13 tq for the TIME 1 segment (tseg1 = 12)
-          - 2 tq for the TIME 2 segment (tseg2 = 1)
-      - Because the bus clock of the MSCAN is 16 MHZ, and the 
-        freq of the time quantum is 4 MHZ (brp = 3+1), and  there are 16 tq in the bit time,
-        so the freq of the bit time is 250 kHz.
-      */
-   },
-
-   {
-      1,  /* clksrc: Use the bus clock : 16 MHz, the freq. of the quartz's board        */
-      1,  /* brp :  chose btw 0 and 63 (6 bits).  freq time quantum = 16MHz / (brp + 1) */
-      0,  /* sjw : chose btw 0 and 3 (2 bits). Sync on (sjw + 1 ) time quantum          */
-      0,  /* samp : chose btw 0 and 3 (2 bits) (samp + 1 ) samples per bit              */
-      1,  /* tseg2 : chose btw 0 and 7 (3 bits) Segment 2 width = (tseg2 + 1)  tq       */
-     12,  /* tseg1 : chose btw 0 and 15 (4 bits) Segment 1 width = (tseg1 + 1)  tq      */
-
-      /*
-      With these values, 
-      - The width of the bit time is 16 time quantum :
-          - 1 tq for the SYNC segment (could not be modified)
-          - 13 tq for the TIME 1 segment (tseg1 = 12)
-          - 2 tq for the TIME 2 segment (tseg2 = 1)
-      - Because the bus clock of the MSCAN is 16 MHZ, and the 
-        freq of the time quantum is 8 MHZ (brp = 1+1), and  there are 16 tq in the bit time,
-        so the freq of the bit time is 500 kHz.
-      */
-    },
-
-	{
-      1,  /* clksrc: Use the bus clock : 16 MHz, the freq. of the quartz's board        */
-      1,  /* brp :  chose btw 0 and 63 (6 bits).  freq time quantum = 16MHz / (brp + 1) */
-      0,  /* sjw : chose btw 0 and 3 (2 bits). Sync on (sjw + 1 ) time quantum          */
-      0,  /* samp : chose btw 0 and 3 (2 bits) (samp + 1 ) samples per bit              */
-      1,  /* tseg2 : chose btw 0 and 7 (3 bits) Segment 2 width = (tseg2 + 1)  tq       */
-      4,  /* tseg1 : chose btw 0 and 15 (4 bits) Segment 1 width = (tseg1 + 1)  tq      */
-
-      /*
-      With these values, 
-      - The width of the bit time is 16 time quantum :
-          - 1 tq for the SYNC segment (could not be modified)
-          - 5 tq for the TIME 1 segment (tseg1 = 4)
-          - 2 tq for the TIME 2 segment (tseg2 = 1)
-      - Because the bus clock of the MSCAN is 16 MHZ, and the 
-        freq of the time quantum is 8 MHZ (brp = 1+1), and  there are 8 tq in the bit time,
-        so the freq of the bit time is 1 MHz.
-      */
-    },
-
-	{
-      1,  /* clksrc: Use the bus clock : 16 MHz, the freq. of the quartz's board        */
-      0,  /* brp :  chose btw 0 and 63 (6 bits).  freq time quantum = 16MHz / (brp + 1) */
-      1,  /* sjw : chose btw 0 and 3 (2 bits). Sync on (sjw + 1 ) time quantum          */
-      1,  /* samp : chose btw 0 and 3 (2 bits) (samp + 1 ) samples per bit              */
-      4,  /* tseg2 : chose btw 0 and 7 (3 bits) Segment 2 width = (tseg2 + 1)  tq       */
-      9,  /* tseg1 : chose btw 0 and 15 (4 bits) Segment 1 width = (tseg1 + 1)  tq      */
-
-      /*
-      With these values, 
-      - The width of the bit time is 16 time quantum :
-          - 1 tq for the SYNC segment (could not be modified)
-          - 10 tq for the TIME 1 segment (tseg1 = 9)
-          - 5 tq for the TIME 2 segment (tseg2 = 4)
-      - Because the bus clock of the MSCAN is 16 MHZ, and the 
-        freq of the time quantum is 16 MHZ (brp = 0), and  there are 16 tq in the bit time,
-        so the freq of the bit time is 1 MHz.
-      */
-    }
-};
-
-
-// The variables sent or updated by PDO
-// -----------------------------------------------------
-extern UNS8 seconds;		// Mapped at index 0x2000, subindex 0x1
-extern UNS8 minutes;		// Mapped at index 0x2000, subindex 0x2
-extern UNS8 hours;		// Mapped at index 0x2000, subindex 0x3
-extern UNS8 day;		// Mapped at index 0x2000, subindex 0x4
-extern UNS32 canopenErrNB;	// Mapped at index 0x6000, subindex 0x0
-extern UNS32 canopenErrVAL;	// Mapped at index 0x6001, subindex 0x0
-
-// Required definition variables
-// -----------------------------
-// The variables that you should define for debugging.
-// They are used by the macro MSG_ERR and MSG_WAR in applicfg.h
-// if the node is a slave, they can be mapped in the object dictionnary.
-// if not null, allow the printing of message to the console
-// Could be managed by PDO
-UNS8 printMsgErrToConsole = 1;
-UNS8 printMsgWarToConsole = 1;
-
-
-
-/*************************User's variables declaration**************************/
-UNS8 softCount = 0;
-UNS8 lastMinute = 0;
-UNS8 lastSecond = 0;
-UNS8 sendingError = 0;
-//--------------------------------FONCTIONS-------------------------------------
-/* You *must* have these 2 functions in your code*/
-void heartbeatError(UNS8 heartbeatID);
-void SD0timeoutError(UNS8 bus_id, UNS8 line);
-
-// Interruption timer 3. (The timer 4 is used by CanOpen)
-void __attribute__((interrupt)) timer3Hdl (void);
-
-void incDate(void);
-void initLeds(void);
-void initTimerClk(void);
-void initCanHCS12 (void);
-void initialisation(void);
-void preOperational(void);
-void operational(void);
-void stopped(void);
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-// Interruption timer 3
-void __attribute__((interrupt)) timer3Hdl (void)
-{
-  //IO_PORTS_8(PORTB) ^= 0x10;
-  //IO_PORTS_8(PORTB) &= ~0x20;
-  IO_PORTS_8(TFLG1) = 0x08; // RAZ du flag interruption timer 3
-  // Calcul evt suivant. Clock 8 MHz -> 8000 evt de 1 ms!! Doit tenir sur 16 bits
-  // Attention, ça change si on utilise la pll
-  // Lorsque le timer atteindra la valeur de TC3 (16 bits), l'interruption timer3Hdl sera déclenchée
-  // Si on utilise la PLL à 24 MHZ, alors la vitesse du bus est multipliée par 3.
-
-/*   Assume that our board uses a 16 MHz quartz */
-/*   Without pre-division, 8000 counts takes 1 ms. */
-/*   We are using a pre-divisor of 32. (register TSCR2) See in CanOpenDriverHC12/timerhw.c  */
-/*   So 10000 counts takes 40 ms. */
-/*   We must have a soft counter of 25 to count a second. */
-  
-  IO_PORTS_16(TC3H) += (10000); // IT every 40000 count.
-  softCount++;
-  if (softCount == 25) {
-    softCount = 0;
-    incDate();
-  }
-}
-
-//------------------------------------------------------------------------------
-void heartbeatError(UNS8 heartbeatID)
-{
-  MSG_ERR(0x1F00, "!!! No heart beat received from node : ", heartbeatID);
-}
-
-//------------------------------------------------------------------------------
-void SD0timeoutError (UNS8 bus_id, UNS8 line)
-{
-  // Informations on what occurs are in transfers[bus_id][line]....
-  // See scanSDOtimeout() in sdo.c
-}
-
-//------------------------------------------------------------------------------
-// Incrementation of the date, every second
-void incDate(void)
-{
-  if (seconds == 59) {
-    seconds = 0;
-    if (minutes == 59) {
-      minutes = 0;
-      if (hours == 23) {
-	hours = 0;
-	day++;
-      } 
-      else
-	hours++;
-    }
-    else 
-      minutes++;
-  }
-  else
-    seconds++;
-
-  // Toggle the led 4 every seconds
-  IO_PORTS_8(PORTB) ^= 0x10;
-
-}
-
-//Initialisation of the port B for the leds.
-void initLeds(void)
-{
-  // Port B is output
-  IO_PORTS_8(DDRB)= 0XFF;
-  // RAZ
-  IO_PORTS_8(PORTB) = 0xFF;
-}
-
-
-
-//------------------------------------------------------------------------------
-// Init the timer for the clock demo
-void initTimerClk(void)
-{
-
-  lock();   // Inhibe les interruptions
-
-  // Configuration du Channel 3
-  IO_PORTS_8(TIOS) |= 0x08;     // Canal 3 en sortie
-  IO_PORTS_8(TCTL2) &= ~(0xC0); // Canal 3 déconnecté du pin de sortie
-  IO_PORTS_8(TIE) |= 0x08;      // Autorise interruption Canal 3
-  IO_PORTS_8(TSCR1) |= 0x80;    // Mise en route du timer
-  unlock(); // Autorise les interruptions
-}
-
-
-//------------------------------------------------------------------------------
-
-// A placer avant initTimer de la bibliothèque CanOpen
-/* void initTimerbis(void) */
-/* {   */
-
-/*   lock();                      // Inhibe les interruptions */
-/*   // Configuration des IT Channels (0..3) */
-/*   IO_PORTS_8(TIOS)  &= 0xF0;  // Canals 0->3 en entrées.    */
-/*   IO_PORTS_8(TCTL4) &= 0XFD;  // Canal 0 détection sur front montant. */
-/*   IO_PORTS_8(TCTL4) |= 0X01;    */
-/*   IO_PORTS_8(TCTL4) &= 0XF7;  // Canal 1 détection sur front montant. */
-/*   IO_PORTS_8(TCTL4) |= 0X04; */
-/*   IO_PORTS_8(TCTL4) &= 0XDF;  // Canal 2 détection sur front montant. */
-/*   IO_PORTS_8(TCTL4) |= 0X10;   */
-/*   IO_PORTS_8(TCTL4) &= 0X7F;  // Canal 3 détection sur front montant. */
-/*   IO_PORTS_8(TCTL4) |= 0X40;        */
-/*   IO_PORTS_8(TSCR2) |= 0X05;  // Pre-scaler = 32.  */
-   
-/*   IO_PORTS_8(ICOVW) |= 0x0F;  // La sauvgrade des valeures de TC0 et TC0H  */
-/*                               // correspondant aux canals (0..3) jusqu'a la */
-/*                               // prochaine lecture dans ces registres.  */
-/*   MASK  = IO_PORTS_8(ICSYS); */
-/*   MASK &= 0xFE;               // Canals (0..3) en IC QUEUE MODE. */
-/*   MASK |= 0x08;               // Canals (0..3) : génére une interruption aprés  */
-/*                               // la capture de deux valeures du timer sur detection */
-/*                               // d'un front montant à l'entrée des canals (0..3). */
-/*   MASK |= 0x02;               */
-/*   IO_PORTS_8(ICSYS) = MASK; */
-/*   IO_PORTS_16(TC0HH);         // Vider le registre holding correspondant au canal0. */
-/*   IO_PORTS_8(TSCR1) |= 0x10;  // RAZ automatique des flags d'interruption aprés lecture */
-/*                               // dans les registres correspondant.   */
-                              
-/*   IO_PORTS_8(TIE)   |= 0x0F;  // Autorise interruption Canals (0..3). */
-/*   IO_PORTS_8(TSCR2) |= 0X80;  // Autorise interruption sur l'Overflow.  */
-/*   unlock();                   // Autorise les interruptions  */
-  
-/* } */
-
-//------------------------------------------------------------------------------
-
-
-
-void initCanHCS12 (void)
-{  
-  //Init the HCS12 microcontroler for CanOpen 
-  initHCS12();
-   // Init the HCS12  CAN driver
-  const canBusInit bi0 = {
-    0,    /* no low power                 */ 
-    0,    /* no time stamp                */
-    1,    /* enable MSCAN                 */
-    0,    /* clock source : oscillator (In fact, it is not used)   */
-    0,    /* no loop back                 */
-    0,    /* no listen only               */
-    0,    /* no low pass filter for wk up */
-	CAN_Baudrates[CAN_BAUDRATE_250K],
-    {
-      0x00,    /* Filter on 16 bits. See Motorola Block Guide V02.14 fig 4-3 */
-      0x00, 0xFF, /* filter 0 hight accept all msg      */
-      0x00, 0xFF, /* filter 0 low accept all msg        */
-      0x00, 0xFF, /* filter 1 hight filter all of  msg  */
-      0x00, 0xFF, /* filter 1 low filter all of  msg    */
-      0x00, 0xFF, /* filter 2 hight filter most of  msg */
-      0x00, 0xFF, /* filter 2 low filter most of  msg   */
-      0x00, 0xFF, /* filter 3 hight filter most of  msg */
-      0x00, 0xFF, /* filter 3 low filter most of  msg   */
-    }
-  };   
-
-  canInit(CANOPEN_LINE_NUMBER_USED, bi0);  //initialize filters...
-  unlock(); // Allow interruptions
-}
-
-
-/*********************************************************************/
-void initialisation( void )
-{ 
-  //initcapteur();      //initialisation du capteur, timer, compteurs logiciels
-  initCanHCS12();   //initialisation du bus Can
-  MSG_WAR(0X3F05, "I am in INITIALISATION mode ", 0);
-  /* Defining the node Id */
-  setNodeId(0x05);
-  MSG_WAR(0x3F06, "My node ID is : ", getNodeId()); 
-  {
-    UNS8 *data;
-    UNS8 size;
-    UNS8 dataType;
-    // Manufacturer Device name (default = empty string)
-    getODentry(0x1008, 0x0, (void **)&data, &size, &dataType, 0);
-    MSG_WAR(0x3F09, data, 0);
-    // Manufacturer Hardware version. (default = compilation. date)
-    getODentry(0x1009, 0x0, (void **)&data, &size, &dataType, 0);
-    MSG_WAR(0x3F09, data, 0);
-    // Manufacturer Software version. (default = compilation. time)
-    getODentry(0x100A, 0x0, (void **)&data, &size, &dataType, 0);
-    MSG_WAR(0x3F09, data, 0);
-  }
-  initCANopenMain();    //initialisation du canopen 
-  heartbeatInit();      //initialisation du lifeguarding
-  initResetMode();
-  initTimer();          //initialisation of the timer used by Canopen
-  initTimerClk();
-}
-
-
-/*********************************************************************/
-void preOperational(void)
-{
-  // Test if the heartBeat have been received. Send headbeat
-  heartbeatMGR();
-  // Read message
-  receiveMsgHandler(0);
-}
-
-
-/********************************************************************/
-void operational( void )
-{ 
-
-  // Init the errors
-  canopenErrNB = 0;
-  canopenErrVAL = 0;
-
-  // Test if the heartBeat have been received. Send headbeat
-  heartbeatMGR();
-  // Read message
-  receiveMsgHandler(0); 
-  
-  if (lastMinute != minutes) {
-    MSG_WAR(0x3F00, "event : minutes change -> node decides to send it. Value : ", minutes);
-    sendPDOevent( 0, &minutes );
-    lastMinute = minutes;
-  }
-
-  if (canopenErrNB == 0)
-    sendingError = 0;
-
-  
-  if (lastSecond != seconds) {
-    MSG_WAR (0x3F50, "Seconds = ", seconds);
-    if ((seconds == 50) && (sendingError == 0))
-      {
-	MSG_ERR(0x1F55, "DEMO of ERROR. Sent by PDO. Value : ", 0xABCD);
-	sendingError = 1;
-      }
-    
-    if (canopenErrNB) {
-      MSG_WAR(0x3F56, "ERROR nb : ",  canopenErrNB);
-    }
-    lastSecond = seconds;
-    
-  }
-
-}
-
-
-/*****************************************************************************/
-void stopped( void )
-{
-  heartbeatMGR();
-  // Read message
-  receiveMsgHandler(0);
-}
-
-
-/*****************************************************************************/
-
-
-
-/********************************* MAIN ***************************************/
-
- 
-int main ()
-{
-  e_nodeState lastState = Unknown_state;
-
-  /* CanOpen slave state machine         */
-  /* ------------------------------------*/
-    
-  while(1) { /* slave's state machine */
-      
-    switch( getState() ) {				
-    case Initialisation:
-      if (lastState != getState()) {
-	initLeds();
-	IO_PORTS_8(PORTB) &= ~ 0x01; // led  0         : ON
-	IO_PORTS_8(PORTB) |=   0x0E; // leds 1, 2, 3   : OFF
-	MSG_WAR(0X3F10, "Entering in INITIALISATION mode ", 0);
-      }
-      initialisation();
-      /* change automatically into pre_operational state */ 
-      lastState = Initialisation;
-      setState(Pre_operational);
-      break;
-					
-    case Pre_operational:
-      if (lastState != getState()) {
-	IO_PORTS_8(PORTB) &= ~ 0x03; // leds 0, 1      : ON
-	IO_PORTS_8(PORTB) |=   0x0C; // leds 2, 3      : OFF
-	MSG_WAR(0X3F11, "Entering in PRE_OPERATIONAL mode ", 0);
-	initPreOperationalMode();
-      }
-      preOperational();
-      if (lastState == Initialisation)
-	slaveSendBootUp(0);
-      lastState = Pre_operational;
-      break;
-					
-    case Operational:
-      if (lastState != getState()) {
-	IO_PORTS_8(PORTB) &= ~ 0x07; // leds 0, 1, 2   : ON
-	IO_PORTS_8(PORTB) |=   0x08; // leds 3         : OFF
-	MSG_WAR(0X3F12, "Entering in OPERATIONAL mode ", 0);
-      }
-      operational();    
-      lastState = Operational;	
-      break;
-	  		
-    case Stopped:
-      if (lastState != getState()) {
-	IO_PORTS_8(PORTB) |=   0x0F; // leds 0, 1, 2, 3 : OFF
-	MSG_WAR(0X3F13, "Entering in  STOPPED mode", 0);
-      }
-      stopped();
-      lastState = Stopped;
-      break;
-    }//end switch case	
-
-  }
-  return (0); 
-}
- 
--- a/examples/AppliSlave_HCS12/objdict.c	Tue Feb 13 17:21:19 2007 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,621 +0,0 @@
-/*
-This file is part of CanFestival, a library implementing CanOpen Stack. 
-
-Copyright (C): Edouard TISSERANT and Francis DUPIN
-
-See COPYING file for copyrights details.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <stddef.h>
-
-#include <applicfg.h>
-#include "def.h"
-#include "can.h"
-#include "objdictdef.h"
-#include "pdo.h"
-#include "sdo.h"
-#include "sync.h"
-#include "lifegrd.h"
-#include "nmtSlave.h"
-
-/**************************************************************************/
-/* Declaration of the mapped variables                                    */
-/**************************************************************************/
-
-
-
-/*// Copy and uncomment this code to your main file
-extern UNS8 seconds;		// Mapped at index 0x2000, subindex 0x01
-extern UNS8 minutes;		// Mapped at index 0x2000, subindex 0x02
-extern UNS8 hours;		// Mapped at index 0x2000, subindex 0x03
-extern UNS8 day;		// Mapped at index 0x2000, subindex 0x04
-extern UNS32 canopenErrNB;		// Mapped at index 0x6000, subindex 0x00
-extern UNS32 canopenErrVAL;		// Mapped at index 0x6001, subindex 0x00
-extern UNS8 strTest[10];		// Mapped at index 0x6002, subindex 0x00
-
-// END copy to main file
-*/
-
-UNS8 seconds;		// Mapped at index 0x2000, subindex 0x01
-UNS8 minutes;		// Mapped at index 0x2000, subindex 0x02
-UNS8 hours;		// Mapped at index 0x2000, subindex 0x03
-UNS8 day;		// Mapped at index 0x2000, subindex 0x04
-UNS32 canopenErrNB;		// Mapped at index 0x6000, subindex 0x00
-UNS32 canopenErrVAL;		// Mapped at index 0x6001, subindex 0x00
-UNS8 strTest[10];		// Mapped at index 0x6002, subindex 0x00
-
-/**************************************************************************/
-/* Declaration of the value range types                                   */
-/**************************************************************************/
-
-
-
-UNS32 valueRangeTest (UNS8 typeValue, UNS32 unsValue, REAL32 realValue)
-{
-  return 0;
-}
-
-
-/**************************************************************************/
-/* The node id                                                            */
-/**************************************************************************/
-/* Computed by strNode */
-/* node_id default value. 
-   This default value is deprecated.
-   You should always overwrite this by using the function setNodeId(UNS8 nodeId) in your C code.
-*/
-#define NODE_ID 0x01
-UNS8 bDeviceNodeId = NODE_ID;
-
-
-//*****************************************************************************/
-/* Computed by strStartDico */
-
-/* Array of message processing information */
-/* Should not be modified */
-volatile const proceed_info proceed_infos[] = {
-  {NMT,		"NMT",	        proceedNMTstateChange},
-  {SYNC,        "SYNC",         proceedSYNC},
-  {TIME_STAMP,	"TStmp",	NULL},
-  {PDO1tx,	"PDO1t",        proceedPDO},
-  {PDO1rx,	"PDO1r",	proceedPDO},
-  {PDO2tx,	"PDO2t",	proceedPDO},
-  {PDO2rx,	"PDO2r",	proceedPDO},
-  {PDO3tx,	"PDO3t",	proceedPDO},
-  {PDO3rx,	"PDO3r",	proceedPDO},
-  {PDO4tx,	"PDO4t",	proceedPDO},
-  {PDO4rx,	"PDO4r",	proceedPDO},
-  {SDOtx,	"SDOt",	        proceedSDO},
-  {SDOrx,	"SDOr",         proceedSDO},
-  {0xD,		"Unkw",	        NULL},
-  {NODE_GUARD,	"NGrd",         proceedNMTerror},
-  {0xF,		"Unkw",	        NULL}
-};
-
-  // Macros definition
-
-/* Beware : 
-index                 *must* be writen 4 numbers in hexa
-sub_index             *must* be writen 2 numbers in hexa
-size_variable_in_UNS8 *must* be writen 2 numbers in hexa
-*/
-#define PDO_MAP(index, sub_index, size_variable_in_bits)\
-0x ## index ## sub_index ## size_variable_in_bits
-
-//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
-//
-//                       OBJECT DICTIONARY
-//                   
-//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
-// Make your change, depending of your application
- 
-
-/* index 0x1000 :   Device type. 
-                    You have to change the value below, so
-                    it fits your canopen-slave-module */
- 
-                    /* Not used, so, should not be modified */
-                    
-                    UNS32 obj1000 = 0;
-                    subindex Index1000[] =
-                    {
-                      { RO, uint32, sizeof(UNS32), (void*)&obj1000 }
-                    };
-
-/* index 0x1001 :   Error register. 
-                    Change the entries to fit your application 
-                    Not used, so, should not be modified */
-                    /*const*/ UNS8 obj1001 = 0x0;
-                    /*const*/ subindex Index1001[] =
-                    {
-                      { RO, uint8, sizeof(UNS8), (void*)&obj1001 }
-                    };
-
-/* index 0x1005 :   COB_ID SYNC */
-                    /* Should not be modified */
-                    UNS32 obj1005 = 0x00000080; // bit 30 = 1 : device can generate a SYNC message
-                                                // Beware, it is over written when the node 
-                                                // enters in reset mode
-                                                // See initResetMode() in init.c
-                    /*const*/ subindex Index1005[] =
-                    {
-                      { RW, uint32, sizeof(UNS32), (void*)&obj1005 }
-                    };
-
-/* index 0x1006 :   SYNC period */
-                    // For producing the SYNC signal every n micro-seconds.
-                    // Put O to not producing SYNC
-                    /*const*/ UNS32 obj1006 = 0x0; 
-                                         // Default 0 to not produce SYNC //
-                                         // Beware, it is over written when the 
-                                         // node enters in reset mode.
-                                         // See initResetMode() in init.c
-                    /*const*/ subindex Index1006[] =
-                    {
-                      { RW, uint32, sizeof(UNS32), (void*)&obj1006 }
-                    };
- 
-/* index 0x1007 :   Synchronous Window Length
-                    Seems to be needed by DS401 to generate the SYNC signal ! */
-                    /*const*/ UNS32 obj1007 = 0x0; /* Default 0 */
-                    /*const*/ subindex Index1007[] =
-                    {
-                      { RW, uint32, sizeof(UNS32), (void*)&obj1007 }
-                    };
-
-/* index 0x1008 :   Manufacturer device name */
-                    UNS8 obj1008[] = "Appli_Slave_HC12"; /* Default 0 */
-                    subindex Index1008[] =
-                    {
-                      { RO, uint32, sizeof(obj1008), (void*)&obj1008 }
-                    };
-
-/* index 0x1009 :   Manufacturer hardware version */
-                    UNS8 obj1009[] = __DATE__; /* Default 0 */
-                    subindex Index1009[] =
-                    {
-                      { RO, uint32, sizeof(obj1009), (void*)&obj1009 }
-                    };
-
-/* index 0x100A :   Manufacturer software version */
-                    UNS8 obj100A[] = __TIME__; /* Default 0 */
-                    subindex Index100A[] =
-                    {
-                      { RO, uint32, sizeof(obj100A), (void*)&obj100A}
-                    };
-
-/* index 0x1016 :   HeartBeat consumers 
-                    The nodes which can send a heartbeat */ 
-                    static  UNS32 obj1016[] = {// Consumer time for each node 
-                    0x00000000}; // Format 0x00NNTTTT (N=Node T=time in ms)
-
-                    static  UNS8 obj1016_cnt = 1; // 1 nodes could send me
-                                                  // their heartbeat.
-                    subindex Index1016[] = 
-                    {
-                      { RO, uint8, sizeof(UNS8), (void*)&obj1016_cnt },
-                      { RW, uint32, sizeof(UNS32), (void*)&obj1016[0] }
-                    }; 
-
-/* index 0x1017 :   Heartbeat producer                    
-                    Every HBProducerTime, the node sends its heartbeat */
-                    static UNS16 obj1017 = 0; //HBProducerTime in ms. If 0 : not activated 
-                                                     // Beware, it is over written when the 
-                                                     // node enters in reset mode.
-                                                     // See initResetMode() in init.c
-                    subindex Index1017[] =
-                    {
-	              { RW, uint16, sizeof(UNS16), &obj1017 }
-                    };
-
-/* index 0x1018 :   Identity object */
-                    /** index 1018: identify object. Adjust the entries for your node/company
-                    */
-                    /* Values can be modified */
-
-                    s_identity obj1018 =
-                    {
-                      4,       // number of supported entries
-                      0,  // Vendor-ID (given by the can-cia)
-                      0,  // Product Code
-                      0,  // Revision number
-                      0  // serial number
-                    };
-
-                    subindex Index1018[] =
-                    {
-                      { RO, uint8,  sizeof(UNS8),  (void*)&obj1018.count },
-                      { RO, uint32, sizeof(UNS32), (void*)&obj1018.vendor_id},
-                      { RO, uint32, sizeof(UNS32), (void*)&obj1018.product_code},
-                      { RO, uint32, sizeof(UNS32), (void*)&obj1018.revision_number},
-                      { RO, uint32, sizeof(UNS32), (void*)&obj1018.serial_number}
-                    };
-
-/* index 0x1200 :   The SDO Server parameters */
-                    /* BEWARE You cannot define more than one SDO server */
-                    /* The values should not be modified here, 
-                    but can be changed at runtime */
-                    // Beware that the default values that you could put here
-                    // will be over written at the initialisation of the node. 
-                    // See setNodeId() in init.c
-                    static s_sdo_parameter obj1200  = 
-                      { 3,                   // Number of entries. Always 3 for the SDO	       
-                        0x600 + NODE_ID,     // The cob_id transmited in CAN msg to the server     
-                        0x580 + NODE_ID,     // The cob_id received in CAN msg from the server  
-                        NODE_ID              // The node id of the client. Should not be modified 
-                      };
-                    static subindex Index1200[] =
-                    {
-                      { RO, uint8,  sizeof( UNS8 ), (void*)&obj1200.count },
-                      { RO, uint32, sizeof( UNS32), (void*)&obj1200.cob_id_client },
-                      { RO, uint32, sizeof( UNS32), (void*)&obj1200.cob_id_server },
-                      { RW, uint8,  sizeof( UNS8),  (void*)&obj1200.node_id }
-                    };
-
-/* index 0x1280 :   SDO client parameter */
-                    static s_sdo_parameter obj1280 = 
-                      { 3,     // Nb of entries 
-                        0x600, // cobid transmited to the server. The good value should be 0x600 + server nodeId
-                        0x580, // cobid received from the server. The good value should be 0x580 + server nodeId
-                        0x0    // server NodeId
-                      };
-                    static subindex Index1280[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1280.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1280.cob_id_client },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1280.cob_id_server },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1280.node_id }
-                      }; 
-
-/* index 0x1400 :   PDO receive communication parameter */
-                    static s_pdo_communication_parameter obj1400 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1400[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1400.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1400.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1400.type },
-                      }; 
-
-/* index 0x1401 :   PDO receive communication parameter */
-                    static s_pdo_communication_parameter obj1401 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1401[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1401.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1401.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1401.type },
-                      }; 
-
-/* index 0x1402 :   PDO receive communication parameter */
-                    static s_pdo_communication_parameter obj1402 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1402[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1402.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1402.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1402.type },
-                      }; 
-
-/* index 0x1600 :   PDO receive mapping parameter of PDO communication index 0x1400 */
-                    static UNS8 obj1600_cnt = 0; // Number of mapped variables
-                    static UNS32 obj1600_mappedVar[] = { 
-                        // Example to map a variable of 16 bits defined at index 0x6035, subindex 0x12 :
-                        // PDO_MAP(6035,12,16)
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00)
-                      };
-                    subindex Index1600[] = 
-                      { 
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1600_cnt },
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[0]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[1]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[2]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[3]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[4]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[5]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[6]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1600_mappedVar[7]}
-                      }; 
-
-/* index 0x1601 :   PDO receive mapping parameter of PDO communication index 0x1401 */
-                    static UNS8 obj1601_cnt = 0; // Number of mapped variables
-                    static UNS32 obj1601_mappedVar[] = { 
-                        // Example to map a variable of 16 bits defined at index 0x6035, subindex 0x12 :
-                        // PDO_MAP(6035,12,16)
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00)
-                      };
-                    subindex Index1601[] = 
-                      { 
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1601_cnt },
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[0]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[1]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[2]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[3]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[4]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[5]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[6]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1601_mappedVar[7]}
-                      }; 
-
-/* index 0x1602 :   PDO receive mapping parameter of PDO communication index 0x1402 */
-                    static UNS8 obj1602_cnt = 0; // Number of mapped variables
-                    static UNS32 obj1602_mappedVar[] = { 
-                        // Example to map a variable of 16 bits defined at index 0x6035, subindex 0x12 :
-                        // PDO_MAP(6035,12,16)
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00)
-                      };
-                    subindex Index1602[] = 
-                      { 
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1602_cnt },
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[0]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[1]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[2]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[3]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[4]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[5]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[6]},
-                        { RW, uint32, sizeof( UNS32 ), (void*)&obj1602_mappedVar[7]}
-                      }; 
-
-/* index 0x1800 :   PDO transmit communication parameter */
-                    static s_pdo_communication_parameter obj1800 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1800[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1800.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1800.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1800.type },
-                      }; 
-
-/* index 0x1801 :   PDO transmit communication parameter */
-                    static s_pdo_communication_parameter obj1801 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1801[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1801.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1801.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1801.type },
-                      }; 
-
-/* index 0x1802 :   PDO transmit communication parameter */
-                    static s_pdo_communication_parameter obj1802 = 
-                      { 2, // Largest subindex supported 
-                        0x0, // Default COBID (overwritten at init for index 0x1400 to 0x1403)
-                        253 // Transmission type. See objdictdef.h 
-                      };
-                    static subindex Index1802[] = 
-                      { 
-                        { RO, uint8, sizeof( UNS8  ), (void*)&obj1802.count },
-                        { RW, uint8, sizeof( UNS32 ), (void*)&obj1802.cob_id },
-                        { RW, uint8, sizeof( UNS8  ), (void*)&obj1802.type },
-                      }; 
-
-/* index 0x1A00 :   PDO transmit mapping parameter of PDO communication index 0x1800 */
-                    static UNS8 obj1A00_cnt = 0; // Number of mapped variables
-                    static UNS32 obj1A00_mappedVar[] = { 
-                        // Example to map a variable of 16 bits defined at index 0x6035, subindex 0x12 :
-                        // PDO_MAP(6035,12,16)
-                        PDO_MAP(0000, 00, 00),
-                        PDO_MAP(0000, 00, 00),