From 7870c8c46ad389a3a94017af7e9cfe82d1feedb2 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Tue, 28 Apr 2015 23:48:26 +0200 Subject: [PATCH] Compile with Makefile instead of CSS Also remove target specific compies. The differences are not so big to deserve that. We will probably use another approach to merge tms570_rpp target. --- .gitignore | 3 +- rpp-lib | 2 +- .../org.eclipse.cdt.codan.core.prefs | 3 - .../org.eclipse.cdt.debug.core.prefs | 2 - .../org.eclipse.core.resources.prefs | 107 ----- rpp-test-sw/Debug/.gitignore | 3 + rpp-test-sw/Debug/Makefile | 3 + rpp-test-sw/Makefile.inc | 51 ++ rpp-test-sw/Release/.gitignore | 3 + rpp-test-sw/Release/Makefile | 3 + rpp-test-sw/ccs_rm48_hdk/.ccsproject | 13 - rpp-test-sw/ccs_rm48_hdk/.cproject | 440 ------------------ rpp-test-sw/ccs_rm48_hdk/.project | 84 ---- rpp-test-sw/ccs_tms570_hdk/.ccsproject | 13 - rpp-test-sw/ccs_tms570_hdk/.cproject | 393 ---------------- rpp-test-sw/ccs_tms570_hdk/.project | 84 ---- rpp-test-sw/commands/_rm48_hdk/cmd_pin.c | 282 ----------- rpp-test-sw/commands/_rm48_hdk/cmd_port.c | 215 --------- rpp-test-sw/commands/_rm48_hdk/main.c | 78 ---- rpp-test-sw/commands/_tms570_hdk/cmd.c | 102 ---- rpp-test-sw/commands/_tms570_hdk/cmd_adc.c | 195 -------- rpp-test-sw/commands/{_rm48_hdk => }/cmd.c | 12 +- .../commands/{_rm48_hdk => }/cmd_adc.c | 4 +- .../commands/{_tms570_hdk => }/cmd_pin.c | 4 +- .../commands/{_tms570_hdk => }/cmd_port.c | 4 +- rpp-test-sw/commands/{_tms570_hdk => }/main.c | 12 +- 26 files changed, 87 insertions(+), 2028 deletions(-) delete mode 100644 rpp-test-sw/.settings/org.eclipse.cdt.codan.core.prefs delete mode 100644 rpp-test-sw/.settings/org.eclipse.cdt.debug.core.prefs delete mode 100644 rpp-test-sw/.settings/org.eclipse.core.resources.prefs create mode 100644 rpp-test-sw/Debug/.gitignore create mode 100644 rpp-test-sw/Debug/Makefile create mode 100644 rpp-test-sw/Makefile.inc create mode 100644 rpp-test-sw/Release/.gitignore create mode 100644 rpp-test-sw/Release/Makefile delete mode 100644 rpp-test-sw/ccs_rm48_hdk/.ccsproject delete mode 100644 rpp-test-sw/ccs_rm48_hdk/.cproject delete mode 100644 rpp-test-sw/ccs_rm48_hdk/.project delete mode 100644 rpp-test-sw/ccs_tms570_hdk/.ccsproject delete mode 100644 rpp-test-sw/ccs_tms570_hdk/.cproject delete mode 100644 rpp-test-sw/ccs_tms570_hdk/.project delete mode 100644 rpp-test-sw/commands/_rm48_hdk/cmd_pin.c delete mode 100644 rpp-test-sw/commands/_rm48_hdk/cmd_port.c delete mode 100644 rpp-test-sw/commands/_rm48_hdk/main.c delete mode 100644 rpp-test-sw/commands/_tms570_hdk/cmd.c delete mode 100644 rpp-test-sw/commands/_tms570_hdk/cmd_adc.c rename rpp-test-sw/commands/{_rm48_hdk => }/cmd.c (92%) rename rpp-test-sw/commands/{_rm48_hdk => }/cmd_adc.c (98%) rename rpp-test-sw/commands/{_tms570_hdk => }/cmd_pin.c (98%) rename rpp-test-sw/commands/{_tms570_hdk => }/cmd_port.c (98%) rename rpp-test-sw/commands/{_tms570_hdk => }/main.c (75%) diff --git a/.gitignore b/.gitignore index c189d0f..9f6bb5b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -Debug/ .metadata/ +.settings/ +*~ /rpp-test-sw-[0-9]*/ /rpp-test-sw-[0-9]*.zip diff --git a/rpp-lib b/rpp-lib index ddf40e3..c893e21 160000 --- a/rpp-lib +++ b/rpp-lib @@ -1 +1 @@ -Subproject commit ddf40e3def4e2476461cd8d07d5b14d9d1f5a98f +Subproject commit c893e2132333cda81e03b6227904a691857e3659 diff --git a/rpp-test-sw/.settings/org.eclipse.cdt.codan.core.prefs b/rpp-test-sw/.settings/org.eclipse.cdt.codan.core.prefs deleted file mode 100644 index f653028..0000000 --- a/rpp-test-sw/.settings/org.eclipse.cdt.codan.core.prefs +++ /dev/null @@ -1,3 +0,0 @@ -eclipse.preferences.version=1 -inEditor=false -onBuild=false diff --git a/rpp-test-sw/.settings/org.eclipse.cdt.debug.core.prefs b/rpp-test-sw/.settings/org.eclipse.cdt.debug.core.prefs deleted file mode 100644 index 2adc7b1..0000000 --- a/rpp-test-sw/.settings/org.eclipse.cdt.debug.core.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker diff --git a/rpp-test-sw/.settings/org.eclipse.core.resources.prefs b/rpp-test-sw/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 7bed4f3..0000000 --- a/rpp-test-sw/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,107 +0,0 @@ -eclipse.preferences.version=1 -encoding//Debug/cmdproc/src/subdir_rules.mk=UTF-8 -encoding//Debug/cmdproc/src/subdir_vars.mk=UTF-8 -encoding//Debug/commands/doc/subdir_rules.mk=UTF-8 -encoding//Debug/commands/doc/subdir_vars.mk=UTF-8 -encoding//Debug/commands/subdir_rules.mk=UTF-8 -encoding//Debug/commands/subdir_vars.mk=UTF-8 -encoding//Debug/makefile=UTF-8 -encoding//Debug/objects.mk=UTF-8 -encoding//Debug/rpp-lib/Debug/os/7.0.2_tms570/src/os/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/Debug/os/7.0.2_tms570/src/os/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/Debug/rpp/src/sys/asm/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/Debug/rpp/src/sys/asm/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/Debug/rpp/src/sys/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/Debug/rpp/src/sys/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/Debug/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/Debug/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/apps/base/src/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/apps/base/src/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/apps/rpp-test-suite/src/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/apps/rpp-test-suite/src/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/src/api/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/src/api/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/src/arch/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/src/arch/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/src/core/ipv4/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/src/core/ipv4/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/src/core/ipv6/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/src/core/ipv6/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/src/core/snmp/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/src/core/snmp/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/src/core/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/src/core/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/src/netif/ppp/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/src/netif/ppp/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/src/netif/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/src/netif/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/test/unit/core/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/test/unit/core/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/test/unit/dhcp/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/test/unit/dhcp/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/test/unit/etharp/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/test/unit/etharp/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/test/unit/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/test/unit/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/test/unit/tcp/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/test/unit/tcp/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/test/unit/udp/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/lwip/test/unit/udp/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/os/6.0.4_posix/src/os/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/os/6.0.4_posix/src/os/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/os/6.0.4_posix/src/rpp/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/os/6.0.4_posix/src/rpp/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/os/7.0.2_tms570/src/os/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/os/7.0.2_tms570/src/os/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/os/7.4.0_tms570/src/os/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/os/7.4.0_tms570/src/os/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/os/7.4.2_tms570/src/os/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/os/7.4.2_tms570/src/os/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/rpp/src/drv/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/rpp/src/drv/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/rpp/src/hal/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/rpp/src/hal/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/rpp/src/rpp/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/rpp/src/rpp/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/rpp/src/sys/asm/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/rpp/src/sys/asm/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/rpp/src/sys/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/rpp/src/sys/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/rpp/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/rpp/subdir_vars.mk=UTF-8 -encoding//Debug/rpp-lib/subdir_rules.mk=UTF-8 -encoding//Debug/rpp-lib/subdir_vars.mk=UTF-8 -encoding//Debug/rpp/lib/apps/test/src/subdir_rules.mk=UTF-8 -encoding//Debug/rpp/lib/apps/test/src/subdir_vars.mk=UTF-8 -encoding//Debug/rpp/lib/cmdproc/src/subdir_rules.mk=UTF-8 -encoding//Debug/rpp/lib/cmdproc/src/subdir_vars.mk=UTF-8 -encoding//Debug/rpp/lib/os/7.0.2_tms570/src/os/subdir_rules.mk=UTF-8 -encoding//Debug/rpp/lib/os/7.0.2_tms570/src/os/subdir_vars.mk=UTF-8 -encoding//Debug/rpp/lib/rpp/src/drv/subdir_rules.mk=UTF-8 -encoding//Debug/rpp/lib/rpp/src/drv/subdir_vars.mk=UTF-8 -encoding//Debug/rpp/lib/rpp/src/hal/subdir_rules.mk=UTF-8 -encoding//Debug/rpp/lib/rpp/src/hal/subdir_vars.mk=UTF-8 -encoding//Debug/rpp/lib/rpp/src/rpp/subdir_rules.mk=UTF-8 -encoding//Debug/rpp/lib/rpp/src/rpp/subdir_vars.mk=UTF-8 -encoding//Debug/rpp/lib/rpp/src/subdir_rules.mk=UTF-8 -encoding//Debug/rpp/lib/rpp/src/subdir_vars.mk=UTF-8 -encoding//Debug/rpp/lib/rpp/src/sys/asm/subdir_rules.mk=UTF-8 -encoding//Debug/rpp/lib/rpp/src/sys/asm/subdir_vars.mk=UTF-8 -encoding//Debug/rpp/lib/rpp/src/sys/subdir_rules.mk=UTF-8 -encoding//Debug/rpp/lib/rpp/src/sys/subdir_vars.mk=UTF-8 -encoding//Debug/rpp/lib/rpp/subdir_rules.mk=UTF-8 -encoding//Debug/rpp/lib/rpp/subdir_vars.mk=UTF-8 -encoding//Debug/source/subdir_rules.mk=UTF-8 -encoding//Debug/source/subdir_vars.mk=UTF-8 -encoding//Debug/sources.mk=UTF-8 -encoding//Debug/subdir_rules.mk=UTF-8 -encoding//Debug/subdir_vars.mk=UTF-8 -encoding//SDRAM/cmdproc/src/subdir_rules.mk=UTF-8 -encoding//SDRAM/cmdproc/src/subdir_vars.mk=UTF-8 -encoding//SDRAM/commands/doc/subdir_rules.mk=UTF-8 -encoding//SDRAM/commands/doc/subdir_vars.mk=UTF-8 -encoding//SDRAM/commands/subdir_rules.mk=UTF-8 -encoding//SDRAM/commands/subdir_vars.mk=UTF-8 -encoding//SDRAM/makefile=UTF-8 -encoding//SDRAM/objects.mk=UTF-8 -encoding//SDRAM/sources.mk=UTF-8 diff --git a/rpp-test-sw/Debug/.gitignore b/rpp-test-sw/Debug/.gitignore new file mode 100644 index 0000000..097fcde --- /dev/null +++ b/rpp-test-sw/Debug/.gitignore @@ -0,0 +1,3 @@ +* +!Makefile +!.gitignore diff --git a/rpp-test-sw/Debug/Makefile b/rpp-test-sw/Debug/Makefile new file mode 100644 index 0000000..4ebe535 --- /dev/null +++ b/rpp-test-sw/Debug/Makefile @@ -0,0 +1,3 @@ +include ../Makefile.inc + +RPP_CFLAGS += -g -O0 diff --git a/rpp-test-sw/Makefile.inc b/rpp-test-sw/Makefile.inc new file mode 100644 index 0000000..796d36c --- /dev/null +++ b/rpp-test-sw/Makefile.inc @@ -0,0 +1,51 @@ +makefile_inc_dir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) + +all: rpp-test-sw + +# Use the configuration "exported" by library build +CONFIG = $(makefile_inc_dir)/../rpp-lib/Makefile.config +ifneq ($(wildcard $(CONFIG)),) +include $(CONFIG) +else +$(error "rpp-lib not compiled! Run `make -C $(makefile_inc_dir)/../rpp-lib/build//Release`") +endif + +include $(makefile_inc_dir)/../rpp-lib/build/Makefile.rules + +SOURCES = \ + cmdproc/src/cmdproc.c \ + cmdproc/src/cmdproc_freertos.c \ + cmdproc/src/cmdproc_io.c \ + cmdproc/src/cmdproc_io_line.c \ + cmdproc/src/cmdproc_io_std_line.c \ + cmdproc/src/cmdproc_io_tisci.c \ + cmdproc/src/cmdproc_run.c \ + cmdproc/src/cmdproc_utils.c \ + cmdproc/src/i2str.c \ + commands/cmd.c \ + commands/cmd_adc.c \ + commands/cmd_can.c \ + commands/cmd_pin.c \ + commands/cmd_port.c \ + commands/main.c + +OBJS = $(SOURCES:%.c=%.obj) + +RPP_CFLAGS += -I$(makefile_inc_dir)/cmdproc/include -I$(makefile_inc_dir) +RPP_CFLAGS += -I. # For version.h + +rpp-test-sw: $(OBJS) $(RPP_LIB_DIR)/rpp-lib.lib + $(LD) $(RPP_CFLAGS) $(RPP_LDFLAGS) $(OBJS) $(RPP_LDLIBS) -o $@ + +$(makefile_inc_dir)/commands/main.c: version.h +$(makefile_inc_dir)/commands/cmd.c: version.h +include $(makefile_inc_dir)/Makefile.version + +$(OBJS): %.obj: $(makefile_inc_dir)/%.c + $(call mkdir,$(dir $@)) + $(RPP_COMPILE_CMD) + +clean:: + $(call rm,rpp-test-sw) + +-include $(OBJS:%=%.dep) diff --git a/rpp-test-sw/Release/.gitignore b/rpp-test-sw/Release/.gitignore new file mode 100644 index 0000000..097fcde --- /dev/null +++ b/rpp-test-sw/Release/.gitignore @@ -0,0 +1,3 @@ +* +!Makefile +!.gitignore diff --git a/rpp-test-sw/Release/Makefile b/rpp-test-sw/Release/Makefile new file mode 100644 index 0000000..7d72dfd --- /dev/null +++ b/rpp-test-sw/Release/Makefile @@ -0,0 +1,3 @@ +include ../Makefile.inc + +RPP_CFLAGS += -O2 diff --git a/rpp-test-sw/ccs_rm48_hdk/.ccsproject b/rpp-test-sw/ccs_rm48_hdk/.ccsproject deleted file mode 100644 index 9ea78b7..0000000 --- a/rpp-test-sw/ccs_rm48_hdk/.ccsproject +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/rpp-test-sw/ccs_rm48_hdk/.cproject b/rpp-test-sw/ccs_rm48_hdk/.cproject deleted file mode 100644 index 6714352..0000000 --- a/rpp-test-sw/ccs_rm48_hdk/.cproject +++ /dev/null @@ -1,440 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/rpp-test-sw/ccs_rm48_hdk/.project b/rpp-test-sw/ccs_rm48_hdk/.project deleted file mode 100644 index 185571f..0000000 --- a/rpp-test-sw/ccs_rm48_hdk/.project +++ /dev/null @@ -1,84 +0,0 @@ - - - rpp-test-sw - - - rpp-lib - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - -k - - - org.eclipse.cdt.make.core.buildCommand - ${CCS_UTILS_DIR}/bin/gmake - - - org.eclipse.cdt.make.core.buildLocation - ${BuildDirectory} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - true - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - false - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - com.ti.ccstudio.core.ccsNature - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/rpp-test-sw/ccs_tms570_hdk/.ccsproject b/rpp-test-sw/ccs_tms570_hdk/.ccsproject deleted file mode 100644 index 914ee05..0000000 --- a/rpp-test-sw/ccs_tms570_hdk/.ccsproject +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/rpp-test-sw/ccs_tms570_hdk/.cproject b/rpp-test-sw/ccs_tms570_hdk/.cproject deleted file mode 100644 index 1016d26..0000000 --- a/rpp-test-sw/ccs_tms570_hdk/.cproject +++ /dev/null @@ -1,393 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/rpp-test-sw/ccs_tms570_hdk/.project b/rpp-test-sw/ccs_tms570_hdk/.project deleted file mode 100644 index 185571f..0000000 --- a/rpp-test-sw/ccs_tms570_hdk/.project +++ /dev/null @@ -1,84 +0,0 @@ - - - rpp-test-sw - - - rpp-lib - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - -k - - - org.eclipse.cdt.make.core.buildCommand - ${CCS_UTILS_DIR}/bin/gmake - - - org.eclipse.cdt.make.core.buildLocation - ${BuildDirectory} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - true - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - false - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - com.ti.ccstudio.core.ccsNature - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/rpp-test-sw/commands/_rm48_hdk/cmd_pin.c b/rpp-test-sw/commands/_rm48_hdk/cmd_pin.c deleted file mode 100644 index cb73203..0000000 --- a/rpp-test-sw/commands/_rm48_hdk/cmd_pin.c +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright (C) 2012-2013 Czech Technical University in Prague - * - * Created on: 28.2.2013 - * - * Authors: - * - Michal Horn - * - * This document contains proprietary information belonging to Czech - * Technical University in Prague. Passing on and copying of this - * document, and communication of its contents is not permitted - * without prior written authorization. - * - * File : cmd_pin.c - * - * Abstract: - * Commands for pin controlling - * - Printing list of available pins - * - Setting and getting value to pins - * - Setting and getting pins direction - */ - -#include "../cmd_pin.h" -#include "stdio.h" -#include "string.h" - -#ifndef DOCGEN - -#include "rpp/rpp.h" -#include "hal/hal.h" -#include "cmdproc_utils.h" - -/** - * @brief Print list of pins - * - * @param[in] cmd_io Pointer to IO stack - * @param[in] des Pointer to command descriptor - * @param[in] param Parameters of command - * @return 0 when OK or error code - */ -int cmd_do_pin_list(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) -{ - uint32_t i; - - rpp_sci_printf("List of all defined pins. Those names can be used by pinval command.\r\n"); - for (i = 0; i < MAX_PIN_CNT; i++) { - if (pin_map[i].pin_name == PIN_NAME_UNUSED) continue; - rpp_sci_printf(pin_map[i].pin_name); - rpp_sci_printf("\r\n"); - } - return 1; -} - -/** - * @brief Set or get pin value - * - * @param[in] cmd_io Pointer to IO stack - * @param[in] des Pointer to command descriptor - * @param[in] param Parameters of command - * @return 0 when OK or error code - */ -int cmd_do_pin_val(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) -{ - char *p; - long val; - uint32_t *desc; - char spareParams; - char pinName[32]; - - p = param[1]; - if (sscanf(p, "%31s ", pinName) != 1) - return -CMDERR_BADPAR; - - if ((desc = hal_gpio_pin_get_dsc(pinName, -1)) == NULL) return -CMDERR_BADREG; - - if (param[2] != NULL) { // More parameters = set values - p = param[2]; - if (sscanf(p, "%d %1s", &val, &spareParams) != 1) - return -CMDERR_BADPAR; - if (val != 0 && val != 1) - return -CMDERR_BADPAR; - hal_gpio_pin_set_value(*desc, (uint32_t)val); - return cmd_opchar_replong(cmd_io, param, val, 0, 0); - ; - } - else { // No more parameters = get values - uint32_t pin_value = hal_gpio_pin_get_value(*desc); - rpp_sci_printf("pinval%s=%d\n", pinName, pin_value); - return 0; - } -} - -/** - * @brief Set or get pin direction - * - * @param[in] cmd_io Pointer to IO stack - * @param[in] des Pointer to command descriptor - * @param[in] param Parameters of command - * @return 0 when OK or error code - */ -int cmd_do_pin_dir(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) -{ - char *p; - long val; - uint32_t *desc; - char spareParams; - char pinName[32]; - - p = param[1]; - if (sscanf(p, "%31s ", pinName) != 1) - return -CMDERR_BADPAR; - - if ((desc = hal_gpio_pin_get_dsc(pinName, -1)) == NULL) return -CMDERR_BADREG; - - if (param[2] != NULL) { // More parameters = set values - p = param[2]; - if (sscanf(p, "%d %1s", &val, &spareParams) != 1) - return -CMDERR_BADPAR; - if (val == 1) { - *desc |= PORT_CONF_SET_DIR; - *desc |= PORT_CONF_DIR_OUT; - } - else if (val == 0) { - *desc &= (~PORT_CONF_DIR_OUT); - *desc |= PORT_CONF_SET_DIR; - } - else - return -CMDERR_BADPAR; - - hal_gpio_pin_conf(*desc); - return cmd_opchar_replong(cmd_io, param, val, 0, 0); - } - else { // No more parameters = get values - uint32_t pin_dir = hal_gpio_pin_get_direction(*desc); - rpp_sci_printf("pindir%s=%d\n", pinName, pin_dir); - return 0; - } -} - -#endif /* DOCGEN */ - -/** Command descriptor for pin list */ -cmd_des_t const cmd_des_pin_list = { - 0, 0, - "pinlist","Print a list of all defined pins.", - "### Command syntax ###\n" - "\n" - " pinlist\n" - "\n" - "### Description ###\n" - "\n" - "The command prints a list of all defined pins accessible by pinval and\n" - "pindir commands.\n" - "\n" - "### Example ###\n" - "\n" - " --> pinlist\n" - " List of all defined pins. Those names can be used by pinval command.\n" - " GIOA0\n" - " GIOA1\n" - " GIOA2\n" - " GIOA3\n" - " GIOA4\n" - " GIOA5\n" - " GIOA6\n" - " GIOA7\n" - " GIOB0\n" - " GIOB1\n" - " GIOB2\n" - " GIOB3\n" - " GIOB4\n" - " GIOB5\n" - " GIOB6\n" - " GIOB7\n" - " NHET10\n" - " NHET11\n" - " NHET12\n" - " NHET13\n" - " NHET14\n" - " NHET15\n" - " NHET16\n" - " NHET17\n" - " NHET18\n" - " NHET19\n" - " NHET110\n" - " NHET111\n" - " NHET112\n" - " NHET113\n" - " NHET114\n" - " NHET115\n" - " NHET116\n" - " NHET117\n" - " NHET118\n" - " NHET119\n" - " NHET120\n" - " NHET121\n" - " NHET122\n" - " NHET123\n" - " NHET124\n" - " NHET125\n" - " NHET126\n" - " NHET127\n" - " NHET128\n" - " NHET129\n" - " NHET130\n" - " NHET131\n", - CMD_HANDLER(cmd_do_pin_list), (void *)&cmd_list_pin -}; - -/** Command descriptor for pin get/set value */ -cmd_des_t const cmd_des_pin_val = { - 0, 0, - "pinval*","Set or get the pin value", - "### Command syntax ###\n" - "\n" - " pinval \n" - " pinval\n" - "where\n" - "\n" - "- `` is a string identifying the pin\n" - "- `` can be 0 or 1\n" - "\n" - "### Description ###\n" - "\n" - "This command is sets or gets a value of the particular pin.\n" - "\n" - "The list of valid pin names can be obtained with pinlist command.\n" - "\n" - "### Example ###\n" - "\n" - " --> pinvalGIOB0 1\n" - " pinvalGIOB0=1\n" - "\n" - "Sets the GIOB0 pin to 1.\n" - "\n" - " --> pinvalGIOB0\n" - " pinvalGIOB0=1\n" - "\n" - "Gets a value of the GIOB0 pin.\n", - CMD_HANDLER(cmd_do_pin_val), (void *)&cmd_list_pin -}; - -/** Command descriptor for pin get/set direction */ -cmd_des_t const cmd_des_pin_dir = { - 0, 0, - "pindir*","Set the pin direction", - "### Command syntax ###\n" - "\n" - " pindir \n" - " pindir\n" - "where\n" - "\n" - "- `` is a string identifying the pin\n" - "- DIR is be either 0 (input) or 1 (output)\n" - "\n" - "### Description ###\n" - "\n" - "This command is used to set or get direction of the particular pin.\n" - "\n" - "The list of valid pin names can be obtained with pinlist command.\n" - "\n" - "### Example ###\n" - "\n" - " --> pindirGIOB0 1\n" - " pindirGIOB0=1\n" - "\n" - "Sets the GIOB0 pin as output.\n" - "\n" - " --> pindirGIOB0\n" - " pindirGIOB0=1\n" - "\n" - "Gets the direction of the GIOB0 pin.\n", - CMD_HANDLER(cmd_do_pin_dir), (void *)&cmd_list_pin -}; - -/** List of commands for pin, defined as external */ -cmd_des_t const *cmd_list_pin[] = { - &cmd_des_pin_list, - &cmd_des_pin_val, - &cmd_des_pin_dir, - NULL -}; diff --git a/rpp-test-sw/commands/_rm48_hdk/cmd_port.c b/rpp-test-sw/commands/_rm48_hdk/cmd_port.c deleted file mode 100644 index 06f6ab0..0000000 --- a/rpp-test-sw/commands/_rm48_hdk/cmd_port.c +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright (C) 2012-2013 Czech Technical University in Prague - * - * Created on: 28.2.2013 - * - * Authors: - * - Michal Horn - * - * This document contains proprietary information belonging to Czech - * Technical University in Prague. Passing on and copying of this - * document, and communication of its contents is not permitted - * without prior written authorization. - * - * File : cmd_port.c - * - * Abstract: - * Commands for port controlling - * - Printing list of available ports (not yet available) - * - Setting/getting port value* - */ - -#include "../cmd_port.h" -#include "stdio.h" - -#ifndef DOCGEN - -#include "rpp/rpp.h" -#include "hal/hal.h" -#include "cmdproc_utils.h" - - -int cmd_do_port_list(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) -{ - uint32_t i; - char *portInterface; - - rpp_sci_printf("List of all defined ports with its type. Those names can be used by portval command.\r\n"); - const port_def_t *ports = hal_port_get_definitions(); - - for (i = 0; i < PORT_CNT; i++) { - if (ports[i].name == PIN_NAME_UNUSED) continue; - if (ports[i].desc->interfaceType == PORT_INTERFACE_SPI) - portInterface = "SPI"; - else if (ports[i].desc->interfaceType == PORT_INTERFACE_GPIO) - portInterface = "GPIO"; - else if (ports[i].desc->interfaceType == PORT_INTERFACE_ADC) - portInterface = "ADC"; - else - portInterface = "UNKNOWN"; - rpp_sci_printf("%s, %s\r\n", ports[i].name, portInterface); - } - return 1; -} - - - -/** - * @brief Read values from specified port - * - * @param[in] cmd_io Pointer to IO stack - * @param[in] des Pointer to command descriptor - * @param[in] param Parameters of command - * @return 0 when OK or error code - */ -int cmd_do_port_val(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) -{ - char *p; - int i; - port_desc_t *desc; - uint32_t ret; - uint32_t values[MAX_PARAM_VALUES_NUM]; - char portName[32]; - char *token; - uint32_t numParams; - - p = param[1]; - if (sscanf(p, "%31s ", portName) != 1) - return -CMDERR_BADPAR; - - if ((desc = hal_port_get_dsc(portName, -1)) == NULL) return -CMDERR_BADREG; - - if (param[2] != NULL) { // More parameters = set values - p = param[2]; - if (desc->port_setfnc_ptr == NULL) - return -CMDERR_WRPERM; - else { - if (desc->interfaceType == PORT_INTERFACE_GPIO) - // Information about pin values are encoded as hexadecimal 8b value - numParams = desc->numValues/8+1; - else if (desc->interfaceType == PORT_INTERFACE_SPI) - // Commands are passed as bytes - numParams = desc->numValues; - else if (desc->interfaceType == PORT_INTERFACE_ADC) - return -CMDERR_BADPAR; // ADC is read only and no other port is supported - token = strtok(p, " "); - i = 0; - while (i < numParams && token != NULL) { - if (sscanf(token, "%x", &values[i]) == EOF) - break; - token = strtok(NULL, " "); - i++; - } - - if (i != numParams || token != NULL) - return -CMDERR_BADPAR; - ret = desc->port_setfnc_ptr(desc->config, desc->numValues, values); - } - return cmd_opchar_replong(cmd_io, param, ret, 0, 16); - } - else { - if (desc->port_getfnc_ptr == NULL) - return -CMDERR_RDPERM; - else { - ret = desc->port_getfnc_ptr(desc->config, desc->numValues, values); - for (i = 0; i < desc->numValues; i++) { - rpp_sci_printf("%d\r\n", values[i]); - } - } - rpp_sci_printf("portval%s=%x\n", portName, ret); - return 0; - } -} - -#endif /* DOCGEN */ - -/** Command descriptor for read values from port command */ -cmd_des_t const cmd_des_port_val = { - 0, 0, - "portval*","Read or write values from or to the port", - "### Command syntax ###\n" - "\n" - " portval \n" - " portval\n" - "where\n" - "\n" - "- `` is a string specifying the name of the port\n" - "- `` is a sequence of hexadecimal numbers, separated by spaces, e.g. 12 AA CD\n\n" - "\n" - "### Description ###\n" - "\n" - "This command sets or gets values of all pins on the specified port.\n" - "If the port is connected to the GPIO interface of the MCU, then\n" - "when writing the value, the lowest significant bit of the argument\n" - "is assigned to the first pin, the second bit is assigned to the\n" - "second pin, etc. The command returns zero.\n" - "When reading from the port, the command returns values for each pin.\n" - "\n" - "If the port is connected to the SPI interface of the MCU, then\n" - "it is write only and the argument is interpreted as a command for\n" - "the port controller. The command returns the response from the\n" - "port controller.\n" - "For command examples please refer to the project wiki\n" - "\n" - "If the port is connected to the ADC interface of the MCU, then\n" - "it is read only and returns values for each ADC pin.\n" - "\n" - "Port names and interface type can be obtained with the portlist\n" - "command.\n" - "\n" - "### Example ###\n" - "\n" - " --> portvalGIOB 3A\n" - " portvalGIOB=0\n" - " --> portvalGIOB\n" - " 0\n" - " 1\n" - " 0\n" - " 1\n" - " 1\n" - " 1\n" - "\n" - "This pair of commands sets:\nGIOB" - "GIOB=0\n" - "GIOB=1\n" - "GIOB=0\n" - "GIOB=1\n" - "GIOB=1\n" - "GIOB=1\n" - "Which is shown in getter output\n", - CMD_HANDLER(cmd_do_port_val), (void *)&cmd_list_port -}; - -/** Command descriptor for port list printout */ -cmd_des_t const cmd_des_port_list = { - 0, 0, - "portlist","Print a list of all port names", - "### Command syntax ###\n" - "\n" - " portlist\n" - "\n" - "### Description ###\n" - "\n" - "This command prints the list of all defined ports accessible via the\n" - "portval command. Each record of the list is a couple of\n" - "PortName-PortInterface, where PortInterface is SPI, ADC or GPIO.\n" - "The type of the MCU<->port interface slightly modifies the meaning\n" - "of the portval command." - "\n" - "### Example ###\n" - "\n" - " --> portlist\n" - " List of all defined ports with its type. Those names can be used by portval command.\n" - " GIOA, GPIO\n" - " GIOB, GPIO\n" - " NHET1, GPIO\n" - " ADC, ADC\n", - CMD_HANDLER(cmd_do_port_list), (void *)&cmd_list_port -}; - -/** List of commands for port, defined as external */ -cmd_des_t const *cmd_list_port[] = { - &cmd_des_port_val, - &cmd_des_port_list, - NULL -}; diff --git a/rpp-test-sw/commands/_rm48_hdk/main.c b/rpp-test-sw/commands/_rm48_hdk/main.c deleted file mode 100644 index f02d5ab..0000000 --- a/rpp-test-sw/commands/_rm48_hdk/main.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2012-2014 Czech Technical University in Prague - * - * Created on: 15.3.2012 - * - * Authors: - * - Michal Horn - * - Carlos Jenkins - * - * This document contains proprietary information belonging to Czech - * Technical University in Prague. Passing on and copying of this - * document, and communication of its contents is not permitted - * without prior written authorization. - * - * File : main.c - * - * Abstract: - * This file contains main function and Hook functions used by IDLE task. - * - */ - -/* Include Files */ -#include "rpp/rpp.h" -#include "os/os.h" -#include "cmdproc_freertos.h" -#include "version.h" // Generated by Eclipse in the pre-build step - -/** @fn void main(void) - * @brief Application main function - * - * This function is called after startup. - */ -void main(void) -{ - rpp_adc_init(); - rpp_gio_init(RPP_GIO_PORT_ALL); - rpp_sci_init(); - - // Speed up the SCI - rpp_sci_setup(115200); - - rpp_sci_printf("\nTi HDK RM48L952, FreeRTOS %d.%d.%d\n", FREERTOS_VERSION_NUMBER_MAYOR, FREERTOS_VERSION_NUMBER_MINOR, FREERTOS_VERSION_NUMBER_REV); - rpp_sci_printf("Test Software version " GIT_VERSION "\n"); - rpp_sci_printf("CTU in Prague 10/2014\n"); - - initCmdProc(0); - vTaskStartScheduler(); - - //We should never get here - while (1) - ; -} - -#if configUSE_MALLOC_FAILED_HOOK == 1 -/** - * FreeRTOS malloc() failed hook. - */ -void vApplicationMallocFailedHook(void) -{ - #ifdef DEBUG - rpp_sci_printf("ERROR: manual memory allocation failed.\r\n"); - #endif -} -#endif - - -#if configCHECK_FOR_STACK_OVERFLOW > 0 -/** - * FreeRTOS stack overflow hook. - */ -void vApplicationStackOverflowHook(xTaskHandle xTask, - signed portCHAR *pcTaskName) -{ - #ifdef DEBUG - rpp_sci_printf("ERROR: Stack overflow : \"%s\".\r\n", pcTaskName); - #endif -} -#endif diff --git a/rpp-test-sw/commands/_tms570_hdk/cmd.c b/rpp-test-sw/commands/_tms570_hdk/cmd.c deleted file mode 100644 index 2ef304d..0000000 --- a/rpp-test-sw/commands/_tms570_hdk/cmd.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2012-2013 Czech Technical University in Prague - * - * Created on: 31.7.2012 - * - * Authors: - * - Michal Horn - * - * This document contains proprietary information belonging to Czech - * Technical University in Prague. Passing on and copying of this - * document, and communication of its contents is not permitted - * without prior written authorization. - * - * File : cmd.c - * - * Abstract: - * This file contains root of the list of the commands. - * - */ - -/* Include files */ -#include "cmdproc.h" -#include "../cmd.h" -#include "../cmd_adc.h" -#include "../cmd_can.h" -#include "../cmd_pin.h" -#include "../cmd_port.h" - -#ifndef DOCGEN - -#include "rpp/rpp.h" -#include "hal/hal.h" - - -#include - -int cmd_do_version(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) -{ - rpp_sci_printf("version=%s\n", GIT_VERSION); - return 0; -} - -#endif /* DOCGEN */ - -/** Root list in which commands are stored */ -cmd_des_t const **cmd_list; - -/** Command descriptor for show help command */ -cmd_des_t const cmd_des_help = { - 0, 0, - "help","Print help for commands", - "### Syntax ###\n" - "\n" - " help [command]\n" - "\n" - "### Description ###\n" - "\n" - "This command without parameter prints the list of all available\n" - "commands with short help text for each of them. If a parameter is\n" - "provided, the command prints a long description for given command.\n", - CMD_HANDLER(cmd_do_help), (void *)&cmd_list -}; - -cmd_des_t const cmd_des_version = { - 0, 0, - "version","Print version of the software", - "### Syntax ###\n" - "\n" - " version\n" - "\n" - "### Description ###\n" - "\n" - "This command prints the version of the test software. The version\n" - "number is the output of 'git describe' command, i.e. it is composed\n" - "from the last tag in the git repository, the number of commits since\n" - "the tag and the abbreviated commit hash.\n" - "\n" - "### Example ###\n" - "\n" - " --> version\n" - " version=v0.2-109-ga81a9dd\n", - CMD_HANDLER(cmd_do_version), -}; - -/* ------------------------ - * Command lists definitons - * ------------------------ - */ - -/** @brief Main list of commands */ -cmd_des_t const *cmd_list_main[] = { - &cmd_des_help, - &cmd_des_version, - CMD_DES_INCLUDE_SUBLIST(cmd_list_adc), - CMD_DES_INCLUDE_SUBLIST(cmd_list_can), - CMD_DES_INCLUDE_SUBLIST(cmd_list_pin), - CMD_DES_INCLUDE_SUBLIST(cmd_list_port), - NULL -}; - -/** Pointer to the root list */ -cmd_des_t const **cmd_list = cmd_list_main; diff --git a/rpp-test-sw/commands/_tms570_hdk/cmd_adc.c b/rpp-test-sw/commands/_tms570_hdk/cmd_adc.c deleted file mode 100644 index 4e331dd..0000000 --- a/rpp-test-sw/commands/_tms570_hdk/cmd_adc.c +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (C) 2012-2013 Czech Technical University in Prague - * - * Created on: 28.2.2013 - * - * Authors: - * - Michal Horn - * - * This document contains proprietary information belonging to Czech - * Technical University in Prague. Passing on and copying of this - * document, and communication of its contents is not permitted - * without prior written authorization. - * - * File : cmd_adc.c - * - * Abstract: - * This file contains command for reading adc port. - * - */ - -#include "../cmd_adc.h" - -#ifndef DOCGEN - -#include "hal/hal.h" -#include "rpp/rpp.h" -#include - -static double lsb2volts(unsigned lsb) -{ - return ((double)lsb + 0.0)*2.5/4095*10; -} - - -/** - * @brief Read values from ADC port - * - * @param[in] cmd_io Pointer to IO stack - * @param[in] des Pointer to command descriptor - * @param[in] param Parameters of command - * @return 0 when OK or error code lower than 0 - */ -int cmd_do_read_adc1_values(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) -{ - uint32_t i, min, max; // Cycle control variable - - rpp_adc_update(); - if (param[1] == param[0] + 7) { /* Single pin variant */ - if (sscanf(param[1], "%d", &min) != 1) - return -CMDERR_BADPAR; - if (min > 15) - return -CMDERR_NODEV; - max = min; - } - else { /* All pins */ - min = 0; - max = PORT_ADC_CHANNEL_NUM-1; - } - for (i = min; i <= max; i++) { - unsigned d = rpp_adc_get(i+1); - double v = lsb2volts(d); - rpp_sci_printf("ADC%-2d %4d lsb ~ %5.2f V\n", i, d, v); - } - return 0; -} - -int cmd_do_adc_watch(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) -{ - int i; - - rpp_sci_printf("ADC Inputs Test [0-15]:\r\n"); - rpp_sci_printf("=======================================================================\r\n"); - - for (i = 0; i < 16; i++) - rpp_sci_printf("%5d ", i); - rpp_sci_printf("\n"); - - for (i = 1; i < 13; i++) - rpp_sci_printf("%5d ", i); - rpp_sci_printf("\n"); - - // Calculate wait time in OS ticks - static const portTickType freq_ticks = 100 /* ms */ / portTICK_RATE_MS; - portTickType last_wake_time = xTaskGetTickCount(); - - while (cmd_io->getc(cmd_io) < 0) { - // Update inputs - rpp_adc_update(); - - for (i = 0; i < 16; i++) - rpp_sci_printf("%5d ", rpp_adc_get(i+1)); - rpp_sci_printf("lsb\n"); - for (i = 0; i < 16; i++) - rpp_sci_printf("%5.2f ", lsb2volts(rpp_adc_get(i+1))); - rpp_sci_printf("V\r\033[A"); /* Cursor up */ - - - vTaskDelayUntil(&last_wake_time, freq_ticks); - } - rpp_sci_printf("\n\n"); - return 0; -} - - -#endif /* DOCGEN */ - -/** Descriptor of command for adc port reading */ -cmd_des_t const cmd_des_read_adc1 = { - 0, 0, - "adcread","Read values from ADC inputs", - "### Command syntax ###\n" - "\n" - " adcread\n" - "\n" - "### Description ###\n" - "\n" - "This command reads values corresponding to analog voltages on ADC\n" - "inputs 0-15 and prints them as decimal numbers as well as converted to\n" - "Volts.\n" - "\n" - "### Example ###\n" - "\n" - " --> adcread\n" - " ADC0 2332 lsb ~ 11.66 V\n" - " ADC1 2332 lsb ~ 11.66 V\n" - " ADC2 107 lsb ~ 0.54 V\n" - " ADC3 108 lsb ~ 0.54 V\n" - " ADC4 107 lsb ~ 0.54 V\n" - " ADC5 108 lsb ~ 0.54 V\n" - " ADC6 111 lsb ~ 0.56 V\n" - " ADC7 110 lsb ~ 0.55 V\n" - " ADC8 109 lsb ~ 0.55 V\n" - " ADC9 107 lsb ~ 0.54 V\n" - " ADC10 107 lsb ~ 0.54 V\n" - " ADC11 110 lsb ~ 0.55 V\n" - " ADC12 108 lsb ~ 0.54 V\n" - " ADC13 108 lsb ~ 0.54 V\n" - " ADC14 108 lsb ~ 0.54 V\n" - " ADC15 108 lsb ~ 0.54 V\n", - CMD_HANDLER(cmd_do_read_adc1_values), (void *)&cmd_list_adc -}; - -cmd_des_t const cmd_des_read_adc2 = { - 0, 0, - "adcread*","Read a value from a single ADC input", - "### Command syntax ###\n" - "\n" - " adcread\n" - "\n" - "where `` is a number in range 0 - 15.\n" - "\n" - "### Description ###\n" - "\n" - "This command reads the value corresponding to analog voltage on an ADC\n" - "input and prints it as decimal numbers as well as converted to Volts.\n" - "\n" - "### Example ###\n" - "\n" - " --> adcread1\n" - " ADC1 2331 lsb ~ 11.66 V\n", - CMD_HANDLER(cmd_do_read_adc1_values), (void *)&cmd_list_adc -}; - -cmd_des_t const cmd_des_adcwatch = { - 0, 0, - "adcwatch","Watch the values from ADC inputs", - "### Command syntax ###\n" - "\n" - " adcwatch\n" - "\n" - "### Description ###\n" - "\n" - "This command reads values corresponding to analog voltages on ADC\n" - "inputs 0-15 10 times per second and prints them as decimal numbers (in\n" - "lsb units) as well as converted to Volts. The command is ended by any\n" - "key.\n" - "\n" - "### Example ###\n" - "\n" - " --> adcwatch\n" - " ADC Inputs Test [0-15]:\n" - " =========================================================================================\n" - " 0 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n" - " 2331 107 108 106 107 110 110 109 107 107 110 109 109 109 109 lsb\n" - " 11.66 0.54 0.54 0.53 0.54 0.55 0.55 0.55 0.54 0.54 0.55 0.55 0.55 0.55 0.55 V\n", - CMD_HANDLER(cmd_do_adc_watch), (void *)&cmd_list_adc -}; - -/** List of commands for adc, defined as external */ -cmd_des_t const *cmd_list_adc[] = { - &cmd_des_read_adc1, - &cmd_des_read_adc2, - &cmd_des_adcwatch, - NULL -}; diff --git a/rpp-test-sw/commands/_rm48_hdk/cmd.c b/rpp-test-sw/commands/cmd.c similarity index 92% rename from rpp-test-sw/commands/_rm48_hdk/cmd.c rename to rpp-test-sw/commands/cmd.c index 2ef304d..ae0018d 100644 --- a/rpp-test-sw/commands/_rm48_hdk/cmd.c +++ b/rpp-test-sw/commands/cmd.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2013 Czech Technical University in Prague + * Copyright (C) 2012-2015 Czech Technical University in Prague * * Created on: 31.7.2012 * @@ -20,11 +20,11 @@ /* Include files */ #include "cmdproc.h" -#include "../cmd.h" -#include "../cmd_adc.h" -#include "../cmd_can.h" -#include "../cmd_pin.h" -#include "../cmd_port.h" +#include "cmd.h" +#include "cmd_adc.h" +#include "cmd_can.h" +#include "cmd_pin.h" +#include "cmd_port.h" #ifndef DOCGEN diff --git a/rpp-test-sw/commands/_rm48_hdk/cmd_adc.c b/rpp-test-sw/commands/cmd_adc.c similarity index 98% rename from rpp-test-sw/commands/_rm48_hdk/cmd_adc.c rename to rpp-test-sw/commands/cmd_adc.c index 4e331dd..97e04ab 100644 --- a/rpp-test-sw/commands/_rm48_hdk/cmd_adc.c +++ b/rpp-test-sw/commands/cmd_adc.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2013 Czech Technical University in Prague + * Copyright (C) 2012-2015 Czech Technical University in Prague * * Created on: 28.2.2013 * @@ -18,7 +18,7 @@ * */ -#include "../cmd_adc.h" +#include "cmd_adc.h" #ifndef DOCGEN diff --git a/rpp-test-sw/commands/_tms570_hdk/cmd_pin.c b/rpp-test-sw/commands/cmd_pin.c similarity index 98% rename from rpp-test-sw/commands/_tms570_hdk/cmd_pin.c rename to rpp-test-sw/commands/cmd_pin.c index cb73203..a56cc50 100644 --- a/rpp-test-sw/commands/_tms570_hdk/cmd_pin.c +++ b/rpp-test-sw/commands/cmd_pin.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2013 Czech Technical University in Prague + * Copyright (C) 2012-2015 Czech Technical University in Prague * * Created on: 28.2.2013 * @@ -20,7 +20,7 @@ * - Setting and getting pins direction */ -#include "../cmd_pin.h" +#include "cmd_pin.h" #include "stdio.h" #include "string.h" diff --git a/rpp-test-sw/commands/_tms570_hdk/cmd_port.c b/rpp-test-sw/commands/cmd_port.c similarity index 98% rename from rpp-test-sw/commands/_tms570_hdk/cmd_port.c rename to rpp-test-sw/commands/cmd_port.c index 06f6ab0..88e159b 100644 --- a/rpp-test-sw/commands/_tms570_hdk/cmd_port.c +++ b/rpp-test-sw/commands/cmd_port.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2013 Czech Technical University in Prague + * Copyright (C) 2012-2015 Czech Technical University in Prague * * Created on: 28.2.2013 * @@ -19,7 +19,7 @@ * - Setting/getting port value* */ -#include "../cmd_port.h" +#include "cmd_port.h" #include "stdio.h" #ifndef DOCGEN diff --git a/rpp-test-sw/commands/_tms570_hdk/main.c b/rpp-test-sw/commands/main.c similarity index 75% rename from rpp-test-sw/commands/_tms570_hdk/main.c rename to rpp-test-sw/commands/main.c index 4f3bb12..22ccb04 100644 --- a/rpp-test-sw/commands/_tms570_hdk/main.c +++ b/rpp-test-sw/commands/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2014 Czech Technical University in Prague + * Copyright (C) 2012-2015 Czech Technical University in Prague * * Created on: 15.3.2012 * @@ -23,7 +23,13 @@ #include "rpp/rpp.h" #include "os/os.h" #include "cmdproc_freertos.h" -#include "version.h" // Generated by Eclipse in the pre-build step +#include "version.h" // Generated by Makefile + +#if defined(TARGET_TMS570_HDK) +#define TARGET_STR "TI HDK TMS570LS3137" +#elif defined(TARGET_RM48_HDK) +#define TARGET_STR "TI HDK RM48L952" +#endif /** @fn void main(void) * @brief Application main function @@ -39,7 +45,7 @@ void main(void) // Speed up the SCI rpp_sci_setup(115200); - rpp_sci_printf("\nTi HDK TMS570LS3137, FreeRTOS %d.%d.%d\n", FREERTOS_VERSION_NUMBER_MAYOR, FREERTOS_VERSION_NUMBER_MINOR, FREERTOS_VERSION_NUMBER_REV); + rpp_sci_printf("\n" TARGET_STR ", FreeRTOS %d.%d.%d\n", FREERTOS_VERSION_NUMBER_MAYOR, FREERTOS_VERSION_NUMBER_MINOR, FREERTOS_VERSION_NUMBER_REV); rpp_sci_printf("Test Software version " GIT_VERSION "\n"); rpp_sci_printf("CTU in Prague 04/2015\n"); -- 2.39.2