]> rtime.felk.cvut.cz Git - fpga/virtex2/msp_motion.git/blob - software/msp430-virtex2-motion/app/motion.c
5d2fb943bcdc44d68a196cb87511f2bed1d64082
[fpga/virtex2/msp_motion.git] / software / msp430-virtex2-motion / app / motion.c
1 #include <stdio.h>
2 #include <cmd_proc.h>
3 #include <pxmc_cmds.h>
4 #include <signal.h>
5 #include "pxmc_virtex2.h"
6
7 #define MOTOR_VECTOR      0
8
9 interrupt(MOTOR_VECTOR) motor_isr() {
10   pxmc_sfi_isr();
11 }
12
13
14 cmd_des_t const **cmd_list;
15
16 cmd_des_t const cmd_des_help={
17     0, 0,
18     "HELP","prints help for commands",
19     cmd_do_help,{(char*)&cmd_list}};
20
21 int val;
22 cmd_des_t const cmd_des_val={
23     0, CDESM_OPCHR|CDESM_RW,
24     "VAL","use ':' or '?' to store/read value of an integer variable",
25     cmd_do_rw_int, {(char*)&val}};
26
27
28     
29 cmd_des_t const *cmd_pxmc_list[] = {
30   &cmd_des_help,
31   &cmd_des_val,
32   CMD_DES_INCLUDE_SUBLIST(cmd_pxmc_base),
33   CMD_DES_INCLUDE_SUBLIST(cmd_pxmc_deb),
34   NULL
35 };
36
37 cmd_des_t const **cmd_list = cmd_pxmc_list;
38
39
40 extern pxmc_state_t *pxmc_main_arr[];
41
42 pxmc_state_list_t  pxmc_main_list={
43   pxml_arr:pxmc_main_arr,
44   pxml_cnt:0
45 };
46
47
48 extern cmd_io_t cmd_io_std_line;
49
50 int main()
51 {
52   pxmc_initialize();
53
54   eint();
55   
56   while (1) {
57     cmd_processor_run(&cmd_io_std_line, cmd_pxmc_list);
58   }
59 }