]> rtime.felk.cvut.cz Git - fpga/virtex2/msp_motion.git/blob - software/msp430-virtex2-motion/app/motion.c
Merge branch 'master' of rtime.felk.cvut.cz:/fpga/virtex2/msp_motion
[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 "msp430.h"
6 #include "pxmc_virtex2.h"
7
8 #define MOTOR_VECTOR      0
9
10 interrupt(MOTOR_VECTOR) motor_isr() {
11   pxmc_sfi_isr();
12 }
13
14
15 cmd_des_t const **cmd_list;
16
17 cmd_des_t const cmd_des_help={
18     0, 0,
19     "HELP","prints help for commands",
20     cmd_do_help,{(char*)&cmd_list}};
21
22 int val;
23 cmd_des_t const cmd_des_val={
24     0, CDESM_OPCHR|CDESM_RW,
25     "VAL","use ':' or '?' to store/read value of an integer variable",
26     cmd_do_rw_int, {(char*)&val}};
27
28
29     
30 cmd_des_t const *cmd_pxmc_list[] = {
31   &cmd_des_help,
32   &cmd_des_val,
33   CMD_DES_INCLUDE_SUBLIST(cmd_pxmc_base),
34   CMD_DES_INCLUDE_SUBLIST(cmd_pxmc_deb),
35   NULL
36 };
37
38 cmd_des_t const **cmd_list = cmd_pxmc_list;
39
40 extern cmd_io_t cmd_io_std_line;
41
42 int main()
43 {
44   WDTCTL = WDTPW | WDTHOLD;
45   puts("PXMC motion control running...\n");
46
47   pxmc_initialize();
48
49   eint();
50   
51   while (1) {
52     cmd_processor_run(&cmd_io_std_line, cmd_pxmc_list);
53   }
54 }