flash/stm32l4x: support STM32U59/U5Ax devices
[openocd.git] / src / helper / util.c
blob2e9f6155ee5d48a58b9e3c7bd18a910a4d1c9295
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 /***************************************************************************
4 * Copyright (C) 2010 by Øyvind Harboe *
5 ***************************************************************************/
7 /* this file contains various functionality useful to standalone systems */
9 #ifdef HAVE_CONFIG_H
10 #include "config.h"
11 #endif
13 #include "log.h"
14 #include "time_support.h"
15 #include "util.h"
17 COMMAND_HANDLER(handler_util_ms)
19 if (CMD_ARGC != 0)
20 return ERROR_COMMAND_SYNTAX_ERROR;
22 command_print(CMD, "%" PRId64, timeval_ms());
24 return ERROR_OK;
27 static const struct command_registration util_command_handlers[] = {
29 .name = "ms",
30 .mode = COMMAND_ANY,
31 .handler = handler_util_ms,
32 .help =
33 "Returns ever increasing milliseconds. Used to calculate differences in time.",
34 .usage = "",
36 COMMAND_REGISTRATION_DONE
39 int util_init(struct command_context *cmd_ctx)
41 return register_commands(cmd_ctx, NULL, util_command_handlers);