]> git.sur5r.net Git - openocd/commitdiff
separate Jim from jtag/core.c
authorZachary T Welch <zw@superlucidity.net>
Fri, 4 Dec 2009 00:25:51 +0000 (16:25 -0800)
committerZachary T Welch <zw@superlucidity.net>
Fri, 4 Dec 2009 11:34:32 +0000 (03:34 -0800)
After previous efforts, only one Jim routine remained in jtag/core.c,
and moving it to jtag/tcl.c painlessly finishes separating these layers.
The headers need separating, but the implementation is clean.

src/jtag/core.c
src/jtag/tcl.c

index 9230cc2bc5ef83559bda68d4747b4d4e22a7d8c5..433b50bf03e0e561b989c083b2bbf4859038af78 100644 (file)
@@ -244,17 +244,6 @@ struct jtag_tap *jtag_tap_by_string(const char *s)
        return t;
 }
 
-struct jtag_tap *jtag_tap_by_jim_obj(Jim_Interp *interp, Jim_Obj *o)
-{
-       const char *cp = Jim_GetString(o, NULL);
-       struct jtag_tap *t = cp ? jtag_tap_by_string(cp) : NULL;
-       if (NULL == cp)
-               cp = "(unknown)";
-       if (NULL == t)
-               Jim_SetResult_sprintf(interp, "Tap '%s' could not be found", cp);
-       return t;
-}
-
 struct jtag_tap* jtag_tap_next_enabled(struct jtag_tap* p)
 {
        p = p ? p->next_tap : jtag_all_taps();
index 81bafbb639493c524675536c188be99efc47430f..9704c302df694e35f8f65e1bb23e67e09bb1cda8 100644 (file)
@@ -51,6 +51,17 @@ static const Jim_Nvp nvp_jtag_tap_event[] = {
 
 extern struct jtag_interface *jtag_interface;
 
+struct jtag_tap *jtag_tap_by_jim_obj(Jim_Interp *interp, Jim_Obj *o)
+{
+       const char *cp = Jim_GetString(o, NULL);
+       struct jtag_tap *t = cp ? jtag_tap_by_string(cp) : NULL;
+       if (NULL == cp)
+               cp = "(unknown)";
+       if (NULL == t)
+               Jim_SetResult_sprintf(interp, "Tap '%s' could not be found", cp);
+       return t;
+}
+
 static bool scan_is_safe(tap_state_t state)
 {
        switch (state)