FreeCalypso > hg > freecalypso-tools
comparison target-utils/c139explore/dac.c @ 40:7ecb70b0ac36
c139explore: vibe command added that works like buz
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 26 Oct 2016 01:59:32 +0000 |
parents | 280826b807e3 |
children | ce636b0ffb3d |
comparison
equal
deleted
inserted
replaced
39:280826b807e3 | 40:7ecb70b0ac36 |
---|---|
27 printf("ERROR: argument out of range\n"); | 27 printf("ERROR: argument out of range\n"); |
28 return; | 28 return; |
29 } | 29 } |
30 abb_reg_write(AUXDAC, val); | 30 abb_reg_write(AUXDAC, val); |
31 } | 31 } |
32 | |
33 void | |
34 cmd_vibe(argbulk) | |
35 char *argbulk; | |
36 { | |
37 char *argv[2]; | |
38 u32 val; | |
39 int c; | |
40 | |
41 if (parse_args(argbulk, 1, 1, argv, 0) < 0) | |
42 return; | |
43 val = strtoul(argv[0], 0, 0); | |
44 if (val > 0x3FF) { | |
45 printf("ERROR: argument out of range\n"); | |
46 return; | |
47 } | |
48 abb_reg_write(AUXDAC, val); | |
49 for (;;) { | |
50 c = serial_in_poll(); | |
51 if (c >= 0) | |
52 break; | |
53 } | |
54 abb_reg_write(AUXDAC, 0); | |
55 } |