X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Ftestee.c;h=b95cb82bc8505b44a114027b3a42402a22ac0963;hb=b6c4a5db3e306b317308bab1e872b4a66eb65487;hp=991c64e85f4cffef1524c7095cfefa7b65126070;hpb=f7bd1e8f3a302378687ded559e865c258d441c89;p=openocd.git diff --git a/src/target/testee.c b/src/target/testee.c index 991c64e85f..b95cb82bc8 100644 --- a/src/target/testee.c +++ b/src/target/testee.c @@ -14,15 +14,17 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif + +#include + #include "target.h" #include "target_type.h" -#include #include "hello.h" static const struct command_registration testee_command_handlers[] = { @@ -42,18 +44,23 @@ static int testee_init(struct command_context *cmd_ctx, struct target *target) } static int testee_poll(struct target *target) { + if ((target->state == TARGET_RUNNING) || (target->state == TARGET_DEBUG_RUNNING)) + target->state = TARGET_HALTED; return ERROR_OK; } static int testee_halt(struct target *target) { + target->state = TARGET_HALTED; return ERROR_OK; } static int testee_reset_assert(struct target *target) { + target->state = TARGET_RESET; return ERROR_OK; } static int testee_reset_deassert(struct target *target) { + target->state = TARGET_RUNNING; return ERROR_OK; } struct target_type testee_target = {