jtag ulink: dont compile function when not required

ulink_calculate_frequency() is used exclusively when
_DEBUG_JTAG_IO_ is set, no need to compile this
function if it is not used.
Declaring it static in the same commit.

Change-Id: I243ffdf69a1dc3bee6d16e4bb8d78396b6ea5144
Signed-off-by: Alexander Kurz <akurz@blala.de>
Reviewed-on: http://openocd.zylin.com/3241
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
__archive__
Alexander Kurz 2016-02-14 10:04:51 +01:00 committed by Andreas Fritiofson
parent 20f7a084dd
commit 17ec0b1044
1 changed files with 4 additions and 2 deletions

View File

@ -193,6 +193,7 @@ int ulink_execute_queued_commands(struct ulink *device, int timeout);
const char *ulink_cmd_id_string(uint8_t id);
void ulink_print_command(struct ulink_cmd *ulink_cmd);
void ulink_print_queue(struct ulink *device);
static int ulink_calculate_frequency(enum ulink_delay_type type, int delay, long *f);
#endif
int ulink_append_scan_cmd(struct ulink *device,
@ -225,7 +226,6 @@ int ulink_append_test_cmd(struct ulink *device);
/* OpenULINK TCK frequency helper functions */
int ulink_calculate_delay(enum ulink_delay_type type, long f, int *delay);
int ulink_calculate_frequency(enum ulink_delay_type type, int delay, long *f);
/* Interface between OpenULINK and OpenOCD */
static void ulink_set_end_state(tap_state_t endstate);
@ -1369,6 +1369,7 @@ int ulink_calculate_delay(enum ulink_delay_type type, long f, int *delay)
return ERROR_OK;
}
#ifdef _DEBUG_JTAG_IO_
/**
* Calculate frequency for a given delay value.
*
@ -1383,7 +1384,7 @@ int ulink_calculate_delay(enum ulink_delay_type type, long f, int *delay)
* @return on success: ERROR_OK
* @return on failure: ERROR_FAIL
*/
int ulink_calculate_frequency(enum ulink_delay_type type, int delay, long *f)
static int ulink_calculate_frequency(enum ulink_delay_type type, int delay, long *f)
{
float t, f_float, f_rounded;
@ -1432,6 +1433,7 @@ int ulink_calculate_frequency(enum ulink_delay_type type, int delay, long *f)
return ERROR_OK;
}
#endif
/******************* Interface between OpenULINK and OpenOCD ******************/