Duane Ellis: fix warnings
[fw/openocd] / src / jtag / dummy.c
1 /***************************************************************************\r
2  *   Copyright (C) 2008 by Ã˜yvind Harboe                                   *\r
3  *   oyvind.harboe@zylin.com                                               *\r
4  *                                                                         *\r
5  *   This program is free software; you can redistribute it and/or modify  *\r
6  *   it under the terms of the GNU General Public License as published by  *\r
7  *   the Free Software Foundation; either version 2 of the License, or     *\r
8  *   (at your option) any later version.                                   *\r
9  *                                                                         *\r
10  *   This program is distributed in the hope that it will be useful,       *\r
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *\r
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
13  *   GNU General Public License for more details.                          *\r
14  *                                                                         *\r
15  *   You should have received a copy of the GNU General Public License     *\r
16  *   along with this program; if not, write to the                         *\r
17  *   Free Software Foundation, Inc.,                                       *\r
18  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
19  ***************************************************************************/\r
20 #ifdef HAVE_CONFIG_H\r
21 #include "config.h"\r
22 #endif\r
23 \r
24 #include "replacements.h"\r
25 \r
26 #include "jtag.h"\r
27 #include "bitbang.h"\r
28 \r
29 \r
30 int dummy_speed(int speed);\r
31 int dummy_register_commands(struct command_context_s *cmd_ctx);\r
32 int dummy_init(void);\r
33 int dummy_quit(void);\r
34 \r
35 /* The dummy driver is used to easily check the code path \r
36  * where the target is unresponsive.\r
37  */\r
38 jtag_interface_t dummy_interface = \r
39 {\r
40         .name = "dummy",\r
41         \r
42         .execute_queue = bitbang_execute_queue,\r
43 \r
44         .speed = dummy_speed,   \r
45         .register_commands = dummy_register_commands,\r
46         .init = dummy_init,\r
47         .quit = dummy_quit,\r
48 };\r
49 \r
50 int dummy_read(void);\r
51 void dummy_write(int tck, int tms, int tdi);\r
52 void dummy_reset(int trst, int srst);\r
53 void dummy_led(int on);\r
54 \r
55 bitbang_interface_t dummy_bitbang =\r
56 {\r
57         .read = dummy_read,\r
58         .write = dummy_write,\r
59         .reset = dummy_reset,\r
60         .blink = dummy_led\r
61 };\r
62 \r
63 int dummy_read(void)\r
64 {\r
65         return 1;\r
66 }\r
67 \r
68 \r
69 void dummy_write(int tck, int tms, int tdi)\r
70 {\r
71 }\r
72 \r
73 void dummy_reset(int trst, int srst)\r
74 {\r
75 }\r
76         \r
77 \r
78 int dummy_speed(int speed)\r
79 {\r
80         return ERROR_OK;\r
81 }\r
82 \r
83 int dummy_register_commands(struct command_context_s *cmd_ctx)\r
84 {\r
85         return ERROR_OK;\r
86 }\r
87 \r
88 \r
89 int dummy_init(void)\r
90 {\r
91         bitbang_interface = &dummy_bitbang;     \r
92 \r
93         return ERROR_OK;\r
94 }\r
95 \r
96 int dummy_quit(void)\r
97 {\r
98         return ERROR_OK;\r
99 }\r
100 \r
101 \r
102 void dummy_led(int on)\r
103 {\r
104 }\r
105 \r