From aa51d6be38e8cab38994b331e98edbe35044c5de Mon Sep 17 00:00:00 2001 From: Vladimir Burian Date: Thu, 21 Apr 2011 15:27:14 +0200 Subject: [PATCH] Added simple app testing libpxmc --- build/Makefile | 2 +- software/msp430-virtex2-motion/Makefile | 15 +++++ software/msp430-virtex2-motion/Makefile.omk | 6 ++ software/msp430-virtex2-motion/Makefile.rules | 1 + software/msp430-virtex2-motion/app/Makefile | 15 +++++ .../msp430-virtex2-motion/app/Makefile.omk | 13 ++++ software/msp430-virtex2-motion/app/motion.c | 59 +++++++++++++++++++ software/msp430-virtex2-motion/arch | 1 + software/msp430-virtex2-motion/board | 1 + software/msp430-virtex2-motion/cmdproc | 1 + software/msp430-virtex2-motion/config.target | 30 ++++++++++ software/msp430-virtex2-motion/misc | 1 + .../msp430-virtex2-motion.kdev4 | 3 + software/msp430-virtex2-motion/pxmc | 1 + 14 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 software/msp430-virtex2-motion/Makefile create mode 100644 software/msp430-virtex2-motion/Makefile.omk create mode 120000 software/msp430-virtex2-motion/Makefile.rules create mode 100644 software/msp430-virtex2-motion/app/Makefile create mode 100644 software/msp430-virtex2-motion/app/Makefile.omk create mode 100644 software/msp430-virtex2-motion/app/motion.c create mode 120000 software/msp430-virtex2-motion/arch create mode 120000 software/msp430-virtex2-motion/board create mode 120000 software/msp430-virtex2-motion/cmdproc create mode 100644 software/msp430-virtex2-motion/config.target create mode 120000 software/msp430-virtex2-motion/misc create mode 100644 software/msp430-virtex2-motion/msp430-virtex2-motion.kdev4 create mode 120000 software/msp430-virtex2-motion/pxmc diff --git a/build/Makefile b/build/Makefile index 13a8320..63fc6af 100644 --- a/build/Makefile +++ b/build/Makefile @@ -52,7 +52,7 @@ UCF = $(TOP).ucf ARCH = msp430 BOARD = virtex2 -APP = +APP = motion BMM = memory.bmm SW_SRC = software/$(ARCH)-$(BOARD)-$(APP) diff --git a/software/msp430-virtex2-motion/Makefile b/software/msp430-virtex2-motion/Makefile new file mode 100644 index 0000000..cafc99f --- /dev/null +++ b/software/msp430-virtex2-motion/Makefile @@ -0,0 +1,15 @@ +# Generic directory or leaf node makefile for OCERA make framework + +ifndef MAKERULES_DIR +MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) ) +endif + +ifeq ($(MAKERULES_DIR),) +all : default +.DEFAULT:: + @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n" +else +include $(MAKERULES_DIR)/Makefile.rules +endif + +# DO NOT DELETE diff --git a/software/msp430-virtex2-motion/Makefile.omk b/software/msp430-virtex2-motion/Makefile.omk new file mode 100644 index 0000000..0f8d70e --- /dev/null +++ b/software/msp430-virtex2-motion/Makefile.omk @@ -0,0 +1,6 @@ +# -*- makefile -*- + +SUBDIRS = arch board cmdproc misc pxmc app + +-include $(SOURCES_DIR)/Makefile.omk-additional + diff --git a/software/msp430-virtex2-motion/Makefile.rules b/software/msp430-virtex2-motion/Makefile.rules new file mode 120000 index 0000000..afb2930 --- /dev/null +++ b/software/msp430-virtex2-motion/Makefile.rules @@ -0,0 +1 @@ +../Makefile.rules \ No newline at end of file diff --git a/software/msp430-virtex2-motion/app/Makefile b/software/msp430-virtex2-motion/app/Makefile new file mode 100644 index 0000000..cafc99f --- /dev/null +++ b/software/msp430-virtex2-motion/app/Makefile @@ -0,0 +1,15 @@ +# Generic directory or leaf node makefile for OCERA make framework + +ifndef MAKERULES_DIR +MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) ) +endif + +ifeq ($(MAKERULES_DIR),) +all : default +.DEFAULT:: + @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n" +else +include $(MAKERULES_DIR)/Makefile.rules +endif + +# DO NOT DELETE diff --git a/software/msp430-virtex2-motion/app/Makefile.omk b/software/msp430-virtex2-motion/app/Makefile.omk new file mode 100644 index 0000000..3c85be4 --- /dev/null +++ b/software/msp430-virtex2-motion/app/Makefile.omk @@ -0,0 +1,13 @@ +# -*- makefile -*- + +bin_PROGRAMS = motion +motion_SOURCES = motion.c + +motion_LIBS = pxmc cmdproc misc + +lib_LOADLIBES = pxmcbsp + +#lib_LOADLIBES = bspbase ul_drv lpciap uloi keyval lpciap_kvpb mach_hal uldy + +# This selects linker script +#link_VARIANTS = sstub diff --git a/software/msp430-virtex2-motion/app/motion.c b/software/msp430-virtex2-motion/app/motion.c new file mode 100644 index 0000000..5d2fb94 --- /dev/null +++ b/software/msp430-virtex2-motion/app/motion.c @@ -0,0 +1,59 @@ +#include +#include +#include +#include +#include "pxmc_virtex2.h" + +#define MOTOR_VECTOR 0 + +interrupt(MOTOR_VECTOR) motor_isr() { + pxmc_sfi_isr(); +} + + +cmd_des_t const **cmd_list; + +cmd_des_t const cmd_des_help={ + 0, 0, + "HELP","prints help for commands", + cmd_do_help,{(char*)&cmd_list}}; + +int val; +cmd_des_t const cmd_des_val={ + 0, CDESM_OPCHR|CDESM_RW, + "VAL","use ':' or '?' to store/read value of an integer variable", + cmd_do_rw_int, {(char*)&val}}; + + + +cmd_des_t const *cmd_pxmc_list[] = { + &cmd_des_help, + &cmd_des_val, + CMD_DES_INCLUDE_SUBLIST(cmd_pxmc_base), + CMD_DES_INCLUDE_SUBLIST(cmd_pxmc_deb), + NULL +}; + +cmd_des_t const **cmd_list = cmd_pxmc_list; + + +extern pxmc_state_t *pxmc_main_arr[]; + +pxmc_state_list_t pxmc_main_list={ + pxml_arr:pxmc_main_arr, + pxml_cnt:0 +}; + + +extern cmd_io_t cmd_io_std_line; + +int main() +{ + pxmc_initialize(); + + eint(); + + while (1) { + cmd_processor_run(&cmd_io_std_line, cmd_pxmc_list); + } +} diff --git a/software/msp430-virtex2-motion/arch b/software/msp430-virtex2-motion/arch new file mode 120000 index 0000000..90fe9ab --- /dev/null +++ b/software/msp430-virtex2-motion/arch @@ -0,0 +1 @@ +../submodule/sysless/arch/ \ No newline at end of file diff --git a/software/msp430-virtex2-motion/board b/software/msp430-virtex2-motion/board new file mode 120000 index 0000000..2ba265e --- /dev/null +++ b/software/msp430-virtex2-motion/board @@ -0,0 +1 @@ +../submodule/sysless/board/ \ No newline at end of file diff --git a/software/msp430-virtex2-motion/cmdproc b/software/msp430-virtex2-motion/cmdproc new file mode 120000 index 0000000..974ac28 --- /dev/null +++ b/software/msp430-virtex2-motion/cmdproc @@ -0,0 +1 @@ +../submodule/sysless/libs4c/cmdproc/ \ No newline at end of file diff --git a/software/msp430-virtex2-motion/config.target b/software/msp430-virtex2-motion/config.target new file mode 100644 index 0000000..00915ef --- /dev/null +++ b/software/msp430-virtex2-motion/config.target @@ -0,0 +1,30 @@ +ARCH=msp430 +MACH=openmsp430 +BOARD=virtex2 +#CONFIG_BOARD_VARIANT= + +CONFIG_OC_CMDPROC=y +CONFIG_MISC_LIBRARY=y + +CONFIG_PXMC=y +CONFIG_PXMC_COORDMV=n +CONFIG_PXMC_CMPQUE=n +CONFIG_PXMC_WITH_PTABLE=n + + +CROSS_COMPILE = msp430- +TARGET_ARCH = -mmcu=msp430x423 + +# Set default C flags. If theese are set elsewhere (e.g. on a command +# line), these default flags are not used. +DEBUG ?= +OPTIMIZE ?= -O2 + +# This selects linker script +LD_SCRIPT=openmsp430-sstub + +#OUTPUT_FORMATS = bin hex srec + +OUTPUT_FORMATS = bin + + diff --git a/software/msp430-virtex2-motion/misc b/software/msp430-virtex2-motion/misc new file mode 120000 index 0000000..a4be88f --- /dev/null +++ b/software/msp430-virtex2-motion/misc @@ -0,0 +1 @@ +../submodule/sysless/libs4c/misc/ \ No newline at end of file diff --git a/software/msp430-virtex2-motion/msp430-virtex2-motion.kdev4 b/software/msp430-virtex2-motion/msp430-virtex2-motion.kdev4 new file mode 100644 index 0000000..8251668 --- /dev/null +++ b/software/msp430-virtex2-motion/msp430-virtex2-motion.kdev4 @@ -0,0 +1,3 @@ +[Project] +Manager=KDevCustomMakeManager +Name=msp430-virtex2-motion diff --git a/software/msp430-virtex2-motion/pxmc b/software/msp430-virtex2-motion/pxmc new file mode 120000 index 0000000..76ad9b3 --- /dev/null +++ b/software/msp430-virtex2-motion/pxmc @@ -0,0 +1 @@ +../submodule/pxmc/libs4c/ \ No newline at end of file -- 2.39.2