]>
cloudbase.mooo.com Git - z180-stamp.git/blob - avr/cmd_misc.c
2 * (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de>
5 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
7 * SPDX-License-Identifier: GPL-2.0+
16 #include "con-utils.h"
17 #include "getopt-min.h"
20 command_ret_t
do_echo(cmd_tbl_t
*cmdtp
, int flag
, int argc
, char * const argv
[])
22 bool put_newline
= true;
24 (void) cmdtp
; (void) flag
;
30 while ((opt
= getopt(argc
, argv
, PSTR("n"))) != -1) {
40 for (uint_fast8_t i
= optind
; i
< argc
; i
++) {
51 return CMD_RET_SUCCESS
;
55 command_ret_t
do_sleep(cmd_tbl_t
*cmdtp
, int flag
, int argc
, char * const argv
[])
57 unsigned long start
= get_timer(0);
60 uint_fast8_t millisec
= 0;
62 (void) cmdtp
; (void) flag
;
67 delay
= strtoul(argv
[1], &sp
, 10);
81 while (get_timer(start
) < delay
) {
83 return CMD_RET_FAILURE
;
88 return CMD_RET_SUCCESS
;