Commit 60ba4476 authored by ntfreak's avatar ntfreak
Browse files

- fix incorrectly registered function openocd_array2mem

- removed unused variables
- reformatted lpc288x.[ch]
- fixed helper/Makefile.am dependencies
- add correct svn props to added files

git-svn-id: svn://svn.berlios.de/openocd/trunk@829 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent 722fcb8d
...@@ -141,12 +141,12 @@ int flash_register_commands(struct command_context_s *cmd_ctx) ...@@ -141,12 +141,12 @@ int flash_register_commands(struct command_context_s *cmd_ctx)
static int jim_flash_banks(Jim_Interp *interp, int argc, Jim_Obj *const *argv) static int jim_flash_banks(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{ {
flash_bank_t *p;
if (argc != 1) { if (argc != 1) {
Jim_WrongNumArgs(interp, 1, argv, "no arguments to flash_banks command"); Jim_WrongNumArgs(interp, 1, argv, "no arguments to flash_banks command");
return JIM_ERR; return JIM_ERR;
} }
flash_bank_t *p;
int i = 0;
if (!flash_banks) if (!flash_banks)
{ {
...@@ -158,7 +158,6 @@ static int jim_flash_banks(Jim_Interp *interp, int argc, Jim_Obj *const *argv) ...@@ -158,7 +158,6 @@ static int jim_flash_banks(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{ {
Jim_Obj *elem=Jim_NewListObj(interp, NULL, 0); Jim_Obj *elem=Jim_NewListObj(interp, NULL, 0);
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "name", -1)); Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "name", -1));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, p->driver->name, -1)); Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, p->driver->name, -1));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "base", -1)); Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "base", -1));
...@@ -178,7 +177,6 @@ static int jim_flash_banks(Jim_Interp *interp, int argc, Jim_Obj *const *argv) ...@@ -178,7 +177,6 @@ static int jim_flash_banks(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
return JIM_OK; return JIM_OK;
} }
int flash_init_drivers(struct command_context_s *cmd_ctx) int flash_init_drivers(struct command_context_s *cmd_ctx)
{ {
if (flash_banks) if (flash_banks)
......
...@@ -94,8 +94,6 @@ ...@@ -94,8 +94,6 @@
/* F_CLK_TIME */ /* F_CLK_TIME */
#define FCT_CLK_DIV_MASK 0x0FFF #define FCT_CLK_DIV_MASK 0x0FFF
int lpc288x_register_commands(struct command_context_s *cmd_ctx); int lpc288x_register_commands(struct command_context_s *cmd_ctx);
int lpc288x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); int lpc288x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);
int lpc288x_erase(struct flash_bank_s *bank, int first, int last); int lpc288x_erase(struct flash_bank_s *bank, int first, int last);
...@@ -134,8 +132,6 @@ int lpc288x_register_commands(struct command_context_s *cmd_ctx) ...@@ -134,8 +132,6 @@ int lpc288x_register_commands(struct command_context_s *cmd_ctx)
return ERROR_OK; return ERROR_OK;
} }
u32 lpc288x_wait_status_busy(flash_bank_t *bank, int timeout) u32 lpc288x_wait_status_busy(flash_bank_t *bank, int timeout)
{ {
u32 status; u32 status;
...@@ -160,8 +156,7 @@ int lpc288x_read_part_info(struct flash_bank_s *bank) ...@@ -160,8 +156,7 @@ int lpc288x_read_part_info(struct flash_bank_s *bank)
{ {
lpc288x_flash_bank_t *lpc288x_info = bank->driver_priv; lpc288x_flash_bank_t *lpc288x_info = bank->driver_priv;
target_t *target = bank->target; target_t *target = bank->target;
u32 cidr, status; u32 cidr;
int sectornum;
int i = 0; int i = 0;
u32 offset; u32 offset;
...@@ -212,12 +207,10 @@ int lpc288x_protect_check(struct flash_bank_s *bank) ...@@ -212,12 +207,10 @@ int lpc288x_protect_check(struct flash_bank_s *bank)
return ERROR_OK; return ERROR_OK;
} }
/* flash_bank LPC288x 0 0 0 0 <target#> <cclk> /* flash_bank LPC288x 0 0 0 0 <target#> <cclk> */
*/
int lpc288x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank) int lpc288x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
{ {
lpc288x_flash_bank_t *lpc288x_info; lpc288x_flash_bank_t *lpc288x_info;
int i;
if (argc < 6) if (argc < 6)
{ {
...@@ -235,36 +228,29 @@ int lpc288x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, cha ...@@ -235,36 +228,29 @@ int lpc288x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, cha
return ERROR_OK; return ERROR_OK;
} }
/* /* The frequency is the AHB clock frequency divided by (CLK_DIV 3) + 1.
The frequency is the AHB clock frequency divided by (CLK_DIV * This must be programmed such that the Flash Programming clock frequency is 66 kHz 20%.
3) + 1. This must be programmed such that the Flash * AHB = 12 MHz ?
Programming clock frequency is 66 kHz 20%. * 12000000/66000 = 182
AHB = 12 MHz ? * CLK_DIV = 60 ? */
12000000/66000 = 182
CLK_DIV = 60 ?
*/
void lpc288x_set_flash_clk(struct flash_bank_s *bank) void lpc288x_set_flash_clk(struct flash_bank_s *bank)
{ {
u32 clk_time; u32 clk_time;
lpc288x_flash_bank_t *lpc288x_info = bank->driver_priv; lpc288x_flash_bank_t *lpc288x_info = bank->driver_priv;
clk_time = (lpc288x_info->cclk / 66000) / 3; clk_time = (lpc288x_info->cclk / 66000) / 3;
target_write_u32(bank->target, F_CTRL, FC_CS | FC_WEN ); target_write_u32(bank->target, F_CTRL, FC_CS | FC_WEN);
target_write_u32(bank->target, F_CLK_TIME, clk_time); target_write_u32(bank->target, F_CLK_TIME, clk_time);
} }
/* /* AHB tcyc (in ns) 83 ns
AHB tcyc (in ns) 83 ns * LOAD_TIMER_ERASE FPT_TIME = ((400,000,000 / AHB tcyc (in ns)) - 2) / 512
* = 9412 (9500) (AN10548 9375)
LOAD_TIMER_ERASE FPT_TIME = ((400,000,000 / AHB tcyc (in ns)) - 2) / 512 * LOAD_TIMER_WRITE FPT_TIME = ((1,000,000 / AHB tcyc (in ns)) - 2) / 512
= 9412 (9500) (AN10548 9375) * = 23 (75) (AN10548 72 - is this wrong?)
LOAD_TIMER_WRITE FPT_TIME = ((1,000,000 / AHB tcyc (in ns)) - 2) / 512 * TODO: Sort out timing calcs ;) */
= 23 (75) (AN10548 72 - is this wrong?)
TODO: Sort out timing calcs ;)
*/
void lpc288x_load_timer(int erase, struct target_s *target) void lpc288x_load_timer(int erase, struct target_s *target)
{ {
if(erase == LOAD_TIMER_ERASE) if (erase == LOAD_TIMER_ERASE)
{ {
target_write_u32(target, F_PROG_TIME, FPT_ENABLE | 9500); target_write_u32(target, F_PROG_TIME, FPT_ENABLE | 9500);
} }
...@@ -274,8 +260,6 @@ void lpc288x_load_timer(int erase, struct target_s *target) ...@@ -274,8 +260,6 @@ void lpc288x_load_timer(int erase, struct target_s *target)
} }
} }
u32 lpc288x_system_ready(struct flash_bank_s *bank) u32 lpc288x_system_ready(struct flash_bank_s *bank)
{ {
lpc288x_flash_bank_t *lpc288x_info = bank->driver_priv; lpc288x_flash_bank_t *lpc288x_info = bank->driver_priv;
...@@ -293,9 +277,8 @@ u32 lpc288x_system_ready(struct flash_bank_s *bank) ...@@ -293,9 +277,8 @@ u32 lpc288x_system_ready(struct flash_bank_s *bank)
int lpc288x_erase_check(struct flash_bank_s *bank) int lpc288x_erase_check(struct flash_bank_s *bank)
{ {
u32 buffer, test_bytes; u32 status = lpc288x_system_ready(bank); /* probed? halted? */
u32 addr, sector, i, status = lpc288x_system_ready(bank); /* probed? halted? */ if (status != ERROR_OK)
if(status != ERROR_OK)
{ {
LOG_INFO("Processor not halted/not probed"); LOG_INFO("Processor not halted/not probed");
return status; return status;
...@@ -311,7 +294,7 @@ int lpc288x_erase(struct flash_bank_s *bank, int first, int last) ...@@ -311,7 +294,7 @@ int lpc288x_erase(struct flash_bank_s *bank, int first, int last)
target_t *target = bank->target; target_t *target = bank->target;
status = lpc288x_system_ready(bank); /* probed? halted? */ status = lpc288x_system_ready(bank); /* probed? halted? */
if(status != ERROR_OK) if (status != ERROR_OK)
{ {
return status; return status;
} }
...@@ -334,25 +317,17 @@ int lpc288x_erase(struct flash_bank_s *bank, int first, int last) ...@@ -334,25 +317,17 @@ int lpc288x_erase(struct flash_bank_s *bank, int first, int last)
lpc288x_load_timer(LOAD_TIMER_ERASE,target); lpc288x_load_timer(LOAD_TIMER_ERASE,target);
target_write_u32( target, target_write_u32(target, bank->sectors[sector].offset, 0x00);
bank->sectors[sector].offset,
0x00);
target_write_u32( target, target_write_u32(target, F_CTRL, FC_PROG_REQ | FC_PROTECT | FC_CS);
F_CTRL,
FC_PROG_REQ |
FC_PROTECT |
FC_CS);
} }
if (lpc288x_wait_status_busy(bank, 1000) != ERROR_OK) if (lpc288x_wait_status_busy(bank, 1000) != ERROR_OK)
{ {
return ERROR_FLASH_OPERATION_FAILED; return ERROR_FLASH_OPERATION_FAILED;
} }
return ERROR_OK; return ERROR_OK;
} }
int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
{ {
u8 page_buffer[FLASH_PAGE_SIZE]; u8 page_buffer[FLASH_PAGE_SIZE];
...@@ -363,7 +338,7 @@ int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) ...@@ -363,7 +338,7 @@ int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
/* probed? halted? */ /* probed? halted? */
status = lpc288x_system_ready(bank); status = lpc288x_system_ready(bank);
if(status != ERROR_OK) if (status != ERROR_OK)
{ {
return status; return status;
} }
...@@ -372,9 +347,9 @@ int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) ...@@ -372,9 +347,9 @@ int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
first_sector = last_sector = 0xffffffff; first_sector = last_sector = 0xffffffff;
/* validate the write range... */ /* validate the write range... */
for(i = 0; i < bank->num_sectors; i++) for (i = 0; i < bank->num_sectors; i++)
{ {
if((offset >= bank->sectors[i].offset) && if ((offset >= bank->sectors[i].offset) &&
(offset < (bank->sectors[i].offset + bank->sectors[i].size)) && (offset < (bank->sectors[i].offset + bank->sectors[i].size)) &&
(first_sector == 0xffffffff)) (first_sector == 0xffffffff))
{ {
...@@ -386,7 +361,7 @@ int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) ...@@ -386,7 +361,7 @@ int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
return ERROR_FLASH_DST_BREAKS_ALIGNMENT; return ERROR_FLASH_DST_BREAKS_ALIGNMENT;
} }
} }
if(((offset + count) > bank->sectors[i].offset) && if (((offset + count) > bank->sectors[i].offset) &&
((offset + count) <= (bank->sectors[i].offset + bank->sectors[i].size)) && ((offset + count) <= (bank->sectors[i].offset + bank->sectors[i].size)) &&
(last_sector == 0xffffffff)) (last_sector == 0xffffffff))
{ {
...@@ -408,11 +383,11 @@ int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) ...@@ -408,11 +383,11 @@ int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
source_offset = 0; source_offset = 0;
dest_offset = 0; dest_offset = 0;
for (sector=first_sector; sector<=last_sector; sector++) for (sector = first_sector; sector <= last_sector; sector++)
{ {
for(page = 0; page < bank->sectors[sector].size / FLASH_PAGE_SIZE; page++) for (page = 0; page < bank->sectors[sector].size / FLASH_PAGE_SIZE; page++)
{ {
if(bytes_remaining == 0) if (bytes_remaining == 0)
{ {
count = 0; count = 0;
memset(page_buffer, 0xFF, FLASH_PAGE_SIZE); memset(page_buffer, 0xFF, FLASH_PAGE_SIZE);
...@@ -436,19 +411,12 @@ int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) ...@@ -436,19 +411,12 @@ int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
} }
/* fill flash data latches with 1's */ /* fill flash data latches with 1's */
target_write_u32(target, F_CTRL, target_write_u32(target, F_CTRL, FC_CS | FC_SET_DATA | FC_WEN | FC_FUNC);
FC_CS |
FC_SET_DATA | target_write_u32(target, F_CTRL, FC_CS | FC_WEN | FC_FUNC);
FC_WEN |
FC_FUNC );
target_write_u32(target, F_CTRL,
FC_CS |
FC_WEN |
FC_FUNC );
/*would be better to use the clean target_write_buffer() interface but /*would be better to use the clean target_write_buffer() interface but
it seems not to be a LOT slower.... * it seems not to be a LOT slower....
bulk_write_memory() is no quicker :(*/ * bulk_write_memory() is no quicker :(*/
#if 1 #if 1
if (target->type->write_memory(target, offset + dest_offset, 4, 128, page_buffer) != ERROR_OK) if (target->type->write_memory(target, offset + dest_offset, 4, 128, page_buffer) != ERROR_OK)
{ {
...@@ -456,7 +424,7 @@ int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) ...@@ -456,7 +424,7 @@ int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
return ERROR_FLASH_OPERATION_FAILED; return ERROR_FLASH_OPERATION_FAILED;
} }
#else #else
if(target_write_buffer(target, offset + dest_offset, FLASH_PAGE_SIZE, page_buffer) != ERROR_OK) if (target_write_buffer(target, offset + dest_offset, FLASH_PAGE_SIZE, page_buffer) != ERROR_OK)
{ {
LOG_INFO("Write to flash buffer failed"); LOG_INFO("Write to flash buffer failed");
return ERROR_FLASH_OPERATION_FAILED; return ERROR_FLASH_OPERATION_FAILED;
...@@ -468,25 +436,16 @@ int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) ...@@ -468,25 +436,16 @@ int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
lpc288x_load_timer(LOAD_TIMER_WRITE, target); lpc288x_load_timer(LOAD_TIMER_WRITE, target);
target_write_u32( target, target_write_u32(target, F_CTRL, FC_PROG_REQ | FC_PROTECT | FC_FUNC | FC_CS);
F_CTRL,
FC_PROG_REQ |
FC_PROTECT |
FC_FUNC |
FC_CS);
} }
} }
return ERROR_OK; return ERROR_OK;
} }
int lpc288x_probe(struct flash_bank_s *bank) int lpc288x_probe(struct flash_bank_s *bank)
{ {
/* we only deal with LPC2888 so flash config is fixed /* we only deal with LPC2888 so flash config is fixed */
*/
lpc288x_flash_bank_t *lpc288x_info = bank->driver_priv; lpc288x_flash_bank_t *lpc288x_info = bank->driver_priv;
int retval; int retval;
...@@ -503,11 +462,9 @@ int lpc288x_probe(struct flash_bank_s *bank) ...@@ -503,11 +462,9 @@ int lpc288x_probe(struct flash_bank_s *bank)
retval = lpc288x_read_part_info(bank); retval = lpc288x_read_part_info(bank);
if (retval != ERROR_OK) if (retval != ERROR_OK)
return retval; return retval;
return ERROR_OK; return ERROR_OK;
} }
int lpc288x_info(struct flash_bank_s *bank, char *buf, int buf_size) int lpc288x_info(struct flash_bank_s *bank, char *buf, int buf_size)
{ {
snprintf(buf, buf_size, "lpc288x flash driver"); snprintf(buf, buf_size, "lpc288x flash driver");
...@@ -522,7 +479,7 @@ int lpc288x_protect(struct flash_bank_s *bank, int set, int first, int last) ...@@ -522,7 +479,7 @@ int lpc288x_protect(struct flash_bank_s *bank, int set, int first, int last)
/* probed? halted? */ /* probed? halted? */
status = lpc288x_system_ready(bank); status = lpc288x_system_ready(bank);
if(status != ERROR_OK) if (status != ERROR_OK)
{ {
return status; return status;
} }
...@@ -537,7 +494,7 @@ int lpc288x_protect(struct flash_bank_s *bank, int set, int first, int last) ...@@ -537,7 +494,7 @@ int lpc288x_protect(struct flash_bank_s *bank, int set, int first, int last)
for (lockregion = first; lockregion <= last; lockregion++) for (lockregion = first; lockregion <= last; lockregion++)
{ {
if(set) if (set)
{ {
/* write an odd value to base addy to protect... */ /* write an odd value to base addy to protect... */
value = 0x01; value = 0x01;
...@@ -547,19 +504,9 @@ int lpc288x_protect(struct flash_bank_s *bank, int set, int first, int last) ...@@ -547,19 +504,9 @@ int lpc288x_protect(struct flash_bank_s *bank, int set, int first, int last)
/* write an even value to base addy to unprotect... */ /* write an even value to base addy to unprotect... */
value = 0x00; value = 0x00;
} }
target_write_u32( target, target_write_u32(target, bank->sectors[lockregion].offset, value);
bank->sectors[lockregion].offset, target_write_u32(target, F_CTRL, FC_LOAD_REQ | FC_PROTECT | FC_WEN | FC_FUNC | FC_CS);
value);
target_write_u32( target,
F_CTRL,
FC_LOAD_REQ |
FC_PROTECT |
FC_WEN |
FC_FUNC |
FC_CS);
} }
return ERROR_OK; return ERROR_OK;
} }
...@@ -38,4 +38,3 @@ typedef struct lpc288x_flash_bank_s ...@@ -38,4 +38,3 @@ typedef struct lpc288x_flash_bank_s
} lpc288x_flash_bank_t; } lpc288x_flash_bank_t;
#endif /* lpc288x_H */ #endif /* lpc288x_H */
INCLUDES = -I$(top_srcdir)/src $(all_includes) INCLUDES = -I$(top_srcdir)/src $(all_includes) -I$(top_srcdir)/src/target
METASOURCES = AUTO METASOURCES = AUTO
AM_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" -DPKGLIBDIR=\"$(pkglibdir)\" @CPPFLAGS@ AM_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" -DPKGLIBDIR=\"$(pkglibdir)\" @CPPFLAGS@
noinst_LIBRARIES = libhelper.a noinst_LIBRARIES = libhelper.a
...@@ -10,20 +10,18 @@ CONFIGFILES = options.c jim.c ...@@ -10,20 +10,18 @@ CONFIGFILES = options.c jim.c
endif endif
libhelper_a_SOURCES = binarybuffer.c $(CONFIGFILES) configuration.c log.c command.c time_support.c \ libhelper_a_SOURCES = binarybuffer.c $(CONFIGFILES) configuration.c log.c command.c time_support.c \
replacements.c fileio.c replacements.c fileio.c startup_tcl.c
noinst_HEADERS = binarybuffer.h configuration.h types.h log.h command.h \
time_support.h replacements.h fileio.h \
jim.h
libhelper_a_SOURCES += startup_tcl.c noinst_HEADERS = binarybuffer.h configuration.h types.h log.h command.h \
time_support.h replacements.h fileio.h jim.h
noinst_PROGRAMS = bin2char noinst_PROGRAMS = bin2char
bin2char_SOURCES = bin2char.c bin2char_SOURCES = bin2char.c
# Convert .tcl to cfile # Convert .tcl to cfile
startup_tcl.c: bin2char startup.tcl startup_tcl.c: startup.tcl bin2char$(EXEEXT)
./bin2char startup_tcl < $(srcdir)/startup.tcl > startup_tcl.c ./bin2char$(EXEEXT) startup_tcl < $(srcdir)/$< > $@
# add startup_tcl.c to make clean list # add startup_tcl.c to make clean list
CLEANFILES = startup_tcl.c CLEANFILES = startup_tcl.c
...@@ -25,8 +25,9 @@ ...@@ -25,8 +25,9 @@
#endif #endif
#include "replacements.h" #include "replacements.h"
#include "target.h"
#include "command.h" #include "command.h"
#include "configuration.h"
#include "log.h" #include "log.h"
#include "time_support.h" #include "time_support.h"
...@@ -44,6 +45,9 @@ Jim_Interp *interp = NULL; ...@@ -44,6 +45,9 @@ Jim_Interp *interp = NULL;
int handle_sleep_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); int handle_sleep_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
int handle_fast_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); int handle_fast_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
int run_command(command_context_t *context, command_t *c, char *words[], int num_words);
static void tcl_output(void *privData, const char *file, int line, const char *function, const char *string) static void tcl_output(void *privData, const char *file, int line, const char *function, const char *string)
{ {
Jim_Obj *tclOutput=(Jim_Obj *)privData; Jim_Obj *tclOutput=(Jim_Obj *)privData;
...@@ -178,7 +182,6 @@ command_t* register_command(command_context_t *context, command_t *parent, char ...@@ -178,7 +182,6 @@ command_t* register_command(command_context_t *context, command_t *parent, char
Jim_CreateCommand(interp, full_name, script_command, c, NULL); Jim_CreateCommand(interp, full_name, script_command, c, NULL);
free((void *)full_name); free((void *)full_name);
/* accumulate help text in Tcl helptext list. */ /* accumulate help text in Tcl helptext list. */
Jim_Obj *helptext=Jim_GetGlobalVariableStr(interp, "ocd_helptext", JIM_ERRMSG); Jim_Obj *helptext=Jim_GetGlobalVariableStr(interp, "ocd_helptext", JIM_ERRMSG);
if (Jim_IsShared(helptext)) if (Jim_IsShared(helptext))
...@@ -207,7 +210,6 @@ int unregister_all_commands(command_context_t *context) ...@@ -207,7 +210,6 @@ int unregister_all_commands(command_context_t *context)
if (context == NULL) if (context == NULL)
return ERROR_OK; return ERROR_OK;
while(NULL != context->commands) while(NULL != context->commands)
{ {
c = context->commands; c = context->commands;
...@@ -277,7 +279,6 @@ int unregister_command(command_context_t *context, char *name) ...@@ -277,7 +279,6 @@ int unregister_command(command_context_t *context, char *name)
return ERROR_OK; return ERROR_OK;
} }
void command_output_text(command_context_t *context, const char *data) void command_output_text(command_context_t *context, const char *data)
{ {
if( context && context->output_handler && data ){ if( context && context->output_handler && data ){
...@@ -435,7 +436,6 @@ int command_run_line(command_context_t *context, char *line) ...@@ -435,7 +436,6 @@ int command_run_line(command_context_t *context, char *line)
return retval; return retval;
} }
int command_run_linef(command_context_t *context, char *format, ...) int command_run_linef(command_context_t *context, char *format, ...)
{ {
int retval=ERROR_FAIL; int retval=ERROR_FAIL;
...@@ -451,8 +451,6 @@ int command_run_linef(command_context_t *context, char *format, ...) ...@@ -451,8 +451,6 @@ int command_run_linef(command_context_t *context, char *format, ...)
return retval; return retval;
} }
void command_set_output_handler(command_context_t* context, int (*output_handler)(struct command_context_s *context, const char* line), void *priv) void command_set_output_handler(command_context_t* context, int (*output_handler)(struct command_context_s *context, const char* line), void *priv)
{ {
context->output_handler = output_handler; context->output_handler = output_handler;
...@@ -476,7 +474,6 @@ int command_done(command_context_t *context) ...@@ -476,7 +474,6 @@ int command_done(command_context_t *context)
return ERROR_OK; return ERROR_OK;
} }
/* find full path to file */ /* find full path to file */
static int jim_find(Jim_Interp *interp, int argc, Jim_Obj *const *argv) static int jim_find(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{ {
...@@ -502,8 +499,6 @@ static int jim_echo(Jim_Interp *interp, int argc, Jim_Obj *const *argv)